diff options
author | yangyun <yangyun50@huawei.com> | 2024-09-14 10:51:31 +0200 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2024-09-24 13:21:33 +0200 |
commit | 2f3d8ff457982f4055fe8f7bf19d3821ba22c376 (patch) | |
tree | 3b224336b3c4909ee40d0cdfec9d395ab8d36d37 | |
parent | fuse: clear FR_PENDING if abort is detected when sending request (diff) | |
download | linux-2f3d8ff457982f4055fe8f7bf19d3821ba22c376.tar.xz linux-2f3d8ff457982f4055fe8f7bf19d3821ba22c376.zip |
fuse: use exclusive lock when FUSE_I_CACHE_IO_MODE is set
This may be a typo. The comment has said shared locks are
not allowed when this bit is set. If using shared lock, the
wait in `fuse_file_cached_io_open` may be forever.
Fixes: 205c1d802683 ("fuse: allow parallel dio writes with FUSE_DIRECT_IO_ALLOW_MMAP")
CC: stable@vger.kernel.org # v6.9
Signed-off-by: yangyun <yangyun50@huawei.com>
Reviewed-by: Bernd Schubert <bschubert@ddn.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
-rw-r--r-- | fs/fuse/file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index b8afeca12487..1b5cd46c8225 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -1345,7 +1345,7 @@ static bool fuse_dio_wr_exclusive_lock(struct kiocb *iocb, struct iov_iter *from /* shared locks are not allowed with parallel page cache IO */ if (test_bit(FUSE_I_CACHE_IO_MODE, &fi->state)) - return false; + return true; /* Parallel dio beyond EOF is not supported, at least for now. */ if (fuse_io_past_eof(iocb, from)) |