diff mbox

btrfs: Return EXDEV for cross file system snapshot

Message ID 52cd2c7c00011d8a00004f4e0000743e400004e23b8c@amlmta033.auone-net.jp (mailing list archive)
State Accepted
Headers show

Commit Message

Kusanagi Kouichi Jan. 8, 2014, 10:46 a.m. UTC
EXDEV seems an appropriate error if an operation fails bacause it
crosses file system boundaries.

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

Comments

David Sterba Jan. 8, 2014, 3:14 p.m. UTC | #1
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 <slash@ac.auone-net.jp>
Reviewed-by: David Sterba <dsterba@suse.cz>
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Josef Bacik Jan. 28, 2014, 3:45 p.m. UTC | #2
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 <slash@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
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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,