[Devel,vz7] fuse: fuse_blocked_for_wb must check rw_files

Submitted by Maxim Patlasov on Dec. 17, 2016, 2:45 a.m.

Details

Message ID 148194269264.13200.3375843961274427182.stgit@maxim-thinkpad
State New
Series "fuse: fuse_blocked_for_wb must check rw_files"
Headers show

Commit Message

Maxim Patlasov Dec. 17, 2016, 2:45 a.m.
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@virtuozzo.com>
---
 fs/fuse/file.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 1bda994..540c18b 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -2153,9 +2153,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;
 	}