[lustre-devel] [PATCH 104/151] lustre: lov: fill no-extent fiemap on object with no stripe.

James Simmons jsimmons at infradead.org
Mon Sep 30 11:56:03 PDT 2019


From: Dominique Martinet <dominique.martinet at cea.fr>

This is useful for cp of large sparse files with no stripe info,
as cp relies on fiemap to detect what to read.

WC-bug-id: https://jira.whamcloud.com/browse/LU-10405
Lustre-commit: 113fa79b7dc9 ("LU-10405 lov: fill no-extent fiemap on object with no stripe")
Signed-off-by: Dominique Martinet <dominique.martinet at cea.fr>
Reviewed-on: https://review.whamcloud.com/30591
Reviewed-by: Quentin Bouget <quentin.bouget at cea.fr>
Reviewed-by: Andreas Dilger <adilger at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 fs/lustre/lov/lov_object.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/fs/lustre/lov/lov_object.c b/fs/lustre/lov/lov_object.c
index d3ed5fc..51b95f2 100644
--- a/fs/lustre/lov/lov_object.c
+++ b/fs/lustre/lov/lov_object.c
@@ -1774,8 +1774,11 @@ static int lov_object_fiemap(const struct lu_env *env, struct cl_object *obj,
 	struct fiemap_state fs = { NULL };
 
 	lsm = lov_lsm_addref(cl2lov(obj));
-	if (!lsm)
-		return -ENODATA;
+	if (!lsm) {
+		/* no extent: there is no object for mapping */
+		fiemap->fm_mapped_extents = 0;
+		return 0;
+	}
 
 	if (!(fiemap->fm_flags & FIEMAP_FLAG_DEVICE_ORDER)) {
 		/**
-- 
1.8.3.1



More information about the lustre-devel mailing list