[Devel] [PATCH RHEL7 COMMIT] fs/fuse kio_pcs: handle error of submit_size_grow()
Konstantin Khorenko
khorenko at virtuozzo.com
Fri Jun 15 14:59:14 MSK 2018
The commit is pushed to "branch-rh7-3.10.0-693.21.1.vz7.50.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.21.1.vz7.50.9
------>
commit 81daeececea0d1634c34717cfd74b74725266bb9
Author: Pavel Butsykin <pbutsykin at virtuozzo.com>
Date: Fri Jun 15 14:59:14 2018 +0300
fs/fuse kio_pcs: handle error of submit_size_grow()
Before continuing write requests, we need to check the procedure size grow was
successful. If the size attribute of a file failed to increase, it makes no
sense to continue to push write requests because they will not be able to
succeed until the file size will match.
https://pmc.acronis.com/browse/VSTOR-10635
Signed-off-by: Pavel Butsykin <pbutsykin at virtuozzo.com>
Reviewed-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
fs/fuse/kio/pcs/pcs_fuse_kdirect.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
index a4064904f963..cd6497080070 100644
--- a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
+++ b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
@@ -648,6 +648,7 @@ static void fuse_size_grow_work(struct work_struct *w)
struct inode *inode = &di->inode->inode;
struct pcs_int_request* ireq, *next;
unsigned long long size = 0;
+ int err;
LIST_HEAD(to_submit);
spin_lock(&di->lock);
@@ -667,7 +668,19 @@ static void fuse_size_grow_work(struct work_struct *w)
}
di->size.required = size;
spin_unlock(&di->lock);
- submit_size_grow(inode, size);
+
+ err = submit_size_grow(inode, size);
+ if (err) {
+ LIST_HEAD(to_fail);
+
+ spin_lock(&di->lock);
+ di->size.required = 0;
+ list_splice_tail_init(&di->size.grow_queue, &to_fail);
+ spin_unlock(&di->lock);
+
+ pcs_ireq_queue_fail(&to_fail, err);
+ return;
+ }
spin_lock(&di->lock);
BUG_ON(di->size.shrink);
More information about the Devel
mailing list