From 96f035b6dbdc0ced732e365216662079e4a99f40 Mon Sep 17 00:00:00 2001 From: yangsheng Date: Sun, 3 Jun 2012 02:14:36 +0800 Subject: [PATCH] LU-1423 mdt: 16K pagesize clients error during ls The 1.8.x client need return entire page even partially filled in readdir. Signed-off-by: yang sheng Change-Id: I762e63dafc511537e3f9e47782dc328a0d7c69de Reviewed-on: http://review.whamcloud.com/3014 Reviewed-by: Lai Siyao Tested-by: Hudson Reviewed-by: Fan Yong Tested-by: Maloo Reviewed-by: Andreas Dilger --- lustre/mdt/mdt_handler.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 4d1f727..80bb811 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -1238,8 +1238,13 @@ static int mdt_sendpage(struct mdt_thread_info *info, if (desc == NULL) RETURN(-ENOMEM); - for (i = 0, tmpcount = nob; - i < rdpg->rp_npages && tmpcount > 0; i++, tmpcount -= tmpsize) { + if (!(exp->exp_connect_flags & OBD_CONNECT_BRW_SIZE)) + /* old client requires reply size in it's PAGE_SIZE, + * which is rdpg->rp_count */ + nob = rdpg->rp_count; + + for (i = 0, tmpcount = nob; i < rdpg->rp_npages && tmpcount > 0; + i++, tmpcount -= tmpsize) { tmpsize = min_t(int, tmpcount, CFS_PAGE_SIZE); ptlrpc_prep_bulk_page(desc, rdpg->rp_pages[i], 0, tmpsize); } -- 1.8.3.1