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

Konstantin Khorenko khorenko at virtuozzo.com
Thu Mar 28 11:42:17 MSK 2019


The commit is pushed to "branch-rh7-3.10.0-957.10.1.vz7.85.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-957.10.1.vz7.85.4
------>
commit f67508d1db9a6ecd1d139021e5261d9fafe589d4
Author: Pavel Butsykin <pbutsykin at virtuozzo.com>
Date:   Thu Mar 28 11:42:16 2019 +0300

    fs/fuse kio: fix getting a non-existent pcs inode in kpcs_kill_requests()
    
    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 035f58302be3..010f90621df0 100644
--- a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
+++ b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
@@ -1515,11 +1515,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);



More information about the Devel mailing list