From patchwork Thu Jan 30 07:32:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kusanagi Kouichi X-Patchwork-Id: 3555891 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6C09B9F2E9 for ; Thu, 30 Jan 2014 07:53:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9B2C52018E for ; Thu, 30 Jan 2014 07:53:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B3D1920181 for ; Thu, 30 Jan 2014 07:53:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751027AbaA3Hxh (ORCPT ); Thu, 30 Jan 2014 02:53:37 -0500 Received: from mail-ae2-f129.auone-net.jp ([111.87.219.129]:42745 "EHLO dmta01.auone-net.jp" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750954AbaA3Hxh (ORCPT ); Thu, 30 Jan 2014 02:53:37 -0500 X-Greylist: delayed 721 seconds by postgrey-1.27 at vger.kernel.org; Thu, 30 Jan 2014 02:53:37 EST Received: from amlmta038.auone-net.jp (amlmta038-MM [10.188.22.109]) by dmta01.auone-net.jp (au one net mail) with ESMTP id 720345603F1; Thu, 30 Jan 2014 16:32:03 +0900 (JST) Received: from ppp.dion.ne.jp ([222.2.189.82]) by amlmta038.auone-net.jp id 52e9fff3000260ca00006df700005bb6e0000bb51ac1; Thu, 30 Jan 2014 16:32:03 +0900 Date: Thu, 30 Jan 2014 16:32:02 +0900 From: Kusanagi Kouichi To: linux-btrfs@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH] btrfs: Return EXDEV for cross file system snapshot MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Message-Id: <52e9fff3000260ca00006df700005bb6e0000bb51ac1@amlmta038.auone-net.jp> X-MXM-DELIVERY-TYPE: 3 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP EXDEV seems an appropriate error if an operation fails bacause it crosses file system boundaries. Signed-off-by: Kusanagi Kouichi --- 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 34772cb..0176045 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -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