diff mbox

btrfs: return EXDEV when linking from different subvolumes

Message ID 20110322172026.GO1703@wotan.suse.de (mailing list archive)
State New, archived
Headers show

Commit Message

Mark Fasheh March 22, 2011, 5:20 p.m. UTC
None
diff mbox

Patch

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 512c3d1..321ce4c 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -4809,7 +4809,7 @@  static int btrfs_link(struct dentry *old_dentry, struct inode *dir,
 
 	/* do not allow sys_link's with other subvols of the same device */
 	if (root->objectid != BTRFS_I(inode)->root->objectid)
-		return -EPERM;
+		return -EXDEV;
 
 	btrfs_inc_nlink(inode);
 	inode->i_ctime = CURRENT_TIME;