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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D23EAC83F12 for ; Wed, 30 Aug 2023 00:04:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D86A28E002E; Tue, 29 Aug 2023 20:04:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D366E8E000B; Tue, 29 Aug 2023 20:04:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BB1B58E002E; Tue, 29 Aug 2023 20:04:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id A94858E000B for ; Tue, 29 Aug 2023 20:04:01 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 5FE9440342 for ; Wed, 30 Aug 2023 00:04:01 +0000 (UTC) X-FDA: 81178823082.26.81DAF59 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173]) by imf30.hostedemail.com (Postfix) with ESMTP id 504C38001E for ; Wed, 30 Aug 2023 00:03:58 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=linux.org.uk header.s=zeniv-20220401 header.b=Bog5SZG0; dmarc=pass (policy=none) header.from=zeniv.linux.org.uk; spf=none (imf30.hostedemail.com: domain of viro@ftp.linux.org.uk has no SPF policy when checking 62.89.141.173) smtp.mailfrom=viro@ftp.linux.org.uk ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1693353838; a=rsa-sha256; cv=none; b=tlLF8LkP77WXjcmXFcZTH4KcxI8Y8Z+//cNYoXJnND79HWfCjuNIhRLPH/+Glo6lg1njIR HImBpJ3NFrRhJ0mJEdvIKC5Z2SZSAz/rjFovb3CN9o1jeSfYyr0VnrpzJYchxgMtv02xsR qRoislnuXdqYJ5k2COJ6rkHaqDHoW8U= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=linux.org.uk header.s=zeniv-20220401 header.b=Bog5SZG0; dmarc=pass (policy=none) header.from=zeniv.linux.org.uk; spf=none (imf30.hostedemail.com: domain of viro@ftp.linux.org.uk has no SPF policy when checking 62.89.141.173) smtp.mailfrom=viro@ftp.linux.org.uk ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1693353838; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=mhHf9bnOddbdauFdwTiNvB2pCJGntgXJjGP69XrW3To=; b=zeIeCGXULe1XyJ9P47hwXlx7mBdfzOFGSb47Lq55wFF4zfY3HLSgKyEMTUcO2j1B44NRW8 ajk4Uot75cQ4ATzdix6OYKL1Q5LS4fo1JeYNzsV8Vx5MEKS53qV/9YKzBF1buzDEkDJvnL X/vZu/8fW/8C5+fKJ9gpEs5yunNgRDI= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=mhHf9bnOddbdauFdwTiNvB2pCJGntgXJjGP69XrW3To=; b=Bog5SZG0TYg0s2MQQfbUs9uVXk XdtKROAwAGEUaoPB8IuJVEXbl9mZlm0jEhEk3H4E+vKRQyFUUSOp4nTdUWPuxI7Hp4HjDNA443+/y /0fOLJMKC2WIb2tS4b+Rt+QMGMmK7PEfbf7jtUs42sJFP5+vBQdLHF+vLX+GuQ5QG1n3CXTQMflpP 3DlTErG3FOwEjKOWr7tFZ3fPuvJ3DhE+vRtnrlv2iBll7kd62LGwN6s1l2hycllZ+6XxX/OrWlMoY fxqTZRWZnCLTwYTWHz4AyRowlDGrc1MtyEFAz5FrKLMLieuTK/6uE/WBBD7mLUNv8cYmrCXKVybDc uCQ9Bpgw==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1qb8f7-001xNh-0Q; Wed, 30 Aug 2023 00:02:21 +0000 Date: Wed, 30 Aug 2023 01:02:21 +0100 From: Al Viro To: Jeff Layton 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 Subject: Re: [PATCH v6 1/7] fs: pass the request_mask to generic_fillattr Message-ID: <20230830000221.GB3390869@ZenIV> References: <20230725-mgctime-v6-0-a794c2b7abca@kernel.org> <20230725-mgctime-v6-1-a794c2b7abca@kernel.org> <20230829224454.GA461907@ZenIV> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 504C38001E X-Stat-Signature: ozjfkexgewjqgm1ekhugcu1n4nc4mqmj X-HE-Tag: 1693353838-582134 X-HE-Meta: U2FsdGVkX18WfnjM73Vd+XTLS+ymfbSYiWR55zhWD2NMoUO9jsDLT21ir3fY+6QdV8mS0FOW/9obn27d2NF5QbcME2U3NIfzUop+vDZXRk/a/qO+9mC/bwTrJ5X7yOmWaGFbpbCorTNBAHpW5FzK3Syr4MDFfrNb0eVVJXYqD6mxzkQShkwsTums0+5EKsKM554KZQJY/LvuCVqe0C86Srd1b/bb2VwcU+dZ+VRgLb1rKBguFJ6pIUISp+KZzMX4P5VIREy/0ZSjdpGL90xQ1Yql6txfpiUK9Ua3wkmu/2morO4yYL+6iJEHajaj6318OqDQtlCYoTETaw8GmVq8+vNN29FbqnYXBVgH9C5/7T9lRXOZThT2O8k2PwTVyfubrlTZvUjk42ef5aliokMR9BxtXLMhj/mN0HGf8GxdL4zia+i82f9rDyoit5fixWP9Qf5M1nzLgZIrDMhc2UmpRGd/pD6H8texccnmI5zZeQ8bTBDJLI8pfPT7ddzLZ5FeckD6T0suEecNN0yWkTiaGxFE4sFYRKNVs4EhdP71R0e1Tb36OUZIooyz1CQX0xGHQJPKOEagRmoQ2Ux+1DPIkAvkV0N0I3PXJvY8HzbqQvhkfbXR2PDEpceKnYKB31gbBXgRWBn0r1wvLzAfSD0sjIBmyJ1LCGZpyeX22+di7U82IYRV5u5OCzvF7lY0N1FFS7J0tKdmF7i2XfAHvKNeuYn6Ob+BrFrbj9ue6ZVfftUsODYxbb0/OncAE6IaR9w0oMF3fmWbfgOqXmmgMYcJl0I3WcfWMMF2ILdXewr/7W4n5W+tDSixzgQxZkEFa3kr/vgUQdDy33harjkpWNDHWWhpFHnVH1cPvEOAU824IpqzjJaUS/nFwyOqBKma5tgAutXdX9DkwWEuI05bVss7kIOwQb3N5Pba/O7tOSUZwhU4SUASfFx7/yv7qNFBMMbZMffqwzGyoUn2TY5I5v8 EtSMyJQy i6KYoUPzEqEA1ikM2iBcQ8gQ8J3qVjHGMNQOSV42IkQKIXaln0hHQwpecVbLNye86ScmiXvgaGRCVRWiR90OrAaVrdDOxOzk4115JxAlHy8Msha7l/9m9vqfaB9yYWg2AM8/tE9J+1591HXDHtNGF3Yg/++K6scZmcH4Vc2n2Wo8Coy4KVxysDeKOg4sTHWnevb2msrL7ungq70w5Id9FgTj8PtX3W5crAYgGGyYRdsvmE07Ume58EXH+QpARSFgVI7LjRJr527v0ehai7tJclOeQXncxWB27j/l30cH+EZWp5Z8A0A2tZosG/4b9y/ed4ZacNnBdA4dK2rELv00z/vvLFvGuxwm/F5weBRZSVdUl5ZLo59cqoefq6fQLyZiE+kHIHoypdzKOG4+PjLxuIbbiy+3SckdF0kHUaMKt0UNcEeCA+vZSxSXihvW2A62vbfobB0Wm0KhPsTyzKNO09W3nGDjhU6ZES46rpL89oEW8d+8= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Aug 29, 2023 at 06:58:47PM -0400, Jeff Layton wrote: > 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. > > > > > > 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. > > > > 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... > > > > 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. ->getattr() prototype change would be decoupled from that - for your patchset you'd only need the field addition + setting in vfs_getattr_nosec() (and possibly in ksmbd), with the remainders of both series being independent from each other. What I suggest is branchpoint -> field addition (trivial commit) -> argument removal | V your series, starting with "use stat->request_mask in generic_fillattr()" Total size would be about the same, but it would be easier to follow the less trivial part of that. Nothing in your branch downstream of that touches any ->getattr() instances, so it should have no conflicts with the argument removal side of things.