From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [RFC 5/8] xattr: Add per-inode xattr handlers as a new inode operation Date: Sat, 14 May 2016 19:21:31 +0100 Message-ID: <20160514182131.GB14480@ZenIV.linux.org.uk> References: <1462229118-13123-1-git-send-email-agruenba@redhat.com> <1462229118-13123-6-git-send-email-agruenba@redhat.com> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: <1462229118-13123-6-git-send-email-agruenba@redhat.com> Sender: linux-unionfs-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Andreas Gruenbacher Cc: linux-fsdevel@vger.kernel.org, Tyler Hicks , ecryptfs@vger.kernel.org, Miklos Szeredi , linux-unionfs@vger.kernel.org, fuse-devel@lists.sourceforge.net, Mimi Zohar , linux-ima-devel@lists.sourceforge.net, linux-security-module@vger.kernel.org, David Howells , Serge Hallyn , Dmitry Kasatkin , Paul Moore , Stephen Smalley , Eric Paris , Casey Schaufler On Tue, May 03, 2016 at 12:45:15AM +0200, Andreas Gruenbacher wrote: > Per-inode xattr handlers allow to mark inodes as bad and dirs as "empty" > in the usual way even when using generic_getxattr, generic_setxattr, and > generic_removexattr. This brings us one step closer to getting rid of > the getxattr, setxattr, and removexattr inode operations. This is an amazingly convoluted way of doing things. First of all, "empty" case is not interesting - they might as well have used generic_...xattr for the filesystem using them. And bad_inode... I'd rather have that checked in generic_getxattr() et.al. I mean, explicit if (unlikely(is_bad_inode(inode))) return -EIO; ... go using ->i_sb->s_xattr in there won't cost more than your variant and it avoids having a flag misguised as a pointer to secondary method table in every inode_operations.