From patchwork Mon Dec 17 09:08:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yan, Zheng" X-Patchwork-Id: 1886381 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 568B63FCA5 for ; Mon, 17 Dec 2012 09:08:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751898Ab2LQJIX (ORCPT ); Mon, 17 Dec 2012 04:08:23 -0500 Received: from mga14.intel.com ([143.182.124.37]:42523 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751798Ab2LQJIX (ORCPT ); Mon, 17 Dec 2012 04:08:23 -0500 Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga102.ch.intel.com with ESMTP; 17 Dec 2012 01:08:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,299,1355126400"; d="scan'208";a="181801178" Received: from zyan5-mobl.sh.intel.com ([10.239.36.49]) by AZSMGA002.ch.intel.com with ESMTP; 17 Dec 2012 01:08:21 -0800 From: "Yan, Zheng" To: ceph-devel@vger.kernel.org, sage@inktank.com Cc: "Yan, Zheng" Subject: [PATCH] mds: don't journal null dentry for overwrited remote linkage. Date: Mon, 17 Dec 2012 17:08:19 +0800 Message-Id: <1355735299-20401-1-git-send-email-zheng.z.yan@intel.com> X-Mailer: git-send-email 1.7.11.7 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org From: "Yan, Zheng" Server::_rename_prepare() adds null dest dentry to the EMetaBlob if the rename operation is overwriting remote linkage. This is incorrect because null dentry are processed after primary and remote dentries during journal replay. The erroneous null dentry makes rename dest file disappear. The bug can causes undeletable directory. Signed-off-by: Yan, Zheng --- src/mds/Server.cc | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/mds/Server.cc b/src/mds/Server.cc index ba43656..d354adb 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -5709,10 +5709,6 @@ void Server::_rename_prepare(MDRequest *mdr, CEPH_NOSNAP, 0, destdnl); metablob->add_primary_dentry(oldin->get_projected_parent_dn(), true, oldin); } - if (destdn->is_auth()) { - // auth for dn, not targeti - metablob->add_null_dentry(destdn, true); - } } }