]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: return EXDEV when linking from different subvolumes
authorMark Fasheh <mfasheh@suse.com>
Tue, 22 Mar 2011 17:20:26 +0000 (17:20 +0000)
committerroot <Chris Mason chris.mason@oracle.com>
Mon, 28 Mar 2011 09:37:42 +0000 (05:37 -0400)
commit44d9ce54cbb7ef33081e0360ac4b9baf28db71c8
tree53bb771dbb18194a9d13ce2c84c81f2ab834b7e5
parent4ac1d31542c54055e5cbfa5382d930ba8b4fcbe8
btrfs: return EXDEV when linking from different subvolumes

btrfs_link returns EPERM if a cross-subvolume link is attempted.

However, in this case I believe EXDEV to be the more appropriate value.
>From the link(2) man page:

EXDEV  oldpath and newpath are not on the same mounted file system.  (Linux
       permits a file system to be mounted at multiple points, but link()
       does not work across different mount points, even if the same file
       system is mounted on both.)

This matters because an application may have different behaviors based on
return codes.

Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/inode.c