From patchwork Mon Mar 3 02:01:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yan, Zheng" X-Patchwork-Id: 3750661 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6CCC6BF13A for ; Mon, 3 Mar 2014 02:01:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AC06D20304 for ; Mon, 3 Mar 2014 02:01:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ACFBF2013D for ; Mon, 3 Mar 2014 02:01:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751611AbaCCCBs (ORCPT ); Sun, 2 Mar 2014 21:01:48 -0500 Received: from mga02.intel.com ([134.134.136.20]:4829 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751420AbaCCCBr (ORCPT ); Sun, 2 Mar 2014 21:01:47 -0500 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 02 Mar 2014 18:01:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,574,1389772800"; d="scan'208";a="465241039" Received: from zyan5-mobl.sh.intel.com ([10.239.13.10]) by orsmga001.jf.intel.com with ESMTP; 02 Mar 2014 18:01:23 -0800 From: "Yan, Zheng" To: ceph-devel@vger.kernel.org Cc: "Yan, Zheng" Subject: [PATCH] ceph: let MDS adjust readdir 'frag' Date: Mon, 3 Mar 2014 10:01:22 +0800 Message-Id: <1393812082-6056-1-git-send-email-zheng.z.yan@intel.com> X-Mailer: git-send-email 1.8.5.3 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If readdir 'frag' is adjusted, readdir 'offset' should be reset. Otherwise some dentries may be lost when readdir and fragmenting directory happen at the some. Another way to fix this issue is let MDS adjust readdir 'frag'. The code that handles MDS reply reset the readdir 'offset' if the readdir reply is different than the requested one. Signed-off-by: Yan, Zheng --- fs/ceph/dir.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index 94b80f4..ff2864a 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c @@ -322,9 +322,6 @@ more: fi->last_readdir = NULL; } - /* requery frag tree, as the frag topology may have changed */ - frag = ceph_choose_frag(ceph_inode(inode), frag, NULL, NULL); - dout("readdir fetching %llx.%llx frag %x offset '%s'\n", ceph_vinop(inode), frag, fi->last_name); req = ceph_mdsc_create_request(mdsc, op, USE_AUTH_MDS);