linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][TAKE-1] fs/btrfs: Return EPERM for rmdir on subvolumes and snapshots
@ 2010-04-08 22:47 Harshavardhana
  2010-04-09 17:58 ` Goffredo Baroncelli
  0 siblings, 1 reply; 7+ messages in thread
From: Harshavardhana @ 2010-04-08 22:47 UTC (permalink / raw)
  To: linux-btrfs

Break the conditional to return EPERM for subvolumes,snapshots and 
ENOTEMPTY for normal directories with files.

Signed-off-by: Harshavardhana <harsha@gluster.com>
---
 fs/btrfs/inode.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index a85b90c..465c3de 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -2591,9 +2591,11 @@ static int btrfs_rmdir(struct inode *dir, struct dentry *dentry)
 	struct btrfs_trans_handle *trans;
 	unsigned long nr = 0;
 
-	if (inode->i_size > BTRFS_EMPTY_DIR_SIZE ||
-	    inode->i_ino == BTRFS_FIRST_FREE_OBJECTID)
-		return -ENOTEMPTY;
+	if (inode->i_size > BTRFS_EMPTY_DIR_SIZE) 
+                return -ENOTEMPTY;
+
+        if (inode->i_ino == BTRFS_FIRST_FREE_OBJECTID)
+		return -EPERM;
 
 	ret = btrfs_reserve_metadata_space(root, 5);
 	if (ret)
-- 
1.6.6.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-04-09 21:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-08 22:47 [PATCH][TAKE-1] fs/btrfs: Return EPERM for rmdir on subvolumes and snapshots Harshavardhana
2010-04-09 17:58 ` Goffredo Baroncelli
2010-04-09 18:39   ` Harshavardhana
2010-04-09 18:54     ` Goffredo Baroncelli
2010-04-09 21:07       ` Harshavardhana
2010-04-09 21:13         ` Harshavardhana
2010-04-09 21:42           ` Goffredo Baroncelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).