Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp789153pxb; Wed, 29 Sep 2021 09:40:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfxyvlaOMXR0AtJkFsYin+xG5x3ozC2r7tVqJAXpaJtlrIBRwxrS+ZTY8IzUfTOBGX/VwP X-Received: by 2002:a17:90a:d686:: with SMTP id x6mr887115pju.227.1632933624801; Wed, 29 Sep 2021 09:40:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632933624; cv=none; d=google.com; s=arc-20160816; b=JufMhouU0iZP5k990U8D5jyAGz+wb7zJfB46F+UxtL+0F4VEttamaHU74w3HM3JBe6 brPndVQ96rGtb+pj5gCghnflZk7KW+8qZhzsSRbbZjROOVvsO+7Wla7ttYCfHnCmzZiW ExAk1IhrXHJlnbbFr2O0sfI8HfBLC7MJEyyo1ZtPWQlyzqHNSWcIKxuSHTYKfere9Oyh UQeAFNeQcrlGx1D+ebVtlZpUXz0Mkx6qW7JDQ/g8xHoeGGWr31q8l4eVT/CgdsYnhRi4 APeiDwZTyFdvSmwBeNYh3kTNUs4O1wJwaHG38/m7/OvbccABiY8A1gxhBCe47JjXgztA Nt+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:subject:from:cc:to :content-language:user-agent:mime-version:date:message-id :dkim-signature; bh=MOpyRoXmge+JfHU9g9lKQjhfkbKwMhFfVOywlLhqglg=; b=l0KOZcpVcNbd+KMlgx0LXWMU5tkdLKmNO+neWjPfB/oAEBzQtRx13blfdU2/pdxURI G7pdYq4n+RSUMpsfUPamEvJr5tvUq66Eio6tV+WpAJkdE7mc6IZErtz7qttiYcHVzyQe khE17R1aJW57mUXdhvpn1Af/C1rRpAq3rwfmHJYYKJmQuRW9+KXBhhEWmHkouDfYSm9E xhr0/2QAwM3vGaFDHqYVNvLrH55YezT9m/yEkULDwVrQX8HtJT6ub7RD9OX957p0G6gY J4lVLrduBzxDDfWWn86yoMIFum4KpV+3QiaYKfETnA9cfk5Us6ftzln/Sg0Rn7Q9zyPA N2WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=NHuYb3m3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=paragon-software.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z25si298601pfg.336.2021.09.29.09.40.10; Wed, 29 Sep 2021 09:40:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=NHuYb3m3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=paragon-software.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345970AbhI2QkM (ORCPT + 99 others); Wed, 29 Sep 2021 12:40:12 -0400 Received: from relayfre-01.paragon-software.com ([176.12.100.13]:54762 "EHLO relayfre-01.paragon-software.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344376AbhI2QkL (ORCPT ); Wed, 29 Sep 2021 12:40:11 -0400 Received: from dlg2.mail.paragon-software.com (vdlg-exch-02.paragon-software.com [172.30.1.105]) by relayfre-01.paragon-software.com (Postfix) with ESMTPS id 76B81439; Wed, 29 Sep 2021 19:38:29 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1632933509; bh=MOpyRoXmge+JfHU9g9lKQjhfkbKwMhFfVOywlLhqglg=; h=Date:To:CC:From:Subject; b=NHuYb3m3ZCD9OoE1y2sc/3H5FC9wv6WcXGBNrq3nJaxJEPgzAe2ZjAyp3Gc7TnrN2 Ke1BXY6cRvhzmUYnhZfxj1zf/DUa3u86m52D+tyWYrhtR9uYZ6Bbw2Sn6vjDeo1CjK zNT/Cat4fJMwR2gqxqFKqrAajRuHL5f0w4bAXQLc= Received: from [192.168.211.131] (192.168.211.131) by vdlg-exch-02.paragon-software.com (172.30.1.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 29 Sep 2021 19:38:29 +0300 Message-ID: Date: Wed, 29 Sep 2021 19:38:28 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.1 Content-Language: en-US To: CC: , From: Konstantin Komarov Subject: [PATCH v2] fs/ntfs3: Forbid FALLOC_FL_PUNCH_HOLE for normal files Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.211.131] X-ClientProxiedBy: vobn-exch-01.paragon-software.com (172.30.72.13) To vdlg-exch-02.paragon-software.com (172.30.1.105) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org FALLOC_FL_PUNCH_HOLE isn't allowed with normal files. Filesystem must remember info about hole, but for normal file we can only zero it and forget. Fixes: 4342306f0f0d ("fs/ntfs3: Add file operations and implementation") Now xfstests generic/016 generic/021 generic/022 pass. Signed-off-by: Konstantin Komarov --- fs/ntfs3/file.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c index 5fb3508e5422..43b1451bff53 100644 --- a/fs/ntfs3/file.c +++ b/fs/ntfs3/file.c @@ -587,8 +587,11 @@ static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len) truncate_pagecache(inode, vbo_down); if (!is_sparsed(ni) && !is_compressed(ni)) { - /* Normal file. */ - err = ntfs_zero_range(inode, vbo, end); + /* + * Normal file, can't make hole. + * TODO: Try to find way to save info about hole. + */ + err = -EOPNOTSUPP; goto out; } -- 2.33.0