From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759288Ab2CFOM6 (ORCPT ); Tue, 6 Mar 2012 09:12:58 -0500 Received: from mx2.netapp.com ([216.240.18.37]:60172 "EHLO mx2.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758264Ab2CFOM4 (ORCPT ); Tue, 6 Mar 2012 09:12:56 -0500 X-IronPort-AV: E=Sophos;i="4.73,540,1325491200"; d="scan'208";a="631080302" From: "Myklebust, Trond" To: Miklos Szeredi CC: "viro@ZenIV.linux.org.uk" , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "hch@infradead.org" , "mszeredi@suse.cz" Subject: Re: [PATCH 9/9] nfs: don't open in ->d_revalidate Thread-Topic: [PATCH 9/9] nfs: don't open in ->d_revalidate Thread-Index: AQHM+5i1/8/o98YKtk2fJ0XNzaBcrJZd1UkA Date: Tue, 6 Mar 2012 14:12:38 +0000 Message-ID: <1331043158.3260.3.camel@lade.trondhjem.org> References: <1331038601-20353-1-git-send-email-miklos@szeredi.hu> <1331038601-20353-10-git-send-email-miklos@szeredi.hu> In-Reply-To: <1331038601-20353-10-git-send-email-miklos@szeredi.hu> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.104.60.115] Content-Type: text/plain; charset="utf-8" Content-ID: MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id q26ED35e008181 On Tue, 2012-03-06 at 13:56 +0100, Miklos Szeredi wrote: > From: Miklos Szeredi > > NFSv4 can't do reliable opens in d_revalidate, since it cannot know whether a > mount needs to be followed or not. It does check d_mountpoint() on the dentry, > which can result in a weird error if the VFS found that the mount does not in > fact need to be followed, e.g.: > > # mount --bind /mnt/nfs /mnt/nfs-clone > # echo something > /mnt/nfs/tmp/bar > # echo x > /tmp/file > # mount --bind /tmp/file /mnt/nfs-clone/tmp/bar > # cat /mnt/nfs/tmp/bar > cat: /mnt/nfs/tmp/bar: Not a directory > > Which should, by any sane filesystem, result in "something" being printed. > > So instead do the open in f_op->open() and in the unlikely case that the cached > dentry turned out to be invalid, drop the dentry and return ESTALE to let the > VFS retry. This patch would force a complete new walk of the path in cases where today we just do a single lookup of the last component. It really doesn't seem worth taking that penalty just in order to make some insane bind mount corner cases work. -- Trond Myklebust Linux NFS client maintainer NetApp Trond.Myklebust@netapp.com www.netapp.com {.n++%ݶw{.n+{G{ayʇڙ,jfhz_(階ݢj"mG?&~iOzv^m ?I