Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH] btrfs: Return EXDEV for cross file system snapshot

6 views
Skip to first unread message

Kusanagi Kouichi

unread,
Jan 8, 2014, 6:10:02 AM1/8/14
to
EXDEV seems an appropriate error if an operation fails bacause it
crosses file system boundaries.

Signed-off-by: Kusanagi Kouichi <sl...@ac.auone-net.jp>
---
fs/btrfs/ioctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 21da576..15d35cb 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -1544,7 +1544,7 @@ static noinline int btrfs_ioctl_snap_create_transid(struct file *file,
if (src_inode->i_sb != file_inode(file)->i_sb) {
printk(KERN_INFO "btrfs: Snapshot src from "
"another FS\n");
- ret = -EINVAL;
+ ret = -EXDEV;
} else {
ret = btrfs_mksubvol(&file->f_path, name, namelen,
BTRFS_I(src_inode)->root,
--
1.8.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

David Sterba

unread,
Jan 8, 2014, 10:20:02 AM1/8/14
to
On Wed, Jan 08, 2014 at 07:46:19PM +0900, Kusanagi Kouichi wrote:
> EXDEV seems an appropriate error if an operation fails bacause it
> crosses file system boundaries.
>
> Signed-off-by: Kusanagi Kouichi <sl...@ac.auone-net.jp>
Reviewed-by: David Sterba <dst...@suse.cz>

Josef Bacik

unread,
Jan 28, 2014, 10:50:02 AM1/28/14
to

On 01/08/2014 05:46 AM, Kusanagi Kouichi wrote:
> EXDEV seems an appropriate error if an operation fails bacause it
> crosses file system boundaries.
>
> Signed-off-by: Kusanagi Kouichi <sl...@ac.auone-net.jp>
> ---
> fs/btrfs/ioctl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> index 21da576..15d35cb 100644
> --- a/fs/btrfs/ioctl.c
> +++ b/fs/btrfs/ioctl.c
> @@ -1544,7 +1544,7 @@ static noinline int btrfs_ioctl_snap_create_transid(struct file *file,
> if (src_inode->i_sb != file_inode(file)->i_sb) {
> printk(KERN_INFO "btrfs: Snapshot src from "
> "another FS\n");
> - ret = -EINVAL;
> + ret = -EXDEV;
> } else {
> ret = btrfs_mksubvol(&file->f_path, name, namelen,
> BTRFS_I(src_inode)->root,
Doesn't apply cleanly to btrfs-next, please rebase and try again. Thanks,

Josef

Kusanagi Kouichi

unread,
Jan 30, 2014, 2:40:02 AM1/30/14
to
EXDEV seems an appropriate error if an operation fails bacause it
crosses file system boundaries.

Signed-off-by: Kusanagi Kouichi <sl...@ac.auone-net.jp>
---
fs/btrfs/ioctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 34772cb..0176045 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -1573,7 +1573,7 @@ static noinline int btrfs_ioctl_snap_create_transid(struct file *file,
if (src_inode->i_sb != file_inode(file)->i_sb) {
btrfs_info(BTRFS_I(src_inode)->root->fs_info,
"Snapshot src from another FS");
- ret = -EINVAL;
+ ret = -EXDEV;
} else if (!inode_owner_or_capable(src_inode)) {
/*
* Subvolume creation is not restricted, but snapshots
--
1.9.rc1
0 new messages