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

James Simmons jsimmons at infradead.org
Sun Mar 20 06:30:57 PDT 2022


From: Vladimir Saveliev <vlaidimir.saveliev at 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 at hpe.com>
Reviewed-on: https://review.whamcloud.com/46178
Reviewed-by: Alexander Boyko <alexander.boyko at hpe.com>
Reviewed-by: Andrew Perepechko <andrew.perepechko at hpe.com>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 fs/lustre/llite/vvp_io.c | 5 +++++
 1 file changed, 5 insertions(+)

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 */
-- 
1.8.3.1



More information about the lustre-devel mailing list