Message ID | ee253f2941587230ad04dcb5386cfcd04e20066a.1716386100.git.fdmanana@suse.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | btrfs: avoid some unnecessary commit of empty transactions | expand |
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 376c5c2e9aed..6c7b5d52591e 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -2446,9 +2446,13 @@ static int finish_extent_writes_for_zoned(struct btrfs_root *root, btrfs_wait_nocow_writers(cache); btrfs_wait_ordered_roots(fs_info, U64_MAX, cache); - trans = btrfs_join_transaction(root); - if (IS_ERR(trans)) - return PTR_ERR(trans); + trans = btrfs_attach_transaction_barrier(root); + if (IS_ERR(trans)) { + int ret = PTR_ERR(trans); + + return (ret == -ENOENT) ? 0 : ret; + } + return btrfs_commit_transaction(trans); }