Skip to contentSkip to conversation

fs/btrfs: Return EPERM for rmdir on subvolumes and snapshots

PATCH In review Harshavardhana 2 participants 3 messages Apr 8, 2010 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 fs/btrfs/inode.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/btrfs/inode.c +1 -1
index a85b90c..c0fbe03 100644
@@ -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)
Signature · 1 line
1.6.6.1
#1 lore raw

fs/btrfs/inode.c static int btrfs_rmdir(struct inode *dir, struct dentry *dentry) · line 2596

Quoted 4 lines · Harshavardhana
	if (inode->i_size > BTRFS_EMPTY_DIR_SIZE ||
	    inode->i_ino == BTRFS_FIRST_FREE_OBJECTID)
fs/btrfs/inode.c +1 -1
-		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

#2 lore raw
Quoted 8 lines · David Brown

fs/btrfs/inode.c static int btrfs_rmdir(struct inode *dir, struct dentry *dentry) · line 2596

Quoted 4 lines · Harshavardhana
    if (inode->i_size > BTRFS_EMPTY_DIR_SIZE ||
        inode->i_ino == BTRFS_FIRST_FREE_OBJECTID)
fs/btrfs/inode.c +1 -1
-        return -ENOTEMPTY;
+        return -EPERM;
Quoted 4 lines

Don't you want to still return ENOTEMPTY for the size check, and only the EPERM on the root of subvolume?

David

Yep my bad. i_size check has to be ENOTEMPTY

Thanks

Signature · 2 lines
Harshavardhana
http://www.gluster.com