From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f68.google.com ([209.85.215.68]:44856 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751284AbeFVOc1 (ORCPT ); Fri, 22 Jun 2018 10:32:27 -0400 MIME-Version: 1.0 In-Reply-To: <20180620224553.wfz6abuvvz4ul42d@eaf> References: <20180619160223.4108556-1-arnd@arndb.de> <20180619160223.4108556-3-arnd@arndb.de> <20180620224553.wfz6abuvvz4ul42d@eaf> From: Arnd Bergmann Date: Fri, 22 Jun 2018 16:32:25 +0200 Message-ID: Subject: Re: [PATCH 3/3] hfsplus: return inode birthtime for statx To: =?UTF-8?Q?Ernesto_A=2E_Fern=C3=A1ndez?= Cc: Al Viro , Andrew Morton , y2038 Mailman List , Vyacheslav Dubeyko , Deepa Dinamani , Jan Kara , Jeff Layton , Linux FS-devel Mailing List , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Jun 21, 2018 at 12:45 AM, Ernesto A. Fern=C3=A1ndez wrote: >> --- a/fs/hfsplus/inode.c >> +++ b/fs/hfsplus/inode.c >> @@ -276,6 +276,19 @@ static int hfsplus_setattr(struct dentry *dentry, s= truct iattr *attr) >> return 0; >> } >> >> +int hfsplus_getattr(const struct path *path, struct kstat *stat, >> + u32 request_mask, unsigned int query_flags) >> +{ >> + struct inode *inode =3D d_backing_inode(path->dentry); > > I think d_inode() is better. They work the same, but "normal filesystems > should not use this", according to the d_backing_inode() documentation. > Right, definitely. I copied it from vfs_getattr_nosec() without thinking ab= out it much. I see how David Howells put that d_backing_inode() there, but still don't understand it. >> @@ -335,6 +348,7 @@ int hfsplus_file_fsync(struct file *file, loff_t sta= rt, loff_t end, >> >> static const struct inode_operations hfsplus_file_inode_operations =3D = { >> .setattr =3D hfsplus_setattr, >> + .getattr =3D hfsplus_getattr, >> .listxattr =3D hfsplus_listxattr, >> #ifdef CONFIG_HFSPLUS_FS_POSIX_ACL >> .get_acl =3D hfsplus_get_posix_acl, >> -- >> 2.9.0 >> > > What about symlinks and special files? My mistake again, thanks for pointing that out. Doing the symlinks correctl= y here would actually add a bit more complexity as they use the generic page_symlink_inode_operations at the moment. I think I'd rather just retract this patch and let someone else handle it i= f they actually want this feature. I only added it because it seemed trivial to do, but that was clearly not true. ;-) Arnd