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 A7063C83F14 for ; Wed, 30 Aug 2023 01:24:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AC592280035; Tue, 29 Aug 2023 21:24:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A9C0C8E000B; Tue, 29 Aug 2023 21:24:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 93CCB280035; Tue, 29 Aug 2023 21:24:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 859108E000B for ; Tue, 29 Aug 2023 21:24:49 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id C6B17403CC for ; Wed, 30 Aug 2023 01:24:48 +0000 (UTC) X-FDA: 81179026656.28.16D5E1B Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173]) by imf27.hostedemail.com (Postfix) with ESMTP id CCAED4000F for ; Wed, 30 Aug 2023 01:24:46 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=linux.org.uk header.s=zeniv-20220401 header.b=VMCLMK1i; spf=none (imf27.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; dmarc=pass (policy=none) header.from=zeniv.linux.org.uk ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1693358687; 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=UGL8Hs7wie/83TbDi9sHxBsPaDb/+1IP8lK74uZbCKw=; b=7eA96oXpZmpHwln8/uWMJD1Sd+ezDraAS0QHBFUaIOlURVLeb75bcQVfC/egmjdEjZ4Xo9 P6jtpf5Oq6OdArKv/jDMF1Gv52KQlP6GLYOmL7yVT6D8rHPJlJnRROQEY+rFwXvssOMH2G 7TB3ZOxQrtlNWYU/IUP9ZKA8YYw6TpQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1693358687; a=rsa-sha256; cv=none; b=Xmm6dawfpNmscxhBIVdrbcyw62Do4ECtwoiSN/uP2sGcasVpo7GN+VQPVOi3cGytA7mZ5c ixF/oPG6MFJ1CX8YLLp9sAoJy+MBgNuy4zNBfjDuVhnYs9A4kMHpFZcI1KbMMXOXOMJfZf 6rR2s44WxZjt+qOdHKzkPI9WMORWC6g= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=linux.org.uk header.s=zeniv-20220401 header.b=VMCLMK1i; spf=none (imf27.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; dmarc=pass (policy=none) header.from=zeniv.linux.org.uk 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=UGL8Hs7wie/83TbDi9sHxBsPaDb/+1IP8lK74uZbCKw=; b=VMCLMK1iXxNHLo2tyoSLb1HI/I ygrNcHqe5LWzcSOicXKiXv7+aZW1BJ7dB0vjqMCV0MnziRQDnoZOz3XgmiNQiiDnA13PUlmOVrxc4 WpSk9x7uA8R3KciGWN7qJ88utnJ3QSHSvYKWfoJJvhO0U1H1/cqwYZYmtvld8BDA8iqcXv8CBaGId erqQdPcYkjIFz/hBJqwMuB/rDK2BOMTdgnlCwnIMFpdDxv6wkG8Wn7rLsnAYsC5D7sc1BRtVulXjw RcKjf3m9ODmy0yW/y+LgeKEyGIU6PCqX4XrC83Co4MtcnJcvY9SuxDXgB2k0Ps8NGdX3ExJB41/fI ibsynONQ==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1qb9v5-001yGw-2Z; Wed, 30 Aug 2023 01:22:55 +0000 Date: Wed, 30 Aug 2023 02:22:55 +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: <20230830012255.GC3390869@ZenIV> References: <20230725-mgctime-v6-0-a794c2b7abca@kernel.org> <20230725-mgctime-v6-1-a794c2b7abca@kernel.org> <20230829224454.GA461907@ZenIV> <20230830000221.GB3390869@ZenIV> <1005e30582138e203a99f49564e2ef244b8d56aa.camel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1005e30582138e203a99f49564e2ef244b8d56aa.camel@kernel.org> X-Rspamd-Queue-Id: CCAED4000F X-Rspam-User: X-Stat-Signature: eo7dfyazp7i3m4pof7o45zyijpzfxu71 X-Rspamd-Server: rspam03 X-HE-Tag: 1693358686-355224 X-HE-Meta: U2FsdGVkX1/B+CF22OS7bvers0BlUofb2biOFeAQZHMaFKo5iL3aTdT8KKlI4PKKke+3OLabZVNJRNAEdjYLxtDpMThFYtPKt2tD55LZwk8Zfy2xdLlIC/i1p8l1U+sJONjldGSEn0H0SMOGkAY81Tny28Fm0z7SRMEpQFEtdc8eL4q+sB7914Vl6Px0Skm/HSTjPsuG+WPvgOsaN3o8KF8v1FLGDE+Zrb3KYgNGE3dGG2k1qD1+k0nra2+WW6pwILwdFQNWkl7+KNXj1rQ5JacVIXrI0rzkJGtonJ6dR6Fs3TNAbL522/70dewOk+aFYGegKjlo6nAfN6L+L6+OIOBnTVGpeG4t7LZDjSf2mz8ijnju6l4ORU/xOkb7rfnTIZ/BDtPkqo7Lg3/Ldp2bUhTqw73uOXtRebZRifOOS0fbzKHiHYZ0dUDJSt/s2RnZoT41p85dEg1+ZtoaWKXuN3GoGr7NFJgtHqYSqz/M5k4uajWpRy3sfSNAgfb2s8lEy595lsILfY4gsMKyTFy33b3Kx+CkrY89bPPdx4JDtYwxu3KYeuQ2DJLbQV/TDis3ZMkEe9ZtkfkrrxkYHYR2kZSTSzvoVKD7T8Jom6QZzOEpHqfjDfVioExo9iZfFhuOZituM3+znNypUEUui2qbrmf9kZcIU4O2As/UMtomciT0l/r8d20hdWu0tXDIHlJiRZwidaCiz6SIfwoKKHRn1ESJPVTKsSxxyq9JMC+Ic7MtBbEbSxbdlArdNUVbIgjhWn23mdjeykkfzaU9zU+nuWljPq2usaKr4prFBB9h+EYNdf/92mZTo0d0KM/RKXZAMuByDmND8H9zuM6CEkUbk9s5BCBPaEAZO146Tg/O7X7KogaDfCHMNEjhIm8vBJdHC1TUcv5g9Tsq9e4X34xWjR55/j9sjW8XDjmqG5xIO6zZjMAkWEkZR6gCR74/J4xJ4neaylR/ptB8lNsv4Y/ YJMGDfeA 6G5XZvrlFHW3ARTEiFEovP64y7y3UkWX8O/R7x89y7u5WP1+8y6IQUynFTj2keCDhUmtEFoQVg7NuD/jpxrTvEDNDIc8XLCdELmYMkAIIcwzKuGVRKoDw99gntJX6DPFr2jjdtcCsai/jU6U4cFikcWP5Uvc18poCYm7RGIDYba5w9nEXSyhHjHG+FrBpiDbPGKkJnTK+ahi7jqVjfXmSvg5+rjysuMeHOMKqNRJL7ZKNihSRoGCH5HY75kqpDJMKnOjzQHaSELtTzt1RjxhvbxJR36K+r4Gv5CJsYmumS+zVXdq5cJMTSI1w6jh7pz1MsIULygiR2piVoUskyJDrJGJxenPPH7ypy3uAn1L7wT8E7sSEs1ZPcCx14Mj593jCR7kT53NGh9lWIHmRjzkMnTOAttpxxqe8JSxz34GSKlGrPxR60p3K4Q43V7VTWmVe1vTHk2u6I5dDakxpBZ9TG00uLQ3kartXdhFqUjIaa4tMFAM= 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 08:43:31PM -0400, Jeff Layton wrote: > On Wed, 2023-08-30 at 01:02 +0100, Al Viro wrote: > > 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. > > The only problem with this plan is that Linus has already merged this. > I've no issue with adding the request_mask to the kstat and removing it > as a separate parameter elsewhere, but I think we'll need to do it on > top of what's already been merged. D'oh... My apologies; I'll do a branch on top of that (and rebase on top of -rc1 once the window closes).