From patchwork Tue Aug 6 14:30:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 2839428 Return-Path: X-Original-To: patchwork-linux-nfs@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 A321CBF535 for ; Tue, 6 Aug 2013 14:30:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0B596201E0 for ; Tue, 6 Aug 2013 14:30:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D1173201C8 for ; Tue, 6 Aug 2013 14:30:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755378Ab3HFOaa (ORCPT ); Tue, 6 Aug 2013 10:30:30 -0400 Received: from mail-bk0-f48.google.com ([209.85.214.48]:35682 "EHLO mail-bk0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754965Ab3HFOa1 (ORCPT ); Tue, 6 Aug 2013 10:30:27 -0400 Received: by mail-bk0-f48.google.com with SMTP id jf20so182335bkc.21 for ; Tue, 06 Aug 2013 07:30:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3FOCfq1oEBK042Q65Pg1z3+NwgTYaQ5euTQQ/5HpiNw=; b=Qhy8K4Yi7RSn3OSJXa+Nxrwo9dvecexEz3mYnbjTsVAru1ZwCt2fMcaZ+HzsK4p83i tHc5+Ukz4tNv7g/U9A/6W5HQq4TXeCySqenZpI4wXDu/Q6InyENF3gvaEHBLablaLrC7 qIHQaNetdJl/cNkTQcjNwb+gaeT+/KAeCgMic= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3FOCfq1oEBK042Q65Pg1z3+NwgTYaQ5euTQQ/5HpiNw=; b=apGQXya4RdTW+v20HlWRklvB5aZ64+bwVqPU5ufdXx3QaIx1k7TRB2qwSrQBDho60N LrEZ1OHXfQNEU11zrURBei1wga2Z2DojhLJrMCzbS5rR8a/jYHHTkWqr8aHHMjveEy2W RcQbcO24bm3B3dbgna7+2Nx+TaP4OL3pVVNJAfaPorBjg60xFtjC0CTvaIIEXdibG/3I 4cL2Bgm371/2nby4S49JkpSg+80qeKHO1rktGv2O4iBWJ/y72mwyq8JI/6VbMPLRF8hR jgIsvZngHQhe0Nofdm42QmYXWc06WJFcNxxk0y2LMCQ9AJsw6+fZ8bYkCXti8eFiiCPJ /gvQ== X-Gm-Message-State: ALoCoQmHSfyo/rCWFHytZV5+tj/FO4PwplSDS8xRartPhf7H+JXnnbNLof3hD3ShW+tz/uoOumbU X-Received: by 10.205.115.80 with SMTP id fd16mr423211bkc.70.1375799425803; Tue, 06 Aug 2013 07:30:25 -0700 (PDT) Received: from tucsk.pomaz.szeredi.hu (563BF5AA.catv.pool.telekom.hu. [86.59.245.170]) by mx.google.com with ESMTPSA id oe7sm726001bkb.5.2013.08.06.07.30.24 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 06 Aug 2013 07:30:25 -0700 (PDT) From: Miklos Szeredi To: rwheeler@redhat.com, avati@redhat.com, viro@ZenIV.linux.org.uk Cc: bfoster@redhat.com, dhowells@redhat.com, eparis@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org, Trond.Myklebust@netapp.com, swhiteho@redhat.com, mszeredi@suse.cz Subject: [PATCH 4/4] fuse: drop dentry on failed revalidate Date: Tue, 6 Aug 2013 16:30:03 +0200 Message-Id: <1375799403-28544-5-git-send-email-miklos@szeredi.hu> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1375799403-28544-1-git-send-email-miklos@szeredi.hu> References: <1375799403-28544-1-git-send-email-miklos@szeredi.hu> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, KHOP_BIG_TO_CC,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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: Anand Avati Drop a subtree when we find that it has moved or been delated. This can be done as long as there are no submounts under this location. If the directory was moved and we come across the same directory in a future lookup it will be reconnected by d_materialise_unique(). Signed-off-by: Anand Avati Signed-off-by: Miklos Szeredi --- fs/fuse/dir.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 131d14b..4ba5893 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -226,8 +226,13 @@ static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags) if (!err) { struct fuse_inode *fi = get_fuse_inode(inode); if (outarg.nodeid != get_node_id(inode)) { + int ret = 0; + + if (check_submounts_and_drop(entry) != 0) + ret = 1; + fuse_queue_forget(fc, forget, outarg.nodeid, 1); - return 0; + return ret; } spin_lock(&fc->lock); fi->nlookup++;