From patchwork Mon Aug 5 06:10:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yan, Zheng" X-Patchwork-Id: 2838532 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0E3D09F479 for ; Mon, 5 Aug 2013 06:10:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 355E22017E for ; Mon, 5 Aug 2013 06:10:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 556332017D for ; Mon, 5 Aug 2013 06:10:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754701Ab3HEGKm (ORCPT ); Mon, 5 Aug 2013 02:10:42 -0400 Received: from mga03.intel.com ([143.182.124.21]:33276 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754595Ab3HEGKk (ORCPT ); Mon, 5 Aug 2013 02:10:40 -0400 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 04 Aug 2013 23:10:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.89,816,1367996400"; d="scan'208";a="341696543" Received: from zyan5-mobl.sh.intel.com ([10.239.13.8]) by azsmga001.ch.intel.com with ESMTP; 04 Aug 2013 23:10:38 -0700 From: "Yan, Zheng" To: ceph-devel@vger.kernel.org Cc: sage@inktank.com, "Yan, Zheng" Subject: [PATCH 6/6] mds: don't issue caps while session is stale Date: Mon, 5 Aug 2013 14:10:27 +0800 Message-Id: <1375683030-28305-7-git-send-email-zheng.z.yan@intel.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1375683030-28305-1-git-send-email-zheng.z.yan@intel.com> References: <1375683030-28305-1-git-send-email-zheng.z.yan@intel.com> 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 From: "Yan, Zheng" Locker::issue_caps() does not issue new caps to stale client, CInode::encode_inodestat() should have the same logical. Signed-off-by: Yan, Zheng --- src/mds/CInode.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc index d215d18..dd48326 100644 --- a/src/mds/CInode.cc +++ b/src/mds/CInode.cc @@ -2733,10 +2733,12 @@ int CInode::encode_inodestat(bufferlist& bl, Session *session, // do not issue caps if inode differs from readdir snaprealm SnapRealm *realm = find_snaprealm(); - bool no_caps = (realm && dir_realm && realm != dir_realm) || + bool no_caps = session->is_stale() || + (realm && dir_realm && realm != dir_realm) || is_frozen() || state_test(CInode::STATE_EXPORTINGCAPS); if (no_caps) dout(20) << "encode_inodestat no caps" + << (session->is_stale()?", session stale ":"") << ((realm && dir_realm && realm != dir_realm)?", snaprealm differs ":"") << (state_test(CInode::STATE_EXPORTINGCAPS)?", exporting caps":"") << (is_frozen()?", frozen inode":"") << dendl;