From: yangsheng Date: Sat, 2 Jun 2012 18:14:36 +0000 (+0800) Subject: LU-1423 mdt: 16K pagesize clients error during ls X-Git-Tag: 2.2.91~32 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=5318af0793cf4d6b824d39e38225b9153ce0073b;p=fs%2Flustre-release.git 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 --- diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 7ab077e..801ef7e 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -1309,8 +1309,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); }