From patchwork Tue Mar 22 17:20:26 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Fasheh X-Patchwork-Id: 653191 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2MHKUQL022746 for ; Tue, 22 Mar 2011 17:20:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756469Ab1CVRU2 (ORCPT ); Tue, 22 Mar 2011 13:20:28 -0400 Received: from cantor.suse.de ([195.135.220.2]:51006 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754775Ab1CVRU1 convert rfc822-to-8bit (ORCPT ); Tue, 22 Mar 2011 13:20:27 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 99E7793A00 for ; Tue, 22 Mar 2011 18:20:26 +0100 (CET) Date: Tue, 22 Mar 2011 10:20:26 -0700 From: Mark Fasheh To: linux-btrfs@vger.kernel.org Subject: [PATCH] btrfs: return EXDEV when linking from different subvolumes Message-ID: <20110322172026.GO1703@wotan.suse.de> Reply-To: Mark Fasheh Mime-Version: 1.0 Content-Disposition: inline Organization: SUSE Labs, Novell, Inc User-Agent: Mutt/1.5.9i Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 22 Mar 2011 17:20:31 +0000 (UTC) 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;