[lustre-devel] [PATCH 14/22] lustre: clio: append to non-existent component

James Simmons <[email protected]>
Newsgroups org.lustre.lists.lustre-devel
Message-ID <[email protected]>
From: Vitaly Fertman <[email protected]>

should return an error, but it fails now with a BUG below
because @rc of lov_io_layout_at() is not checked for < 0

BUG: unable to handle kernel paging request at ffff99d3c2f74030
    Call Trace:
      lov_stripe_number+0x19/0x40 [lov]
      lov_page_init_composite+0x103/0x5f0 [lov]
      ? kmem_cache_alloc+0x12e/0x270
      cl_page_alloc+0x19f/0x660 [obdclass]
      cl_page_find+0x1a0/0x250 [obdclass]
      ll_write_begin+0x1f7/0xfb0 [lustre]

HPE-bug-id: LUS-11075
WC-bug-id: https://jira.whamcloud.com/browse/LU-16281
Lustre-commit: 8fdeca3b6faf22c72 ("LU-16281 clio: append to non-existent component")
Signed-off-by: Vitaly Fertman <[email protected]>
Reviewed-on: https://es-gerrit.dev.cray.com/161123
Reviewed-by: Alexander Zarochentsev <[email protected]>
Reviewed-by: Alexander Boyko <[email protected]>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48994
Reviewed-by: Andreas Dilger <[email protected]>
Reviewed-by: Alexander <[email protected]>
Reviewed-by: Oleg Drokin <[email protected]>
Signed-off-by: James Simmons <[email protected]>
---
 fs/lustre/lov/lov_page.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/lustre/lov/lov_page.c b/fs/lustre/lov/lov_page.c
index a22b71f..6e28e62 100644
--- a/fs/lustre/lov/lov_page.c
+++ b/fs/lustre/lov/lov_page.c
@@ -84,6 +84,8 @@ int lov_page_init_composite(const struct lu_env *env, struct cl_object *obj,
 		suboff = lio->lis_cached_suboff + offset - lio->lis_cached_off;
 	} else {
 		entry = lov_io_layout_at(lio, offset);
+		if (entry < 0)
+			return -ENODATA;
 
 		stripe = lov_stripe_number(loo->lo_lsm, entry, offset);
 		rc = lov_stripe_offset(loo->lo_lsm, entry, offset, stripe,
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
[email protected]
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.