[Devel] [PATCH RHEL7 COMMIT] fs/fuse kio_pcs: cleanup kpcs_setattr_end()

Konstantin Khorenko khorenko at virtuozzo.com
Tue Nov 13 13:57:21 MSK 2018


The commit is pushed to "branch-rh7-3.10.0-862.20.2.vz7.73.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-862.20.2.vz7.73.3
------>
commit 0946ba488863f1aeb495d55deb3a2f32f8c7fd40
Author: Pavel Butsykin <pbutsykin at virtuozzo.com>
Date:   Tue Nov 13 13:57:17 2018 +0300

    fs/fuse kio_pcs: cleanup kpcs_setattr_end()
    
    Required for the next patch.
    
    https://pmc.acronis.com/browse/VSTOR-16863
    
    Signed-off-by: Pavel Butsykin <pbutsykin at virtuozzo.com>
    Acked-by: Alexey Kuznetsov <kuznet at virtuozzo.com>
---
 fs/fuse/kio/pcs/pcs_fuse_kdirect.c | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
index 3b9a77cb6550..1e493a8b3d39 100644
--- a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
+++ b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
@@ -987,24 +987,25 @@ static void kpcs_setattr_end(struct fuse_conn *fc, struct fuse_req *req)
 	struct fuse_inode *fi = get_fuse_inode(req->io_inode);
 	struct fuse_setattr_in *inarg = (void*) req->in.args[0].value;
 	struct fuse_attr_out *outarg = (void*) req->out.args[0].value;
-	struct pcs_dentry_info *di = fi->private;
+	struct pcs_dentry_info *di = pcs_inode_from_fuse(fi);
 
 	BUG_ON(req->in.h.opcode != FUSE_SETATTR);
-	BUG_ON(!di);
-	di = pcs_inode_from_fuse(fi);
+	TRACE("update size: ino:%lu old_sz:%lld new:%lld\n",
+	      req->io_inode->i_ino, di->fileinfo.attr.size, outarg->attr.size);
+
+	if (req->out.h.error)
+		goto fail;
+
 	spin_lock(&di->lock);
-	TRACE("update size: ino:%lu old_sz:%lld new:%lld\n",req->io_inode->i_ino,
-	      di->fileinfo.attr.size, outarg->attr.size);
-
-	if (!req->out.h.error) {
-		di->fileinfo.attr.size = outarg->attr.size;
-		if (outarg->attr.size != inarg->size) {
-			pr_err("kio: failed to set requested size: %llu %llu\n",
-				outarg->attr.size, inarg->size);
-			req->out.h.error = -EIO;
-		}
-	}
+	di->fileinfo.attr.size = outarg->attr.size;
 	spin_unlock(&di->lock);
+
+	if (outarg->attr.size != inarg->size) {
+		pr_err("kio: failed to set requested size: %llu %llu\n",
+			outarg->attr.size, inarg->size);
+		req->out.h.error = -EIO;
+	}
+fail:
 	if(r->end)
 		r->end(fc, req);
 }



More information about the Devel mailing list