Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753987AbaBCVjg (ORCPT ); Mon, 3 Feb 2014 16:39:36 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:42427 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753168AbaBCVjf (ORCPT ); Mon, 3 Feb 2014 16:39:35 -0500 Date: Mon, 3 Feb 2014 21:39:26 +0000 From: Al Viro To: Linus Torvalds Cc: Christoph Hellwig , Ilya Dryomov , Sage Weil , Dave Jones , Linux Kernel Mailing List , ceph-devel@vger.kernel.org, linux-fsdevel , Guangliang Zhao , Li Wang , zheng.z.yan@intel.com Subject: Re: [PATCH v2] ceph: fix posix ACL hooks Message-ID: <20140203213926.GA10323@ZenIV.linux.org.uk> References: <1391013467-7598-1-git-send-email-ilya.dryomov@inktank.com> <20140130075421.GA10050@infradead.org> <20140203102943.GF11829@infradead.org> <20140203211955.GY10323@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 03, 2014 at 01:31:19PM -0800, Linus Torvalds wrote: > If the protocol is path-based (and it happens, and it's actually the > *correct* thing to do for a network filesystem, rather than the > idiotic "file handle" crap that tries to emulate the unix inode > semantics in the protocol), then the inode is simply not sufficient. > > And no, d_find_alias() is not correct or sufficient either. It can > work in practice (and probably does perfectly fine 99.9% of the time), > but it can equally well give the *wrong* dentry: yes, the dentry it > returns would have been a valid dentry for somebody at some time, but > it might be a stale dentry *now*, and it might be the wrong dentry for > the current user (because the current user may not have permissions to > that particular path, even if the user has permissions through his > *own* path). > > So I really think you're *fundamentally* incorrect when you say > "result *is* a function of inode alone". Which fs are you talking about? For 9P it *is* a function of inode alone. For CIFS there's no wrong dentry to pick - it doesn't have links to start with. If we really have hardlinks, the result of permission check would better be a function of inode itself - as in, "if it gives different results for two pathnames reachable for the same user, we have a bug". -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/