[lustre-devel] [PATCH 02/27] lustre: lov: continue fsync on other OST objs even on -ENOENT
James Simmons
jsimmons at infradead.org
Mon Apr 17 06:46:58 PDT 2023
From: Bobi Jam <bobijam at whamcloud.com>
When fsync races with truncate, we'd continue to other OST object's
fsync even some stripe fsync returns -ENOENT, so that on client it
could potentially discard caching pages by calling
osc_io_fsync_start()->osc_cache_writebase_range().
WC-bug-id: https://jira.whamcloud.com/browse/LU-16263
Lustre-commit: 927b5cd49c3369d53 ("LU-16263 lov: continue fsync on other OST objs even on -ENOENT")
Signed-off-by: Bobi Jam <bobijam at whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50005
Reviewed-by: Andreas Dilger <adilger at whamcloud.com>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
fs/lustre/lov/lov_io.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/fs/lustre/lov/lov_io.c b/fs/lustre/lov/lov_io.c
index 32f028b..4c842cd 100644
--- a/fs/lustre/lov/lov_io.c
+++ b/fs/lustre/lov/lov_io.c
@@ -1013,8 +1013,16 @@ static int lov_io_call(const struct lu_env *env, struct lov_io *lio,
list_for_each_entry(sub, &lio->lis_active, sub_linkage) {
rc = iofunc(sub->sub_env, &sub->sub_io);
- if (rc)
+ if (rc) {
+ /**
+ * fsync race with truncate, we'd continue to other
+ * OST object's fsync to potentially discard
+ * caching pages (osc_cache_writeback_range).
+ */
+ if (rc == -ENOENT && parent->ci_type == CIT_FSYNC)
+ continue;
break;
+ }
if (parent->ci_result == 0)
parent->ci_result = sub->sub_io.ci_result;
--
1.8.3.1
More information about the lustre-devel
mailing list