]> git.baikalelectronics.ru Git - kernel.git/commit
9p: fix EBADF errors in cached mode
authorDominique Martinet <asmadeus@codewreck.org>
Tue, 14 Jun 2022 03:19:02 +0000 (12:19 +0900)
committerDominique Martinet <asmadeus@codewreck.org>
Thu, 16 Jun 2022 21:03:30 +0000 (06:03 +0900)
commit74b0db81f05c22195e0c358c584e642b5277fddf
tree4736e74dcdf373ab91d1591463c839391a53131b
parent31154383313e33ce6e86923cec7781f307130ee4
9p: fix EBADF errors in cached mode

cached operations sometimes need to do invalid operations (e.g. read
on a write only file)
Historic fscache had added a "writeback fid", a special handle opened
RW as root, for this. The conversion to new fscache missed that bit.

This commit reinstates a slightly lesser variant of the original code
that uses the writeback fid for partial pages backfills if the regular
user fid had been open as WRONLY, and thus would lack read permissions.

Link: https://lkml.kernel.org/r/20220614033802.1606738-1-asmadeus@codewreck.org
Fixes: a168aa80da92 ("9p: Convert to using the netfs helper lib to do reads and caching")
Cc: stable@vger.kernel.org
Cc: David Howells <dhowells@redhat.com>
Reported-By: Christian Schoenebeck <linux_oss@crudebyte.com>
Reviewed-by: Christian Schoenebeck <linux_oss@crudebyte.com>
Tested-by: Christian Schoenebeck <linux_oss@crudebyte.com>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
fs/9p/vfs_addr.c