From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45B6DC83F1D for ; Tue, 29 Aug 2023 22:59:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240583AbjH2W7Q (ORCPT ); Tue, 29 Aug 2023 18:59:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240656AbjH2W67 (ORCPT ); Tue, 29 Aug 2023 18:58:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3102FD7; Tue, 29 Aug 2023 15:58:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C2A37635CE; Tue, 29 Aug 2023 22:58:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B9FABC433C7; Tue, 29 Aug 2023 22:58:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1693349935; bh=rn2r8LG5beXDEpNUXXmAsWk7K7Z6B0SkbbGrSUfCikA=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=UJJSRKRH7LTjcnDdUPp7RtBE/dB7QJhjeEB1YQbMKrKaYzMACob4EBI4SsR0sy5Ye mt7wmIqsOOWPvL2AjZ5YQtEhH9AU5fAVtL4UeL7OEXz9q6ZHDNk6+YIdzODX8+wqil jlsqG5Nirzs8oHVVRgwIrBWk+tU4uj4vEMyBjQFrJmh/cCsnnPwHApt0qQlEh4VPoV fx7tHB0NGyHo231wK83vtI9suH/0L3cn9cyGLY9db8p4Yc0AKTTsIBFPHCXTIrOvy6 YzP3/2IXTyd/Lvsgr1kAOQEzWJjTRoatnNjA657yXZ2FiJLFoy7sfB1K1HWwMGB4Ek xBWdtuLvgMoog== Message-ID: Subject: Re: [PATCH v6 1/7] fs: pass the request_mask to generic_fillattr From: Jeff Layton To: Al Viro Cc: Eric Van Hensbergen , Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck , David Howells , Marc Dionne , Chris Mason , Josef Bacik , David Sterba , Xiubo Li , Ilya Dryomov , Jan Harkes , coda@cs.cmu.edu, Tyler Hicks , Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu , Namjae Jeon , Sungjong Seo , Jan Kara , Theodore Ts'o , Andreas Dilger , Jaegeuk Kim , OGAWA Hirofumi , Miklos Szeredi , Bob Peterson , Andreas Gruenbacher , Greg Kroah-Hartman , Tejun Heo , Christian Brauner , Trond Myklebust , Anna Schumaker , Konstantin Komarov , Mark Fasheh , Joel Becker , Joseph Qi , Mike Marshall , Martin Brandenburg , Luis Chamberlain , Kees Cook , Iurii Zaikin , Steve French , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Tom Talpey , Sergey Senozhatsky , Richard Weinberger , Hans de Goede , Hugh Dickins , Andrew Morton , "Darrick J. Wong" , Dave Chinner , Anthony Iliopoulos , v9fs@lists.linux.dev, linux-kernel@vger.kernel.org, linux-afs@lists.infradead.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, codalist@coda.cs.cmu.edu, ecryptfs@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, linux-nfs@vger.kernel.org, ntfs3@lists.linux.dev, ocfs2-devel@lists.linux.dev, devel@lists.orangefs.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-mtd@lists.infradead.org, linux-mm@kvack.org, linux-xfs@vger.kernel.org Date: Tue, 29 Aug 2023 18:58:47 -0400 In-Reply-To: <20230829224454.GA461907@ZenIV> References: <20230725-mgctime-v6-0-a794c2b7abca@kernel.org> <20230725-mgctime-v6-1-a794c2b7abca@kernel.org> <20230829224454.GA461907@ZenIV> Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, 2023-08-29 at 23:44 +0100, Al Viro wrote: > On Tue, Jul 25, 2023 at 10:58:14AM -0400, Jeff Layton wrote: > > generic_fillattr just fills in the entire stat struct indiscriminately > > today, copying data from the inode. There is at least one attribute > > (STATX_CHANGE_COOKIE) that can have side effects when it is reported, > > and we're looking at adding more with the addition of multigrain > > timestamps. > >=20 > > Add a request_mask argument to generic_fillattr and have most callers > > just pass in the value that is passed to getattr. Have other callers > > (e.g. ksmbd) just pass in STATX_BASIC_STATS. Also move the setting of > > STATX_CHANGE_COOKIE into generic_fillattr. >=20 > Out of curiosity - how much PITA would it be to put request_mask into > kstat? Set it in vfs_getattr_nosec() (and those get_file_..._info() > on smbd side) and don't bother with that kind of propagation boilerplate > - just have generic_fillattr() pick it there... >=20 > Reduces the patchset size quite a bit... It could be done. To do that right, I think we'd want to drop request_mask from the ->getattr prototype as well and just have everything use the mask in the kstat. I don't think it'd reduce the size of the patchset in any meaningful way, but it might make for a more sensible API over the long haul. --=20 Jeff Layton