Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5010032pxb; Wed, 26 Jan 2022 02:53:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJzlMDj5xBjGZ2lvh/DRFUivjqpJyFSwufKiUU/BhqPfwWQR9xZBODMLtXgMVDHEPiIcqGGH X-Received: by 2002:a17:902:ea93:b0:14b:574e:4066 with SMTP id x19-20020a170902ea9300b0014b574e4066mr11520824plb.118.1643194383141; Wed, 26 Jan 2022 02:53:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1643194383; cv=pass; d=google.com; s=arc-20160816; b=PTf6WkZIV88rJWwNCZYgp5358mtT/kM4lry5Er0AyBap06XFb6U/8Ju6SV00hAajqI R8HHwYFuqSMbUpG1de3a60G4/fd4ZwgUtUsBjy/fkmMY0raC8LSl79p8LHQDNc6Xu0lZ iv6i2N788Z9wDeQgWnN3qtVUZeSuRoE9+a1st5DgEO9J2TNqfuIeJjA/Y/9e6xg5Kga0 qeC1qS7Xywa8hLbGO+Jp8hdjTmvCTplXmbzdyx4EJXSrPYxw8q//4ewcPj+N1AmmFg50 UQFWJ8+boSPpIttJW5wcGoyJIl1nYA76cahLj+HyaVyepJQQkt/0vHZ8CtM5kSCIo8IU +uuw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from; bh=gpeLw7yJwErO8PIWpxygPviWLz4GjlCFaSfQnCkD2u4=; b=oCIdQxyDLkdAe1+NdqLOWNL5nXqun7XnrRLa+3iGna4leWfSuHJPW5k7ZLLQoYTrQD 4QhtPH7LExHHbOdDe19tO6iFTgzGFL5bkV6D+AM0i65+4AIZRYRNyJlpp9iUzXXN/7Ks 8JU9FUZ3S01yGjR1cmWj2KV8O8pwCtmjHWpWjznAWiM8BlJ4J14fxqo7vqn1b0efW2V8 vGL3m2flLH18KpBfHNE7k4nXo36v4/naVl+3FawG54Cr8Nq4/gzo02+wVG529SNYL7PC X7LDaOyY5v30z+43MUr07aS8RUIDrndUDdzTatZL4qka0kQUxSomyHdmJobt3eFjD6Qe iQ4w== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); 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=fail (p=NONE sp=NONE dis=NONE) header.from=hotmail.co.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c17si1325237pfc.100.2022.01.26.02.52.23; Wed, 26 Jan 2022 02:53:03 -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; arc=pass (i=1); 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=fail (p=NONE sp=NONE dis=NONE) header.from=hotmail.co.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233476AbiAYWCb (ORCPT + 99 others); Tue, 25 Jan 2022 17:02:31 -0500 Received: from mail-oln040092070096.outbound.protection.outlook.com ([40.92.70.96]:20356 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233472AbiAYWC3 (ORCPT ); Tue, 25 Jan 2022 17:02:29 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fea/Ou2LylKHDmVjj0AhRqLyX3jgHkvodZjydrtJsoguWKNqol9jNBKqxvuGXBcSzcTOBEW5gm2bg26m+wloB95SOxWouJh77Y3hhqSoyvHNdOFNDT6zcyVXWhggxheZbSKSR1umXJFAmqXivhkrvfPL5g1jMr3DmmAPmYQUPLt9Pfa/xJ3QlH0I9P9ZDpodNplOlls5bgQfJdmyMWTxap14HRrs50Zjnxi8L46uqXhf4fS8VHwf59fFZljU3RZUa4lDokpprvSTZ1r01AYSX+t/LvLerg7NKa8CUOKVWQQyKGwIxpGR8gM0PxfvvuhbxZkRR3C1mb3C/WWFI6qI9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gpeLw7yJwErO8PIWpxygPviWLz4GjlCFaSfQnCkD2u4=; b=h8RjgzmzAQ79rb6l1Rysv2QtMTWPdswjFulFzKPY8Rm+pfhYpyWNZHJI8vll+z15nxGW+FPgDTV73WjiP6jXBqrqVCeiYCHJz3TPurOsc0ra12RCctHGlnArjsq0nYOGL4oQ84+vBjVNWpgK79aRmpc8IfkE+3VZ9JhW2wZcS7sZJJeMvLBUBpFqNKecWSsIHg49zA/bIhz2YYoxWCjK67VZHKYIYATgRSUlhWwwupvUhZB/UjWGi7wjJloFGtmLt3QHbC8AzkTsyc98puy9gIFwh3bVXlAnwWxNVlpPWyDJ2u5HUwQA3diqG8PUX1RNAVHQPM59rKYJCLvuY6vJCQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from AM6PR10MB2838.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:a2::21) by DB6PR10MB1653.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:6:38::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.15; Tue, 25 Jan 2022 22:02:28 +0000 Received: from AM6PR10MB2838.EURPRD10.PROD.OUTLOOK.COM ([fe80::29d8:5a1d:50be:a0b6]) by AM6PR10MB2838.EURPRD10.PROD.OUTLOOK.COM ([fe80::29d8:5a1d:50be:a0b6%6]) with mapi id 15.20.4909.017; Tue, 25 Jan 2022 22:02:27 +0000 From: Harry Austen To: Harry Austen , Eric Biggers Cc: linux-f2fs-devel@lists.sourceforge.net, jaegeuk@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [f2fs-dev] [PATCH] f2fs: fix fileattr_set unsupported attribute handling Date: Tue, 25 Jan 2022 22:01:49 +0000 Message-ID: In-Reply-To: References: Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-TMN: [uvzwg11jerwOnBqCsa8BE52wtgSSAWpJ] X-ClientProxiedBy: LO2P265CA0262.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:8a::34) To AM6PR10MB2838.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:a2::21) X-Microsoft-Original-Message-ID: <5424699.vVTlMVzpOe@harry-linuxpc> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6c8131e1-80fc-47ee-9e1b-08d9e04e6014 X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiQenZB4DUk7DorRi9oy43xdUPAaBiiV1Z2nZWdOyrxe5ia1KChvwMPz8paj/kntkMwYtMxTeifkvf2Evtfv37DEM3LTYlJsf1AZZh5yDoz6BnCCacfyA3wJs19J0TUFx6FqXnyHptdHEaJNpPtL8Is45KDLkqkglWefJGb9vZ/9IoUCl/I+wn5di8NEgstQ5aH3TPwW4uryjAb78WMIJnboAq9AlZak9DKTxx4wKZTRxT5YbU/lE0pkNF4lnjhrffMszKEdaKXf27n/fzLiLVMx4Kbjv9kGGE8PfiZ47hYz6pDH7UIFZs57mvzTcZE1mciUCDwSBkpDOCjAUwzvRav99c1thQ7XUBfqhZwDJhzz9QSo2yMeixTxI4hR6AvEw00pI8C8DfHHTsZT725hor78wWKgHchGZ9ML9QehlVtFn0bBV4BbeVbCY+FyYU6IYKLucYZzofHO7Azv5OZn4C9INjHUi3INYU1AbJFrWA9AdmGeKHXRIbr82fDaSnJyoyYcRbsnOVeyOsUPwv5PdhDPHm1PRxUFTJv5xSd+xpEkgINRf/+zU8+YqRA6Td4e2sfzAlHrAr7WH8F3ju1PtZnn3Z1CW7IY/KPxq/go2K0ADV5RqY31Qzdw8DMhBkvK7MQzv6JbzHk9LMIetJcwTRa53tjrmf3Hdw7OdrrBCmezTzQUMCMHwRbB3d7tDt685gaXS0qXvvDr550CHeLXGnoqv3QqU6zc127VjHxFfeyWT4mUDw6vCbx9vgonOBvtTXA= X-MS-TrafficTypeDiagnostic: DB6PR10MB1653:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Q3qFY1f1ywh37XnmU4DBj81Bq9p75OLx7vIsDZqBEkfE0eDzQ2uTwlQxLUiNfIiMYscCv55chjbEjwLv0o9vp99z8Q50fp6Rq8IE1QjKi+szlwoxVKPP0Rhd0mZ0nIg+Wv0Vt8N1tUWDjUBCO8veDKLIX05AIlRKgvz/yXWk+v4fcipWgbpS0QCLoFexNwatqLWL7npkmju2s5BHLC+z5TDAA9O7MsJ4FhoUTh6JENBmqmK4+zAd3FtIeZbTceboHNh11Z1EpkBSMhdR1czkUShJlMwl4tu8bcKN2IwdNDsSYzuP83Fh0VIj18vqgL4N7cLitjy3Xa36YxHEnFe5wb++buYG9fjtVv/P+7BfhHLPOUKXUHUWy6bGqbuLUL/Tp/i8IYK4s1OBz1Y6QKRDyewsS/mONdRvaDV+NQg88VHoRhWqqs04h9hwcfcrB6zSUr7tqG6PjEg4U8Zff5fPnW5+L8HNhOerb6czwrgfhLiISoxAFqIgUKufsodXjcIcOhSz8DgQet3CueU1gjOqEo6y/UMy6UeDym9thxkcFSmnefowWglTkDoTysed7qe+vVU6Zihpuw80zVMe2kKTMg== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Z4v4o6elpD9fR96iax47dUN4RBCm+x7EXW4CCgBGkwVBW5/f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5K3y7k2zgNcQ81mZE/+6oVu8p/iKbST42IEA82A1?= =?us-ascii?Q?JeagEfwUKm0MASBA5K+nCw=3D=3D?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-6b909.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 6c8131e1-80fc-47ee-9e1b-08d9e04e6014 X-MS-Exchange-CrossTenant-AuthSource: AM6PR10MB2838.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2022 22:02:27.8670 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR10MB1653 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday, 24 January 2022 19:25:44 GMT Eric Biggers wrote: > On Sat, Jan 22, 2022 at 12:59:03PM +0000, Harry Austen wrote: > > FS_IOC_SETFLAGS ioctl should return EOPNOTSUPP if the file attribute > > (e.g. FS_NOCOW_FL) is not supported, rather than silently ignoring it > > and returning success. > > > > Fixes: 9b1bb01c8ae7 (f2fs: convert to fileattr) > > Signed-off-by: Harry Austen > > --- > > > > fs/f2fs/file.c | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c > > index 92ec2699bc85..061bf35c2582 100644 > > --- a/fs/f2fs/file.c > > +++ b/fs/f2fs/file.c > > @@ -3085,9 +3085,8 @@ int f2fs_fileattr_set(struct user_namespace > > *mnt_userns,> > > return -EIO; > > > > if (!f2fs_is_checkpoint_ready(F2FS_I_SB(inode))) > > > > return -ENOSPC; > > > > - if (fsflags & ~F2FS_GETTABLE_FS_FL) > > + if (fsflags & ~F2FS_SETTABLE_FS_FL) > > > > return -EOPNOTSUPP; > > > > - fsflags &= F2FS_SETTABLE_FS_FL; > > > > if (!fa->flags_valid) > > > > mask &= FS_COMMON_FL; > > This is intentional, and matches what ext4 does; see the comment in the ext4 > implementation of this: > > /* > * chattr(1) grabs flags via GETFLAGS, modifies the result and > * passes that to SETFLAGS. So we cannot easily make SETFLAGS > * more restrictive than just silently masking off visible but > * not settable flags as we always did. > */ Ah, my apologies. I thought it looked a little too obvious. Clearly I should have looked at the ext4 code. Please disregard this patch. Is there anything else that could be done to improve unsettable attribute handling? For example, is there a reason FS_NOCOW_FL is gettable but not settable? Could it be added to the settable list? > > Also, even if this patch was correct, the Fixes tag is wrong. Having looked at this a bit more, I assume you are saying this due to the missing double quotes around the commit summary? (just so I know for next time as this is my first attempt at sending a kernel patch) > > - Eric Many thanks for your help Eric, Harry