xfs
[Top] [All Lists]

Re: [PATCH v13 02/51] vfs: Add MAY_CREATE_FILE and MAY_CREATE_DIR permis

To: Andreas Dilger <adilger@xxxxxxxxx>
Subject: Re: [PATCH v13 02/51] vfs: Add MAY_CREATE_FILE and MAY_CREATE_DIR permission flags
From: Andreas Gruenbacher <agruenba@xxxxxxxxxx>
Date: Wed, 4 Nov 2015 04:02:27 +0100
Cc: Alexander Viro <viro@xxxxxxxxxxxxxxxxxx>, "Theodore Ts'o" <tytso@xxxxxxx>, "J. Bruce Fields" <bfields@xxxxxxxxxxxx>, Jeff Layton <jlayton@xxxxxxxxxxxxxxx>, Trond Myklebust <trond.myklebust@xxxxxxxxxxxxxxx>, Anna Schumaker <anna.schumaker@xxxxxxxxxx>, Dave Chinner <david@xxxxxxxxxxxxx>, linux-ext4 <linux-ext4@xxxxxxxxxxxxxxx>, XFS Developers <xfs@xxxxxxxxxxx>, LKML <linux-kernel@xxxxxxxxxxxxxxx>, linux-fsdevel <linux-fsdevel@xxxxxxxxxxxxxxx>, Linux NFS Mailing List <linux-nfs@xxxxxxxxxxxxxxx>, linux-cifs@xxxxxxxxxxxxxxx, Linux API <linux-api@xxxxxxxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat_com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=t2OpH9ZDWmHfJJqRidP2uevbtHaaYN/bb0xRG3zpRbQ=; b=saBMWxvZXS3h+ydIVs37kjVkfiGUyKb80NS4YUZSsxe4Vka8am5/O4Nqif4LF09eZi BZlXsmL20kwunkWOw8fyzQVbJzrPVguOaXl/3TqtG0M0pD2E2gIFx+iAmmA3IlQS8Yyb 5LSFg+qGvFhy3OzGRUl7Rc/LfLaOfgJlNhWFlLp790A1ySoiloOt8BRF4BokCPWzL2xc xU4cZmF3vafPmZwCzk5Ti3+4iigq5K93R2R6tt2aNk9xMXNo4XiCrGapJq+hyyf8UgS1 t8iGm8g20mqgPerA1qnqGGeHq2/jIN1PVtj1fzN0XepMfcAMCZ0f6U4ka78RyjWfQ2rq 5dsw==
In-reply-to: <507E7A63-024B-4EBD-B0C3-4ABE8280440F@xxxxxxxxx>
References: <1446563847-14005-1-git-send-email-agruenba@xxxxxxxxxx> <1446563847-14005-3-git-send-email-agruenba@xxxxxxxxxx> <507E7A63-024B-4EBD-B0C3-4ABE8280440F@xxxxxxxxx>
On Wed, Nov 4, 2015 at 3:33 AM, Andreas Dilger <adilger@xxxxxxxxx> wrote:
> On Nov 3, 2015, at 8:16 AM, Andreas Gruenbacher <agruenba@xxxxxxxxxx> wrote:
>> @@ -3667,7 +3674,7 @@ EXPORT_SYMBOL(dentry_unhash);
>>
>> int vfs_rmdir(struct inode *dir, struct dentry *dentry)
>> {
>> -     int error = may_delete(dir, dentry, 1);
>> +     int error = may_delete(dir, dentry, true, false);
>
> This is a prime example why passing "true" and "false" as function arguments
> is not very useful, and especially prone to bugs when there are two of them.
>
> That said, this is code originally from Al, so he may have a different
> opinion.

Have you checked how vfs_rename uses the is_dir and new_is_dir
variables? Using file modes there probably won't help readability. An
enum maybe?

Thanks,
Andreas

<Prev in Thread] Current Thread [Next in Thread>