From patchwork Mon Nov 16 12:04:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 7624501 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5EE25BF90C for ; Mon, 16 Nov 2015 12:04:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5DC37205B6 for ; Mon, 16 Nov 2015 12:04:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D964C205B8 for ; Mon, 16 Nov 2015 12:04:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751562AbbKPMEd (ORCPT ); Mon, 16 Nov 2015 07:04:33 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:49140 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751223AbbKPMEd (ORCPT ); Mon, 16 Nov 2015 07:04:33 -0500 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZyIWN-0005hm-32; Mon, 16 Nov 2015 12:04:31 +0000 Date: Mon, 16 Nov 2015 04:04:31 -0800 From: Christoph Hellwig To: darrick.wong@oracle.com, xfs@oss.sgi.com, linux-fsdevel@vger.kernel.org Subject: clone ioctl return values Message-ID: <20151116120431.GA2860@infradead.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Hi Darrick, your new generic/157 xfs test brings up an interesting issue: error returns forthe various clone failure cases. It seems like this case was written fo the XFS case which differs a lot from the error chosen by btrfs and mostly followed by NFS. I'd say it might be a better idea to follow the btrfs example as the btrfs ioctls have been in use for a while. The only shortcoming I see in btrfs is that id doesn't explicitly check for non-directory, non-regular file items as the source. I have to admit I'm kinda surprised that it doesn't blow up, given that NFS instantly did when I removed those checks. FYI, output from the test on btrfs below: --- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- tests/generic/157.out 2015-11-14 07:56:31.000000000 +0000 +++ /root/xfstests/results//generic/157.out.bad 2015-11-16 11:58:52.879078894 +0000 @@ -2,24 +2,24 @@ Format and mount Create the original files Try cross-device reflink -XFS_IOC_CLONE_RANGE: Invalid cross-device link +reflink: Invalid cross-device link Try unaligned reflink -XFS_IOC_CLONE_RANGE: Invalid argument +reflink: Invalid argument Try overlapping reflink -XFS_IOC_CLONE_RANGE: Invalid argument +reflink: Invalid argument Try reflink past EOF -XFS_IOC_CLONE_RANGE: Invalid argument +reflink: Invalid argument Try to reflink a dir -XFS_IOC_CLONE_RANGE: Is a directory +reflink: Is a directory Try to reflink a device -XFS_IOC_CLONE_RANGE: Invalid argument +/mnt/test/test-157/dev1: No such device or address Try to reflink to a dir -/mnt/test-157/dir1: Is a directory +/mnt/test/test-157/dir1: Is a directory Try to reflink to a device -XFS_IOC_CLONE_RANGE: Operation not supported +/mnt/test/test-157/dev1: No such device or address Try to reflink to a fifo -XFS_IOC_CLONE_RANGE: Operation not supported +reflink: Inappropriate ioctl for device Try to reflink an append-only file -XFS_IOC_CLONE_RANGE: Bad file descriptor +reflink: Invalid argument Reflink two files Check scratch fs