Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp902372pxb; Tue, 1 Feb 2022 12:48:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJw487UCKyE1SB5T3ocTNhDUAAhz3HTDK3LWPkqVqmlmP02XV0AmilNcnqyYc/HpKRvpk1CT X-Received: by 2002:a17:90a:e288:: with SMTP id d8mr4437680pjz.196.1643748520540; Tue, 01 Feb 2022 12:48:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643748520; cv=none; d=google.com; s=arc-20160816; b=xh3ECoXllNcY7HcLFQnuuzhxqS/yAkuU2WA/HEcdeYV9bj5GuKVVjvirvfQHhiFnh0 GyMrSaYM2U2/F7oq3+wlsDr03HuPct41hWEWKzYta1T2+Ep3TgEvcbKIXHVcJSK14VvX qLwBMUj9Jb5d2AUze8EdjKAJQ0Pq/8NVcYhJAfBsbsI1DK+ch/zxXpQbfcDBpUF1xu57 0AdGqse005xp0ajfbAO1t0C7JryIaj8Q39t9OKIzQeO7xxAYMH379wXgGLddecFia0Lc xmtBFydXFyUKLE9ZUZpVTy/owlipuW3a19YvqRBF+eAYZ1J8tFKh1HKaiNVs/xLqBwh0 N7nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=tcrewrn9T/dyU4Vh16Rf1StJfKvKN10MRQzbMwpJOZQ=; b=rPwqh4zeD6Bps0yCeasqhZ1/3Cz83EkeIa/oCxXX6nqHIvh1veUeuddNH44s7/DwEu Cik+mmXU7VB2SFEDSN83BzrI6Oq1VlES+iy30O8zssn2HlXe04dCT+tY1ceONvUnRpRN Q/vRMQabpieE8t76T4SO59uTaLIWfo7wPZRlV6sLN/pNHY+mHMxzT0UvYCAEhE2Tb1Lt crJzI65V8p8d2VazaYBpVSOW4hETStUczxQnqbAT7IISWe6klToIso3ZZaZAFJdsj4Th 7pPZSR8vVOnSHkXJntyf21KD4b3HKpoamM6SJYqP3MZEcMD/kdiCUECJ22L31WyfwsrR Cn6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=s+jVDeyP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j9si19148701pfc.94.2022.02.01.12.48.28; Tue, 01 Feb 2022 12:48:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=s+jVDeyP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376913AbiAaTe6 (ORCPT + 99 others); Mon, 31 Jan 2022 14:34:58 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:59034 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376812AbiAaTe4 (ORCPT ); Mon, 31 Jan 2022 14:34:56 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BEBED61449 for ; Mon, 31 Jan 2022 19:34:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1423BC340E8; Mon, 31 Jan 2022 19:34:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643657695; bh=aDSxNsqNgxymIMupEkRchSOtPKLku8ZLqWJGphw2KQU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=s+jVDeyPLfSdinXQiVT8qLMyS4gdD4wPOBdtcRKMrTuHwdej7Xazt9hNQX3RZnHZs gm8lEqyFvWHXe9DMWkouGaL2fqPw6dM198xxt7024uTR8L9GKI8lnyWjuYrynhgYF2 4KGubMHYmSc0/CMNBlFsYttKZRs6IRj1inC49dlsboaeXF10N3Z+hgfLbuzhCy9003 1KXB1Ox8axiWipBP9B9Mc6sTatYl1E4F/FfgzAAv+s8BIj7/sYQ3YBXT8X+s5z76iH NuGvOGqLR8qckiFe1v0E7Jf3CLXxWxHLl46SYiW7DZ3tfoEJkhg8P0f04aHGbkr/zj GBh2a0BkJj9Sw== Date: Mon, 31 Jan 2022 19:34:53 +0000 From: Eric Biggers To: Harry Austen Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, jaegeuk@kernel.org, chao@kernel.org Subject: Re: [RFC PATCH] f2fs: disallow setting unsettable file attributes Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 30, 2022 at 05:21:39PM +0000, Harry Austen wrote: > After Eric kindly pointed out the reasons why my initial kernel patch > attempt was incorrect > (https://lore.kernel.org/lkml/Ye79OLCFLR3H+GnY@gmail.com/), I had a > rethink as to if the current implementation could be improved in any > way. > > I wondered whether something along the lines of the following patch > would be more acceptable? It is intentionally verbose in order to > demonstrate the concept as this is intended purely as an RFC. > > What if SETFLAGS returned EOPNOTSUPP if userspace is actually trying to > *set* one of the unsettable flags (i.e. it isn't set already)? I believe > this would therefore not break chattr(1), as flags that are retrieved > from GETFLAGS can still be passed into SETFLAGS without error. > > If there is some other ABI compatibility that needs to be maintained > that is broken by this, then please let me know. Also, I have not yet > determined whether there are any concerns with calling f2fs_fileattr_get > from inside f2fs_fileattr_set, e.g. speed/performance? so any thoughts > would be greatly appreciated. > > Signed-off-by: Harry Austen > --- > fs/f2fs/file.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) This makes sense, but this ioctl isn't f2fs-specific; it's implemented by other filesystems, most notably ext2/ext4 where it originated. f2fs shouldn't have different behavior for the same ioctl. If you want to change this ioctl, you need to start a wider discussion (including the linux-fsdevel and linux-ext4 mailing lists) where the change is proposed for all filesystems. - Eric