diff mbox series

[43/50] lustre: llite: clear async errors on write commit sync

Message ID 1647783064-20688-44-git-send-email-jsimmons@infradead.org (mailing list archive)
State New, archived
Headers show
Series lustre: update to OpenSFS tree as of March 20, 2022 | expand

Commit Message

James Simmons March 20, 2022, 1:30 p.m. UTC
From: Vladimir Saveliev <vlaidimir.saveliev@hpe.com>

Async errors should be cleared after vvp_io_commit_sync(). Otherwise,
that will be done in ll_flush() called from
linux/fs/open.c:filp_close() and close(2) will fail. ll_flush()
replaces any error code with EIO which is confusing.

HPE-bug-id: LUS-7529
WC-bug-id: https://jira.whamcloud.com/browse/LU-15459
Lustre-commit: 73d5ee7033d0bd7dc ("LU-15459 llite: clear async errors on write commit sync")
Signed-off-by: Vladimir Saveliev <vlaidimir.saveliev@hpe.com>
Reviewed-on: https://review.whamcloud.com/46178
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
Reviewed-by: Andrew Perepechko <andrew.perepechko@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/llite/vvp_io.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/fs/lustre/llite/vvp_io.c b/fs/lustre/llite/vvp_io.c
index 40047f8..77e54ce 100644
--- a/fs/lustre/llite/vvp_io.c
+++ b/fs/lustre/llite/vvp_io.c
@@ -1109,6 +1109,8 @@  int vvp_io_write_commit(const struct lu_env *env, struct cl_io *io)
 
 	/* out of quota, try sync write */
 	if (rc == -EDQUOT && !cl_io_is_mkwrite(io)) {
+		struct ll_inode_info *lli = ll_i2info(inode);
+
 		rc = vvp_io_commit_sync(env, io, queue,
 					vio->u.readwrite.vui_from,
 					vio->u.readwrite.vui_to);
@@ -1116,6 +1118,9 @@  int vvp_io_write_commit(const struct lu_env *env, struct cl_io *io)
 			vio->u.readwrite.vui_written += rc;
 			rc = 0;
 		}
+		if (lli->lli_clob)
+			lov_read_and_clear_async_rc(lli->lli_clob);
+		lli->lli_async_rc = 0;
 	}
 
 	/* update inode size */