From patchwork Sun Aug 19 03:00:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 1343251 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 586633FC33 for ; Sun, 19 Aug 2012 03:08:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753886Ab2HSDIk (ORCPT ); Sat, 18 Aug 2012 23:08:40 -0400 Received: from lsd-gw.ic.unicamp.br ([143.106.7.165]:47227 "EHLO boneca.lsd.ic.unicamp.br" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753600Ab2HSDBO (ORCPT ); Sat, 18 Aug 2012 23:01:14 -0400 Received: from freie (gw-to-emilia.oliva.athome.lsd.ic.unicamp.br [172.31.160.17] (may be forged)) by boneca.lsd.ic.unicamp.br (8.14.5/8.14.5) with ESMTP id q7J30uQN004475; Sun, 19 Aug 2012 00:01:01 -0300 Received: from livre.localdomain (livre-to-gw.oliva.athome.lsd.ic.unicamp.br [172.31.160.19]) by freie (8.14.5/8.14.5) with ESMTP id q7J30rOJ025404; Sun, 19 Aug 2012 00:00:53 -0300 Received: from livre.localdomain (aoliva@localhost.localdomain [127.0.0.1]) by livre.localdomain (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id q7J30qfP029432; Sun, 19 Aug 2012 00:00:52 -0300 Received: (from aoliva@localhost) by livre.localdomain (8.14.3/8.14.3/Submit) id q7J30kUX029431; Sun, 19 Aug 2012 00:00:46 -0300 X-Authentication-Warning: livre.localdomain: aoliva set sender to oliva@lsd.ic.unicamp.br using -f From: Alexandre Oliva To: Sage Weil Cc: ceph-devel@vger.kernel.org Subject: Re: [PATCH] Add old_inodes to emetablob Organization: Free thinker, not speaking for University of Campinas References: Date: Sun, 19 Aug 2012 00:00:46 -0300 In-Reply-To: (Alexandre Oliva's message of "Sat, 18 Aug 2012 06:08:11 -0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org On Aug 18, 2012, Alexandre Oliva wrote: > I've looked further into this tonight, and I found out what modifies > the timestamps in the inode is (re)issuing caps to a client. > So, how can we stop pre_cow_old_inode from messing with the old_inode? > Any suggestions? This patch seems to avoid the problem, but is it correct, or is it just papering over a problem elsewhere? Subject: mds: Don't modify already-created old_inode In cow_old_inode, do not modify an old_inode that was created before. Signed-off-by: Alexandre Oliva --- src/mds/CInode.cc | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc index 53f9e69..fdff86c 100644 --- a/src/mds/CInode.cc +++ b/src/mds/CInode.cc @@ -2030,12 +2030,16 @@ old_inode_t& CInode::cow_old_inode(snapid_t follows, bool cow_head) inode_t *pi = cow_head ? get_projected_inode() : get_previous_projected_inode(); map *px = cow_head ? get_projected_xattrs() : get_previous_projected_xattrs(); + bool found = old_inodes.find(follows) != old_inodes.end(); old_inode_t &old = old_inodes[follows]; - old.first = first; - old.inode = *pi; - old.xattrs = *px; - - dout(10) << " " << px->size() << " xattrs cowed, " << *px << dendl; + + if (!found) { + old.first = first; + old.inode = *pi; + old.xattrs = *px; + + dout(10) << " " << px->size() << " xattrs cowed, " << *px << dendl; + } old.inode.trim_client_ranges(follows);