Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751914AbbKDDCd (ORCPT ); Tue, 3 Nov 2015 22:02:33 -0500 Received: from mail-lf0-f52.google.com ([209.85.215.52]:35961 "EHLO mail-lf0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751782AbbKDDC3 (ORCPT ); Tue, 3 Nov 2015 22:02:29 -0500 MIME-Version: 1.0 In-Reply-To: <507E7A63-024B-4EBD-B0C3-4ABE8280440F@dilger.ca> References: <1446563847-14005-1-git-send-email-agruenba@redhat.com> <1446563847-14005-3-git-send-email-agruenba@redhat.com> <507E7A63-024B-4EBD-B0C3-4ABE8280440F@dilger.ca> Date: Wed, 4 Nov 2015 04:02:27 +0100 Message-ID: Subject: Re: [PATCH v13 02/51] vfs: Add MAY_CREATE_FILE and MAY_CREATE_DIR permission flags From: Andreas Gruenbacher To: Andreas Dilger Cc: Alexander Viro , "Theodore Ts'o" , "J. Bruce Fields" , Jeff Layton , Trond Myklebust , Anna Schumaker , Dave Chinner , linux-ext4 , XFS Developers , LKML , linux-fsdevel , Linux NFS Mailing List , linux-cifs@vger.kernel.org, Linux API Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1037 Lines: 26 On Wed, Nov 4, 2015 at 3:33 AM, Andreas Dilger wrote: > On Nov 3, 2015, at 8:16 AM, Andreas Gruenbacher 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/