Whamcloud - gitweb
LU-1423 mdt: 16K pagesize clients error during ls
authoryangsheng <ys@whamcloud.com>
Sat, 2 Jun 2012 18:14:36 +0000 (02:14 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Tue, 10 Jul 2012 04:13:33 +0000 (00:13 -0400)
The 1.8.x client need return entire page even partially
filled in readdir.

Signed-off-by: yang sheng <ys@whamcloud.com>
Change-Id: I762e63dafc511537e3f9e47782dc328a0d7c69de
Reviewed-on: http://review.whamcloud.com/3014
Reviewed-by: Lai Siyao <laisiyao@whamcloud.com>
Tested-by: Hudson
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/mdt/mdt_handler.c

index 7ab077e..801ef7e 100644 (file)
@@ -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);
         }