]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: tree-log: make the return value for log syncing consistent
authorJosef Bacik <josef@toxicpanda.com>
Mon, 13 Jun 2022 19:09:48 +0000 (15:09 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Jul 2022 15:45:34 +0000 (17:45 +0200)
commit43042b9104d06e231424edf295af4e5a85066a22
tree6b85adc65b4be2c3a4fed86d22d178a3df53637c
parentec2ccb0e09fb9ca9ae0c1d01630fb2bf8733a0a7
btrfs: tree-log: make the return value for log syncing consistent

Currently we will return 1 or -EAGAIN if we decide we need to commit
the transaction rather than sync the log.  In practice this doesn't
really matter, we interpret any !0 and !BTRFS_NO_LOG_SYNC as needing to
commit the transaction.  However this makes it hard to figure out what
the correct thing to do is.

Fix this up by defining BTRFS_LOG_FORCE_COMMIT and using this in all the
places where we want to force the transaction to be committed.

CC: stable@vger.kernel.org # 5.15+
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/file.c
fs/btrfs/tree-log.c
fs/btrfs/tree-log.h