[Devel] [PATCH rh6] fuse: fuse_blocked_for_wb must check rw_files

Maxim Patlasov mpatlasov at virtuozzo.com
Fri Dec 16 18:46:06 PST 2016


The patch fixes a silly mistake leading to a deadlock in
fuse_invalidate_files: so far as fuse_invalidate_files sets
FUSE_S_FAIL_IMMEDIATELY in all files of fi->rw_files list,
fuse_blocked_for_wb must check the bit in *this* list
(not in fi->write_files as it used to be).

https://jira.sw.ru/browse/PSBM-57460

Signed-off-by: Maxim Patlasov <mpatlasov at virtuozzo.com>
---
 fs/fuse/file.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index a557d5a..353092c 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -2155,9 +2155,9 @@ static inline bool fuse_blocked_for_wb(struct inode *inode)
 		return false;
 
 	spin_lock(&fc->lock);
-	if (!list_empty(&fi->write_files)) {
-		struct fuse_file *ff = list_entry(fi->write_files.next,
-						  struct fuse_file, write_entry);
+	if (!list_empty(&fi->rw_files)) {
+		struct fuse_file *ff = list_entry(fi->rw_files.next,
+						  struct fuse_file, rw_entry);
 		if (test_bit(FUSE_S_FAIL_IMMEDIATELY, &ff->ff_state))
 			blocked = false;
 	}



More information about the Devel mailing list