* [PATCH] fs/btrfs: Return EPERM for rmdir on subvolumes and snapshots
@ 2010-04-08 20:35 Harshavardhana
2010-04-08 22:07 ` David Brown
0 siblings, 1 reply; 3+ messages in thread
From: Harshavardhana @ 2010-04-08 20:35 UTC (permalink / raw)
To: linux-btrfs
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] fs/btrfs: Return EPERM for rmdir on subvolumes and snapshots
2010-04-08 20:35 [PATCH] fs/btrfs: Return EPERM for rmdir on subvolumes and snapshots Harshavardhana
@ 2010-04-08 22:07 ` David Brown
2010-04-08 22:35 ` Harshavardhana
0 siblings, 1 reply; 3+ messages in thread
From: David Brown @ 2010-04-08 22:07 UTC (permalink / raw)
To: Harshavardhana; +Cc: linux-btrfs
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fs/btrfs: Return EPERM for rmdir on subvolumes and snapshots
2010-04-08 22:07 ` David Brown
@ 2010-04-08 22:35 ` Harshavardhana
0 siblings, 0 replies; 3+ messages in thread
From: Harshavardhana @ 2010-04-08 22:35 UTC (permalink / raw)
To: David Brown; +Cc: linux-btrfs
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?
>
> David
Yep my bad. i_size check has to be ENOTEMPTY
Thanks
--
Harshavardhana
http://www.gluster.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-04-08 22:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-08 20:35 [PATCH] fs/btrfs: Return EPERM for rmdir on subvolumes and snapshots Harshavardhana
2010-04-08 22:07 ` David Brown
2010-04-08 22:35 ` Harshavardhana
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.