diff mbox series

[02/32] lustre: flr: Don't assume RDONLY implies SOM

Message ID 1659577097-19253-3-git-send-email-jsimmons@infradead.org (mailing list archive)
State New, archived
Headers show
Series lustre: Update to OpenSFS as of Aug 3 2022 | expand

Commit Message

James Simmons Aug. 4, 2022, 1:37 a.m. UTC
From: Patrick Farrell <pfarrell@whamcloud.com>

In lov_io_slice_mirror_init, the client code assumes that
the LCM_FL_RDONLY flag in the layout implies SOM and skips
glimpse if it sees one.  The RDONLY flag means the mirrors
are in sync, which has historically implied SOM is valid.

To start with, using LCM_FL_RDONLY to imply SOM is sort of
a layering violation.  SOM is only communicated from the
MDS when it is valid, and the client already skips glimpse
in that case, so this duplicates functionality from the
higher layers.

More seriously, patch:
"LU-14526 flr: mirror split downgrade SOM"
(https://review.whamcloud.com/43168/)
Made it possible to have LCM_FL_RDONLY but not strict SOM,
so this assumption is no longer correct.

The fix is to not look at LCM_FL_RDONLY when deciding
whether to glimpse a file for size.

WC-bug-id: https://jira.whamcloud.com/browse/LU-15609
Lustre-commit: 250108ad754cfa932 ("LU-15609 flr: Don't assume RDONLY implies SOM")
Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/46666
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/include/obd_support.h | 7 +++----
 fs/lustre/lov/lov_io.c          | 7 -------
 2 files changed, 3 insertions(+), 11 deletions(-)
diff mbox series

Patch

diff --git a/fs/lustre/include/obd_support.h b/fs/lustre/include/obd_support.h
index 0732fe9a..b6c8a72 100644
--- a/fs/lustre/include/obd_support.h
+++ b/fs/lustre/include/obd_support.h
@@ -515,10 +515,9 @@ 
 #define OBD_FAIL_UNKNOWN_LMV_STRIPE			0x1901
 
 /* FLR */
-#define OBD_FAIL_FLR_GLIMPSE_IMMUTABLE			0x1A00
-#define OBD_FAIL_FLR_LV_DELAY			0x1A01
-#define OBD_FAIL_FLR_LV_INC			0x1A02
-#define OBD_FAIL_FLR_RANDOM_PICK_MIRROR	0x1A03
+#define OBD_FAIL_FLR_LV_DELAY				0x1A01
+#define OBD_FAIL_FLR_LV_INC				0x1A02
+#define OBD_FAIL_FLR_RANDOM_PICK_MIRROR			0x1A03
 
 /* LNet is allocated failure locations 0xe000 to 0xffff */
 /* Assign references to moved code to reduce code changes */
diff --git a/fs/lustre/lov/lov_io.c b/fs/lustre/lov/lov_io.c
index b535092..32f028b 100644
--- a/fs/lustre/lov/lov_io.c
+++ b/fs/lustre/lov/lov_io.c
@@ -540,13 +540,6 @@  static int lov_io_slice_init(struct lov_io *lio, struct lov_object *obj,
 	case CIT_GLIMPSE:
 		lio->lis_pos = 0;
 		lio->lis_endpos = OBD_OBJECT_EOF;
-
-		if (lov_flr_state(obj) == LCM_FL_RDONLY &&
-		    !OBD_FAIL_CHECK(OBD_FAIL_FLR_GLIMPSE_IMMUTABLE)) {
-			/* SoM is accurate, no need glimpse */
-			result = 1;
-			goto out;
-		}
 		break;
 
 	case CIT_MISC: