]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
btrfs: remove redundant nowait check in lock_extent_direct()
authorAlexey Velichayshiy <a.velichayshiy@ispras.ru>
Sun, 22 Feb 2026 12:47:23 +0000 (15:47 +0300)
committerDavid Sterba <dsterba@suse.com>
Tue, 7 Apr 2026 16:55:58 +0000 (18:55 +0200)
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 <a.velichayshiy@ispras.ru>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/direct-io.c

index 837306254f73681328d0522514253d239ce6a6ff..57167d56dc7277e0bc4c36b6b0d2aede03edd7be 100644 (file)
@@ -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 {
                        /*