Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3571110pxb; Mon, 24 Jan 2022 12:29:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJzTgLl8278Y5JbqDVZTf/HmnDF3WxDvEVy1oiXLJYpKmfruzDdNZmmXdG3s1UPaFRQUEfg0 X-Received: by 2002:a17:90b:4d88:: with SMTP id oj8mr64967pjb.194.1643056195224; Mon, 24 Jan 2022 12:29:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643056195; cv=none; d=google.com; s=arc-20160816; b=LCOXnnn1uefjYO+CUgJn17WlzCm9zbec38zF7uaEzlt3wVbF67/AFeroS6gXJRukq7 9h+LRfzzf/wWU1ZQHrum6LRm/spwiDAfhfW2nTaKX0Xc9SlYt9qMs13hVjs7q95aY60t 2hKZZhmGYcOM7ZASrpuDwLyzPVLBsbvgtfnBo7iquIDVdWo1le906PgGGr7RA7KCNr9G QDYZnYpZJZkpZw6VmsVsEmwAW/xelGA4y3oMdqOuNVv5OE0HX3VVy6Eb7A+55/SatB7H ylsQ5p5Rgga2CwgzqFVY/pVY8aKfBkFZeOsogVYuMDF+eIPzL0SEbUwxtMh/Ep8Anhrf BTPg== 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=xbpit+XHrq+LsqQcFgMTK0y1PuJJaB815iBx6ru8WQQ=; b=C1X3evGoQRuv5jFv8CEIxKkwKNOZji7lk2NAIlpcycCBHEUFS5u6q4FDKmdtstiMFW w6F9kx/ORHnI6pRDijnFWI5v0pINDMVa/dXxSjuV0tMBanqhnONioh55cRLXrwm27bUL nojyObvZvA+Z1Pp6FFoUHtR3drI7iXHnB5IagBVgpRkcub9UbuRvBJK1wIu9VngTtmLi LatJbwXRA2aY/cTQ11V7z5yvXUoDDE8KSCa4yJMBABACcg4u6aXTApQ87q5xMNLGQY5d 0TsyiwLPS+hq0jNCNJqudBvrSvlgWQpvMZ6qyRgW25xjB7CyyuSjDYy2i/EnlbmTnexN 9Irw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XBIgUtI+; 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 w6si9654643plg.17.2022.01.24.12.29.43; Mon, 24 Jan 2022 12:29:55 -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=XBIgUtI+; 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 S233058AbiAXTd4 (ORCPT + 99 others); Mon, 24 Jan 2022 14:33:56 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:53600 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351017AbiAXTZq (ORCPT ); Mon, 24 Jan 2022 14:25:46 -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 262EB61483 for ; Mon, 24 Jan 2022 19:25:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 814B1C340E5; Mon, 24 Jan 2022 19:25:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643052345; bh=cGzIZ1MKIizkECbK+Lu6MG2AB+TsAwI9HGRrv3av30U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XBIgUtI+EvImF0ZnkknOIa1odOeHkZxvWOe9sjHFCoHERQmLMXF/wGmAWuDjID+ss Br5A1DegoEO2p5tr1Pg0srwkXqnN7ZSQmHI/tl12j0Gwelrj+qcAHfw7A3i61XQesw RvBj2vThha7fuNGTOWz2XB6/L7MM8OXPyQk3P4CiXrX+BM9WG8HfRxs4NvGJA8qWxP 6l2pzQBnavjC+BDfIVLFeracw1J7y2+aEnL9shzPuaNVXmCYAtAIGVPTr10L9yWeLq wzDK7/K4K+1YhHOmojtBEuWaCCApSU2rVq8hmeL9ZzjOhAhCH1G38Qnh5bEtHwI9F/ ArMjIYa1c0ULg== Date: Mon, 24 Jan 2022 19:25:44 +0000 From: Eric Biggers To: Harry Austen 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 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 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. */ Also, even if this patch was correct, the Fixes tag is wrong. - Eric