Re: rmdir SubVolume?

2010-05-11 Thread Harshavardhana
implementing the btrfsctl -D part into "btrfs_rmdir" itself. Never got much time to look into it. Regards -- Harshavardhana Gluster Inc - http://www.gluster.com -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to

Re: [PATCH][TAKE-1] fs/btrfs: Return EPERM for rmdir on subvolumes and snapshots

2010-04-09 Thread Harshavardhana
On 04/09/2010 02:07 PM, Harshavardhana wrote: EBUSY is again meant for different reason where in a super block is being locked or accessed by an Application which would mean unref on that block would cause Application to go nuts. In such cases EBUSY is returned. Ok i think ENOTSUPP could be

Re: [PATCH][TAKE-1] fs/btrfs: Return EPERM for rmdir on subvolumes and snapshots

2010-04-09 Thread Harshavardhana
where in a super block is being locked or accessed by an Application which would mean unref on that block would cause Application to go nuts. In such cases EBUSY is returned. -- Harshavardhana http://www.gluster.com -- To unsubscribe from this list: send the line "unsubscribe linux-btr

Re: [PATCH][TAKE-1] fs/btrfs: Return EPERM for rmdir on subvolumes and snapshots

2010-04-09 Thread Harshavardhana
tself can call subvol removal ioctl for snapshots and subvolumes in case someone issues a rmdir on such directories. Suggestions please. Regards -- Harshavardhana http://www.gluster.com -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message t

[PATCH][TAKE-1] fs/btrfs: Return EPERM for rmdir on subvolumes and snapshots

2010-04-08 Thread Harshavardhana
Break the conditional to return EPERM for subvolumes,snapshots and ENOTEMPTY for normal directories with files. Signed-off-by: Harshavardhana --- 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

Re: [PATCH] fs/btrfs: Return EPERM for rmdir on subvolumes and snapshots

2010-04-08 Thread Harshavardhana
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 t

Re: ENOTEMPTY on "rm -rf" for snapshot and subvolume

2010-04-08 Thread Harshavardhana
t subvolume which is not supposed to be > deleted this way. Good point, eperm might be more intuitive. -chris Thanks a lot for the inputs sent a patch for that. Regards -- Harshavardhana http://www.gluster.com -- To unsubscribe from this list: send the line "unsubscribe l

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

2010-04-08 Thread Harshavardhana
rmdir on subvolumes and snapshots should return "EPERM" rather than ENOTEMPTY. Just to be more descriptive. Signed-off-by: Harshavardhana --- 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 a85b90

[PATCH] fs/btrfs: Avoid possible NULL pointer dereference for fs_devices

2010-04-07 Thread Harshavardhana
loop is never traversed for fs_devices NULL in volumes.c while (fs_devices) { . ... } Dereferencing happens right after, in this case over NULL pointer. Signed-off-by: Harshavardhana --- fs/btrfs/volumes.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff

ENOTEMPTY on "rm -rf" for snapshot and subvolume

2010-04-07 Thread Harshavardhana
elative snapshots?. But either in that case too returning ENOTEMPTY does confuse a user a lot. Isn't it valid just by returning EPERM will explain a lot to users saying that this is a snapshot of a subvolume or a parent subvolume which is not supposed to be deleted

[PATCH] btfs-progs: Add null pointer checks

2010-04-06 Thread Harshavardhana
root tree is NULL in case of non btrfs devices, resulting in segfault. This patch fixes such issue. Signed-off-by: Harshavardhana --- btrfs-image.c |5 + btrfstune.c |7 +++ 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/btrfs-image.c b/btrfs-image.c index