Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1720129pxb; Mon, 12 Apr 2021 05:16:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOoJDTFN9Fxz/tytmxWTOFpTxCCUoiw/a4H3218CH0Z8KAw7YcWCkHVTnVj74ORSAjeXUq X-Received: by 2002:a17:902:b595:b029:e9:107:d697 with SMTP id a21-20020a170902b595b02900e90107d697mr26360017pls.70.1618229784915; Mon, 12 Apr 2021 05:16:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618229784; cv=none; d=google.com; s=arc-20160816; b=DscxGgpBWO5HsM5PVPkbde+fwyELVgwmKp/wrFT8hq7DymMPtgP3XFwNNka+rFgKAG IKfjDg2LZVcgHYrqfQ07sMR54UprUQfG/BSbx0bm5LqLevAljUgszJODHGMg81b58Nq9 gr834dgx29aikN/MvpcsX0+IKjVAQn/o1Gvkw8XdknuJErEXYw0/ZMBMYvADx7swdmQG u7vQKOYs5WLy6ZlJKKVkM+E8XvfqLUMAvgNBxqD/cOvwSuAPVDfszGJlP3rA0FqNRRBi NeYa9XmvUSOR9Ftf8ocutw4NFCBVuZyEJ3HGtzQ0bcUjWk57TcYPG0xdLIWUswWj1MnL obFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-id:content-language:accept-language:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=MbhN79XU5ctJ0DGdD3zkkTXUg7nhP5oDwYvd7MRkZ7U=; b=hnEjCj3gwA4+FzDufiTQfFLS6abUHW6qyvqXex+pqvEtctDNK/I+R5ND2zYmeX77jD 7r4oMLyOpnilr9BrKX8en1C0vLISKhfX9T7lBkeBE2SesKDQezg2g8KSNNiwKJtmvNFe IqVyfpan5Z2XQfEoryGMqyK92XHpwvxtD9z3DbN5ACnDISLTRgfxk28rCLrp/gcbSXWn 5lsa61EJvDr42sEOuUecASkGAvFz+5J2AHrEhcWopSlzBjQXbYmo6VnU+XjleUBxZh1l xOfJimYVg3EJDufTld0WQe2DGYyp+/PSWH3YZydeDgTjikHPPlga1l4s8uwdVQ7vZBMz gdPg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o12si13070057pgp.583.2021.04.12.05.16.07; Mon, 12 Apr 2021 05:16:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239451AbhDLMQT convert rfc822-to-8bit (ORCPT + 99 others); Mon, 12 Apr 2021 08:16:19 -0400 Received: from mgw-02.mpynet.fi ([82.197.21.91]:59198 "EHLO mgw-02.mpynet.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237283AbhDLMQS (ORCPT ); Mon, 12 Apr 2021 08:16:18 -0400 X-Greylist: delayed 598 seconds by postgrey-1.27 at vger.kernel.org; Mon, 12 Apr 2021 08:16:16 EDT Received: from pps.filterd (mgw-02.mpynet.fi [127.0.0.1]) by mgw-02.mpynet.fi (8.16.0.43/8.16.0.43) with SMTP id 13CBuj4R036297; Mon, 12 Apr 2021 15:05:00 +0300 Received: from ex13.tuxera.com (ex13.tuxera.com [178.16.184.72]) by mgw-02.mpynet.fi with ESMTP id 37vmqsr2ph-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 12 Apr 2021 15:05:00 +0300 Received: from tuxera-exch.ad.tuxera.com (10.20.48.11) by tuxera-exch.ad.tuxera.com (10.20.48.11) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 12 Apr 2021 15:04:59 +0300 Received: from tuxera-exch.ad.tuxera.com ([fe80::552a:f9f0:68c3:d789]) by tuxera-exch.ad.tuxera.com ([fe80::552a:f9f0:68c3:d789%12]) with mapi id 15.00.1497.012; Mon, 12 Apr 2021 15:04:59 +0300 From: Anton Altaparmakov To: "christian.brauner@ubuntu.com" CC: "James.Bottomley@hansenpartnership.com" , "adilger.kernel@dilger.ca" , "alban@kinvolk.io" , "arnd@arndb.de" , "casey@schaufler-ca.com" , "containers@lists.linux-foundation.org" , "corbet@lwn.net" , "cyphar@cyphar.com" , "dhowells@redhat.com" , "dmitry.kasatkin@gmail.com" , "ebiederm@xmission.com" , "geofft@ldpreload.com" , "hch@lst.de" , "hirofumi@mail.parknet.co.jp" , "john.johansen@canonical.com" , "josh@joshtriplett.org" , "keescook@chromium.org" , "lennart@poettering.net" , "linux-api@vger.kernel.org" , "linux-ext4@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-integrity@vger.kernel.org" , "linux-security-module@vger.kernel.org" , "linux-xfs@vger.kernel.org" , "luto@kernel.org" , "mpatel@redhat.com" , "paul@paul-moore.com" , "selinux@vger.kernel.org" , "seth.forshee@canonical.com" , "smbarber@chromium.org" , "stephen.smalley.work@gmail.com" , "tkjos@google.com" , Linus Torvalds , "tycho@tycho.ws" , "tytso@mit.edu" , "viro@zeniv.linux.org.uk" , "zohar@linux.ibm.com" Subject: Re: [PATCH v6 24/40] fs: make helpers idmap mount aware Thread-Topic: [PATCH v6 24/40] fs: make helpers idmap mount aware Thread-Index: AQHXL5QPJZ+OaKJz8USD3Dodtq0P1w== Date: Mon, 12 Apr 2021 12:04:59 +0000 Message-ID: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [109.145.212.130] Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Proofpoint-GUID: Vd5127wVnEcv9vrUnKYvowNFSa7J_xlE X-Proofpoint-ORIG-GUID: Vd5127wVnEcv9vrUnKYvowNFSa7J_xlE X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.761 definitions=2021-04-12_09:2021-04-12,2021-04-12 signatures=0 X-Proofpoint-Spam-Details: rule=mpy_notspam policy=mpy score=0 adultscore=0 suspectscore=0 mlxlogscore=999 mlxscore=0 malwarescore=0 spamscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104120082 Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Hi, I noticed this patch got merged into mainline and looking through the HFS+ changes, I noticed something that struck me as odd. I am not familiar with this patch set so perhaps it is the intention but I wanted to ask you because it just seems strange thing to do. So you are adding a new argument of "struct user_namespace *mnt_userns" to lots of functions but then inside the functions when they call another function you often make that use "&init_user_ns" instead of the passed in "mnt_userns" which kind of defeats the point of having the new "mnt_userns" argument altogether, doesn't it? Example after this chunk: diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index 642e067d8fe8..7a937de9b2ad 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c @@ -241,7 +241,8 @@ static int hfsplus_file_release(struct inode *inode, struct file *file) return 0; } -static int hfsplus_setattr(struct dentry *dentry, struct iattr *attr) +static int hfsplus_setattr(struct user_namespace *mnt_userns, + struct dentry *dentry, struct iattr *attr) { struct inode *inode = d_inode(dentry); int error; The code now looks like this: static int hfsplus_setattr(struct user_namespace *mnt_userns, struct dentry *dentry, struct iattr *attr) { struct inode *inode = d_inode(dentry); int error; error = setattr_prepare(&init_user_ns, dentry, attr); if (error) return error; [...] setattr_copy(&init_user_ns, inode, attr); mark_inode_dirty(inode); return 0; } Shouldn't that be using mnt_userns instead of &init_user_ns both for the setattr_prepare() and setattr_copy() calls? Please note this is just one example - it seems the kernel is now littered with such examples in current mainline and I don't mean just HFS+ - this is now all over the place... Best regards, Anton -- Anton Altaparmakov (replace at with @) Lead in File System Development, Tuxera Inc., http://www.tuxera.com/ Linux NTFS maintainer