From: yangyun Date: Sat, 14 Sep 2024 08:51:31 +0000 (+0800) Subject: fuse: use exclusive lock when FUSE_I_CACHE_IO_MODE is set X-Git-Tag: v6.10.13~184 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa4890bd8237e5a1e7428acd7328729db2703b23;p=thirdparty%2Fkernel%2Fstable.git fuse: use exclusive lock when FUSE_I_CACHE_IO_MODE is set commit 2f3d8ff457982f4055fe8f7bf19d3821ba22c376 upstream. 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 Reviewed-by: Bernd Schubert Signed-off-by: Miklos Szeredi Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/fuse/file.c b/fs/fuse/file.c index ed76121f73f2e..08f7d538ca98f 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))