diff options
Diffstat (limited to 'fs/logfs')
-rw-r--r-- | fs/logfs/inode.c | 2 | ||||
-rw-r--r-- | fs/logfs/readwrite.c | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/fs/logfs/inode.c b/fs/logfs/inode.c index adb90116d36..af49e2d6941 100644 --- a/fs/logfs/inode.c +++ b/fs/logfs/inode.c @@ -33,7 +33,7 @@ * are being written out - and waiting for GC to make progress, naturally. * * So we cannot just call iget() or some variant of it, but first have to check - * wether the inode in question might be in I_FREEING state. Therefore we + * whether the inode in question might be in I_FREEING state. Therefore we * maintain our own per-sb list of "almost deleted" inodes and check against * that list first. Normally this should be at most 1-2 entries long. * diff --git a/fs/logfs/readwrite.c b/fs/logfs/readwrite.c index e1a3b6bf632..9a59cbade2f 100644 --- a/fs/logfs/readwrite.c +++ b/fs/logfs/readwrite.c @@ -1887,9 +1887,15 @@ int logfs_truncate(struct inode *inode, u64 target) logfs_put_wblocks(sb, NULL, 1); } - if (!err) - err = vmtruncate(inode, target); + if (!err) { + err = inode_newsize_ok(inode, target); + if (err) + goto out; + + truncate_setsize(inode, target); + } + out: /* I don't trust error recovery yet. */ WARN_ON(err); return err; |