Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2802714ybi; Sun, 9 Jun 2019 21:39:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqxW33LNUiuIdlAY79C9MxFTQWx3fbMXdPwG3CGW+v4lQwnjIqu4cLymmiXZzQx99pS08vbX X-Received: by 2002:a62:2c8e:: with SMTP id s136mr28055557pfs.3.1560141572765; Sun, 09 Jun 2019 21:39:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560141572; cv=none; d=google.com; s=arc-20160816; b=Uz/3SN7MMm244dYLpWJiB2sF0GZF2RAD5M3JryU8cojty1tlxOyxMbNfnnkiTaBJuF kp89a0xJhiWnnI47KK3INh8umfMkCr34Dk5wXzVQGyWyjLrfyYKf2c03SHXOO3f+8TMC l8nIfgT7Wg4DSNwAXiCOFRUsfXM9oe+lNInKgHyW8KgS9o7G07+DgQr7Nymr9IRLhGFg mie0cruFl3PM58Z7FqLhE6KvYzX8jGM0tmDXtruLMNyJYHtcXJOJDToUYSiVqENf1NaG iBM5103fK/tRcmG8lm3pcWqLgDHuzLk6Exm1tuJtgNhPFWAFcNNOVYJBGAmNLigz1nzy A8Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=RVIer1zvGaaIfvyn5F36rSmi43Paz1XgnfXypjm5MJs=; b=JPeSdK9nsRJzuZ9LOKVKYV579S8jlK6sLTUuZd2tfcRLTKU2eHhKcoMwDkmU75zsBz tq3kaWEDBd+VRoQaNoZDV8E5lc4EOgZXn8YIuct8CEXPAfgKpLH+waZzthOAVeLDjC3f Tg++vpgC9AydlKT72gMbcP0kb1cN+DZCXM39mmH5ZDnh++gPz7o/1g+94IAXyxYT81N1 40Ki9hqeID92mERdC2d4qVXcZFN4HM5f1Y/F9JdrWExjvoX0suFVRZB68YCfHARAPnA8 ebwiFd4qj+y4cadFEm3WW+UZJMWU/CCwXbA+2/7M6uobIP42I/6fFWqNMHSUZ9lMwD4+ aV+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d8si8803241plr.260.2019.06.09.21.39.11; Sun, 09 Jun 2019 21:39:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728470AbfFJEis (ORCPT + 99 others); Mon, 10 Jun 2019 00:38:48 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:42004 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728469AbfFJEis (ORCPT ); Mon, 10 Jun 2019 00:38:48 -0400 Received: from callcc.thunk.org ([66.31.38.53]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id x5A4cS90014550 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Jun 2019 00:38:29 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id 83D27420481; Mon, 10 Jun 2019 00:38:28 -0400 (EDT) Date: Mon, 10 Jun 2019 00:38:28 -0400 From: "Theodore Ts'o" To: Eric Biggers Cc: Wang Shilong , Wang Shilong , "linux-ext4@vger.kernel.org" , "linux-f2fs-devel@lists.sourceforge.net" , Andreas Dilger Subject: Re: =?utf-8?B?5Zue5aSNOiBbZjJmcy1kZXZdIFtQ?= =?utf-8?Q?ATCH?= 1/2] ext4: only set project inherit bit for directory Message-ID: <20190610043828.GC15963@mit.edu> References: <1559795545-17290-1-git-send-email-wshilong1991@gmail.com> <20190606224525.GB84833@gmail.com> <20190607181452.GC648@sol.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190607181452.GC648@sol.localdomain> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, Jun 07, 2019 at 11:14:52AM -0700, Eric Biggers wrote: > > Existing versions of chattr can't be changed, and people don't necessarily > upgrade the kernel and e2fsprogs at the same time. So (1) wouldn't really work. > > A better solution might be to make FS_IOC_GETFLAGS and FS_IOC_FSGETXATTR never > return the project inherit flag on regular files. I've amended this patch by adding the following to fix it for FS_IOC_GETFLAGS (which is chattr uses): diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index 7af835ac8d23..74648d42c69b 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c @@ -779,6 +779,8 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) return ext4_ioc_getfsmap(sb, (void __user *)arg); case EXT4_IOC_GETFLAGS: flags = ei->i_flags & EXT4_FL_USER_VISIBLE; + if (S_ISREG(inode->i_mode)) + flags &= ~EXT4_PROJINHERIT_FL; return put_user(flags, (int __user *) arg); case EXT4_IOC_SETFLAGS: { int err; - Ted