From: Alexey Velichayshiy Date: Sun, 22 Feb 2026 12:47:23 +0000 (+0300) Subject: btrfs: remove redundant nowait check in lock_extent_direct() X-Git-Tag: ceph-for-7.1-rc4~321^2~72 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8c0b917d78fc2a1fb4afac90a597b75e0a5b7223;p=ceph-client.git btrfs: remove redundant nowait check in lock_extent_direct() The nowait flag is always false in this context, making the conditional check unnecessary. Simplify the code by directly assigning -ENOTBLK. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Alexey Velichayshiy Reviewed-by: Filipe Manana Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/direct-io.c b/fs/btrfs/direct-io.c index 837306254f73..57167d56dc72 100644 --- a/fs/btrfs/direct-io.c +++ b/fs/btrfs/direct-io.c @@ -107,7 +107,7 @@ static int lock_extent_direct(struct inode *inode, u64 lockstart, u64 lockend, test_bit(BTRFS_ORDERED_DIRECT, &ordered->flags)) btrfs_start_ordered_extent(ordered); else - ret = nowait ? -EAGAIN : -ENOTBLK; + ret = -ENOTBLK; btrfs_put_ordered_extent(ordered); } else { /*