Harshavardhana
2010-Apr-08 20:35 UTC
[PATCH] fs/btrfs: Return EPERM for rmdir on subvolumes and snapshots
rmdir on subvolumes and snapshots should return "EPERM" rather than ENOTEMPTY. Just to be more descriptive. Signed-off-by: Harshavardhana <harsha@gluster.com> --- fs/btrfs/inode.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index a85b90c..c0fbe03 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -2593,7 +2593,7 @@ static int btrfs_rmdir(struct inode *dir, struct dentry *dentry) if (inode->i_size > BTRFS_EMPTY_DIR_SIZE || inode->i_ino == BTRFS_FIRST_FREE_OBJECTID) - return -ENOTEMPTY; + return -EPERM; ret = btrfs_reserve_metadata_space(root, 5); if (ret) -- 1.6.6.1 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
David Brown
2010-Apr-08 22:07 UTC
Re: [PATCH] fs/btrfs: Return EPERM for rmdir on subvolumes and snapshots
On Thu, Apr 08, 2010 at 01:35:31PM -0700, Harshavardhana wrote:> if (inode->i_size > BTRFS_EMPTY_DIR_SIZE || > inode->i_ino == BTRFS_FIRST_FREE_OBJECTID) >- return -ENOTEMPTY; >+ return -EPERM;Don''t you want to still return ENOTEMPTY for the size check, and only the EPERM on the root of subvolume? David -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Harshavardhana
2010-Apr-08 22:35 UTC
Re: [PATCH] fs/btrfs: Return EPERM for rmdir on subvolumes and snapshots
On 04/08/2010 03:07 PM, David Brown wrote:> On Thu, Apr 08, 2010 at 01:35:31PM -0700, Harshavardhana wrote: > > >> if (inode->i_size > BTRFS_EMPTY_DIR_SIZE || >> inode->i_ino == BTRFS_FIRST_FREE_OBJECTID) >> - return -ENOTEMPTY; >> + return -EPERM; > > Don''t you want to still return ENOTEMPTY for the size check, and only > the EPERM on the root of subvolume? > > DavidYep my bad. i_size check has to be ENOTEMPTY Thanks -- Harshavardhana http://www.gluster.com -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html