btrfs: Return EXDEV for cross file system snapshot
authorKusanagi Kouichi <slash@ac.auone-net.jp>
Thu, 30 Jan 2014 07:32:02 +0000 (16:32 +0900)
committerJosef Bacik <jbacik@fb.com>
Mon, 10 Mar 2014 19:15:37 +0000 (15:15 -0400)
EXDEV seems an appropriate error if an operation fails bacause it
crosses file system boundaries.

Reviewed-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>
Signed-off-by: Josef Bacik <jbacik@fb.com>
fs/btrfs/ioctl.c

index 9a9044585da705ccc28956b6d860d1cd2b92579a..a692aad8fa5aa01ef2108ba19b4f28f68ca1c32e 100644 (file)
@@ -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