aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-05-24 14:47:43 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-05-24 14:47:43 -0400
commitd7b66b4ab0344dcc4bf169e0bbfda6234cdf6966 (patch)
tree17a529125f0cd3d4904f44e7caf541e7827bd53d
parentd883c6cf3b39f1f42506e82ad2779fb88004acf3 (diff)
parentd50147381aa0c9725d63a677c138c47f55d6d3bc (diff)
Merge tag 'for-4.17-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux
Pull btrfs fix from David Sterba: "A one-liner that prevents leaking an internal error value 1 out of the ftruncate syscall. This has been observed in practice. The steps to reproduce make a common pattern (open/write/fync/ftruncate) but also need the application to not check only for negative values and happens only for compressed inlined files. The conditions are narrow but as this could break userspace I think it's better to merge it now and not wait for the merge window" * tag 'for-4.17-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: Btrfs: fix error handling in btrfs_truncate()
-rw-r--r--fs/btrfs/inode.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index d3862e7e4fee..0b86cf10cf2a 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -9117,7 +9117,8 @@ static int btrfs_truncate(struct inode *inode, bool skip_writeback)
9117 BTRFS_EXTENT_DATA_KEY); 9117 BTRFS_EXTENT_DATA_KEY);
9118 trans->block_rsv = &fs_info->trans_block_rsv; 9118 trans->block_rsv = &fs_info->trans_block_rsv;
9119 if (ret != -ENOSPC && ret != -EAGAIN) { 9119 if (ret != -ENOSPC && ret != -EAGAIN) {
9120 err = ret; 9120 if (ret < 0)
9121 err = ret;
9121 break; 9122 break;
9122 } 9123 }
9123 9124