[RHEL7,COMMIT] fs/fuse kio_pcs: add WARN_ON in fuse_size_grow_work() to investigate #PSBM-85945

Submitted by Konstantin Khorenko on June 27, 2018, 3:54 p.m.

Details

Message ID 201806271554.w5RFsAR7017034@finist_ce7.work
State New
Series "fs/fuse kio_pcs: add WARN_ON in fuse_size_grow_work() to investigate #PSBM-85945"
Headers show

Commit Message

Konstantin Khorenko June 27, 2018, 3:54 p.m.
The commit is pushed to "branch-rh7-3.10.0-862.3.2.vz7.61.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-862.3.2.vz7.61.5
------>
commit 3a13a493f5f87a4e82d52ecc910237c4a1019031
Author: Pavel Butsykin <pbutsykin@virtuozzo.com>
Date:   Wed Jun 27 18:54:10 2018 +0300

    fs/fuse kio_pcs: add WARN_ON in fuse_size_grow_work() to investigate #PSBM-85945
    
    Debug patch for https://jira.sw.ru/browse/PSBM-85945
    
    Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
    Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 fs/fuse/kio/pcs/pcs_fuse_kdirect.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Patch hide | download patch | download mbox

diff --git a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
index 6bc68e718d07..2f300d39d5b2 100644
--- a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
+++ b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
@@ -678,9 +678,18 @@  static void fuse_size_grow_work(struct work_struct *w)
 			size = r->exec.size.required;
 	}
 	di->size.required = size;
+	if (di->fileinfo.attr.size > size) {
+		pr_info("attr.size: %llu, grow_size: %llu, grow_queue: %d\n",
+			di->fileinfo.attr.size, size, list_empty(&di->size.grow_queue));
+		spin_unlock(&di->lock);
+		WARN_ON(1);
+		err = PCS_ERR_IO;
+		goto fail;
+	}
 	spin_unlock(&di->lock);
 
 	err = submit_size_grow(inode, size);
+fail:
 	if (err) {
 		LIST_HEAD(to_fail);