[Devel] [PATCH] fs/fuse kio: fix getting a non-existent pcs inode in kpcs_kill_requests()

Pavel Butsykin pbutsykin at virtuozzo.com
Tue Mar 26 13:57:04 MSK 2019


Some files may not have pcs inode, so it will be safer to check for !fi->private
before using it.

Signed-off-by: Pavel Butsykin <pbutsykin at virtuozzo.com>
---
 fs/fuse/kio/pcs/pcs_fuse_kdirect.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
index 875ad18df4a7..a8c235244506 100644
--- a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
+++ b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
@@ -1506,11 +1506,16 @@ static void kpcs_kill_requests(struct fuse_conn *fc, struct inode *inode)
 
 	list_for_each_entry(ff, &fc->conn_files, fl) {
 		struct pcs_dentry_info *di;
+		struct fuse_inode *fi;
 
 		if (!ff->ff_dentry)
 			continue;
 
-		di = get_pcs_inode(ff->ff_dentry->d_inode);
+		fi = get_fuse_inode(ff->ff_dentry->d_inode);
+		if (!fi->private)
+			continue;
+
+		di = pcs_inode_from_fuse(fi);
 
 		spin_lock(&di->kq_lock);
 		fuse_kill_requests(fc, inode, &di->kq);
-- 
2.15.1



More information about the Devel mailing list