]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix error handling in btrfs_truncate_inode_items()
authorOmar Sandoval <osandov@fb.com>
Fri, 11 May 2018 20:13:30 +0000 (13:13 -0700)
committerDavid Sterba <dsterba@suse.com>
Mon, 28 May 2018 16:23:44 +0000 (18:23 +0200)
commit0cce301e8ff500770ebb3f8cbd671c3d37d8828b
tree6d0122d556e1ff8fbd6fbac84523403f9d634cd6
parentdf67621ece26a68c2cedac6fc2106838a1689a03
Btrfs: fix error handling in btrfs_truncate_inode_items()

btrfs_truncate_inode_items() uses two variables for error handling, ret
and err. These are not handled consistently, leading to a couple of
bugs.

- Errors from btrfs_del_items() are handled but not propagated to the
  caller
- If btrfs_run_delayed_refs() fails and aborts the transaction, we
  continue running

Just use ret everywhere and simplify things a bit, fixing both of these
issues.

Fixes: 99175604eacb ("btrfs: replace many BUG_ONs with proper error handling")
Fixes: 9f7241dbcaf1 ("Btrfs: account for crcs in delayed ref processing")
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c