From patchwork Fri Oct 25 02:36:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 11211235 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 13E6B139A for ; Fri, 25 Oct 2019 02:36:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DD65121D7B for ; Fri, 25 Oct 2019 02:36:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="km0f3+4t" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390168AbfJYCga (ORCPT ); Thu, 24 Oct 2019 22:36:30 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:41344 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728416AbfJYCga (ORCPT ); Thu, 24 Oct 2019 22:36:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender: Reply-To:Cc:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=3kikTJ9SvjuYwD0CKdDNcEF71ucz9PsOK2rZyOULu/U=; b=km0f3+4tfwOBlKYVbYV5Cr800 wt98OkAP6v/qxYrRuD6Xp5T/UMM5E+8HSgMKP+/eJXYDwGIC+vmeMF0bra7nY7tyregLmyILIpMZP mWkbI3/mBMivcfd6fZazljY83JzVQps46XxNdQyj5nxvDz2D2LJX0nrZgY1SNN5ArcAURVN7AZJdg Ceh0ItY7z8+teqBOQWeooxSlmyBEToLGkwJF1CDKvgWItzGXcayYrwJPOUH4x4tJejviShyhvl5IU Jlgxyl627+V6Oa19n27WeGHRoZAgCPxrJgnf6xKVpU0gaD0GhiKIgtV4V8j1ZWgwHKA8Sq8+ngAWX LSmCfQq1Q==; Received: from p91006-ipngnfx01marunouchi.tokyo.ocn.ne.jp ([153.156.43.6] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iNpSn-0003em-6G; Fri, 25 Oct 2019 02:36:30 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 3/4] xfs: disable xfs_ioc_space for always COW inodes Date: Fri, 25 Oct 2019 11:36:08 +0900 Message-Id: <20191025023609.22295-4-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025023609.22295-1-hch@lst.de> References: <20191025023609.22295-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org If we always have to write out of place preallocating blocks is pointless. We already check for this in the normal falloc path, but the check was missig in the legacy ALLOCSP path. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- fs/xfs/xfs_ioctl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 3fe1543f9f02..552034325991 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -33,6 +33,7 @@ #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_health.h" +#include "xfs_reflink.h" #include #include @@ -606,6 +607,9 @@ xfs_ioc_space( if (!S_ISREG(inode->i_mode)) return -EINVAL; + if (xfs_is_always_cow_inode(ip)) + return -EOPNOTSUPP; + if (filp->f_flags & O_DSYNC) flags |= XFS_PREALLOC_SYNC; if (filp->f_mode & FMODE_NOCMTIME)