Thread (1 message) 1 message, 1 author, 2015-11-04

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

From: Andreas Gruenbacher <hidden>
Date: 2015-11-04 03:02:27
Also in: linux-cifs, linux-ext4, linux-fsdevel, linux-nfs, linux-xfs, lkml

On Wed, Nov 4, 2015 at 3:33 AM, Andreas Dilger [off-list ref] wrote:
On Nov 3, 2015, at 8:16 AM, Andreas Gruenbacher [off-list ref] wrote:
quoted
@@ -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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help