diff mbox series

[12/45] lustre: lov: lov_io_sub_init()) ASSERTION

Message ID 1590444502-20533-13-git-send-email-jsimmons@infradead.org (mailing list archive)
State New, archived
Headers show
Series lustre: merged OpenSFS client patches from April 30 to today | expand

Commit Message

James Simmons May 25, 2020, 10:07 p.m. UTC
From: Bobi Jam <bobijam@whamcloud.com>

The assertion is_index_within_mirror() in lov_io_sub_init() should
only be applied for a FLR file, since a plain file does not initialize
the relevant FLR fields of the layout structure.

WC-bug-id: https://jira.whamcloud.com/browse/LU-13429
Lustre-commit: 53274fbd4bcf4 ("LU-13429 lov: lov_io_sub_init()) ASSERTION")
Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/38169
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/lov/lov_io.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fs/lustre/lov/lov_io.c b/fs/lustre/lov/lov_io.c
index d69e3a4..fefbf39 100644
--- a/fs/lustre/lov/lov_io.c
+++ b/fs/lustre/lov/lov_io.c
@@ -113,7 +113,9 @@  static int lov_io_sub_init(const struct lu_env *env, struct lov_io *lio,
 		     !lov_r0(lov, index)->lo_sub[stripe]))
 		return -EIO;
 
-	LASSERTF(is_index_within_mirror(lov, index, lio->lis_mirror_index),
+	LASSERTF(ergo(lov_is_flr(lov),
+		      is_index_within_mirror(lov, index,
+					     lio->lis_mirror_index)),
 		 DFID "iot = %d, index = %d, mirror = %d\n",
 		 PFID(lu_object_fid(lov2lu(lov))), io->ci_type, index,
 		 lio->lis_mirror_index);