From patchwork Thu Nov 18 01:46:19 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 334741 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 oAI1v3Nw002629 for ; Thu, 18 Nov 2010 01:57:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754202Ab0KRB4U (ORCPT ); Wed, 17 Nov 2010 20:56:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:30508 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754180Ab0KRB4T (ORCPT ); Wed, 17 Nov 2010 20:56:19 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oAI1u6DD015976 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 17 Nov 2010 20:56:06 -0500 Received: from localhost.localdomain (test1244.test.redhat.com [10.10.10.244]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oAI1tt8n001522; Wed, 17 Nov 2010 20:56:00 -0500 From: Josef Bacik To: david@fromorbit.com, linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, cmm@us.ibm.com, cluster-devel@redhat.com, joel.becker@oracle.com, jack@suse.cz Subject: [PATCH 5/6] Btrfs: fail if we try to use hole punch Date: Wed, 17 Nov 2010 20:46:19 -0500 Message-Id: <1290044780-2902-6-git-send-email-josef@redhat.com> In-Reply-To: <1290044780-2902-1-git-send-email-josef@redhat.com> References: <1290044780-2902-1-git-send-email-josef@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 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.3 (demeter1.kernel.org [140.211.167.41]); Thu, 18 Nov 2010 01:57:03 +0000 (UTC) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 78877d7..6f08892 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -6936,6 +6936,10 @@ static long btrfs_fallocate(struct inode *inode, int mode, alloc_start = offset & ~mask; alloc_end = (offset + len + mask) & ~mask; + /* We only support the FALLOC_FL_KEEP_SIZE mode */ + if (mode && (mode != FALLOC_FL_KEEP_SIZE)) + return -EOPNOTSUPP; + /* * wait for ordered IO before we have any locks. We'll loop again * below with the locks held.