Re: rmdir SubVolume?

2010-05-11 Thread Harshavardhana
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 majord...@vger.kernel.org More majordomo info at http://vger.kernel.org

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

2010-04-09 Thread Harshavardhana
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 to majord...@vger.kernel.org More majordomo info at http

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

2010-04-09 Thread Harshavardhana
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-btrfs in the body

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

[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 har...@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

Re: ENOTEMPTY on rm -rf for snapshot and subvolume

2010-04-08 Thread Harshavardhana
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 linux-btrfs in the body of a message

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 to still return

[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 har...@gluster.com --- fs/btrfs/inode.c |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs

ENOTEMPTY on rm -rf for snapshot and subvolume

2010-04-07 Thread Harshavardhana
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 this way. Regards -- Harshavardhana http://www.gluster.com

[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 snip while (fs_devices) { . ... } /snip Dereferencing happens right after, in this case over NULL pointer. Signed-off-by: Harshavardhana har...@gluster.com --- fs/btrfs/volumes.c |3 ++- 1 files changed, 2 insertions

[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 har...@gluster.com --- btrfs-image.c |5 + btrfstune.c |7 +++ 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/btrfs-image.c b/btrfs