From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8CAD6C433FE for ; Tue, 28 Sep 2021 17:26:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 72A546124A for ; Tue, 28 Sep 2021 17:26:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242070AbhI1R1m (ORCPT ); Tue, 28 Sep 2021 13:27:42 -0400 Received: from relaydlg-01.paragon-software.com ([81.5.88.159]:53587 "EHLO relaydlg-01.paragon-software.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229869AbhI1R1l (ORCPT ); Tue, 28 Sep 2021 13:27:41 -0400 Received: from dlg2.mail.paragon-software.com (vdlg-exch-02.paragon-software.com [172.30.1.105]) by relaydlg-01.paragon-software.com (Postfix) with ESMTPS id 70A3C821A0; Tue, 28 Sep 2021 20:26:00 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1632849960; bh=qvcqL2FG70khkZ51nwyvBDfwfec88Co6gUQWcIUcQ84=; h=Date:To:CC:From:Subject; b=RocjXS3sXc9QhKnzyvnkqougWUjdqK0HBXA12+MtidnZ+5ZluG+suzly50YZMmXVa uINnhryhIqCsN7nio8NiPJ0rvtx7/hL3jokl5Rki+iLcF8t/BAuHTOkfqxTQU145kp yyVKCxoTSkxRZ7H3Gef23Kx4igxHQWQTOecfyqZk= Received: from [192.168.211.85] (192.168.211.85) 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; Tue, 28 Sep 2021 20:25:59 +0300 Message-ID: Date: Tue, 28 Sep 2021 20:25:58 +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] 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.85] X-ClientProxiedBy: vdlg-exch-02.paragon-software.com (172.30.1.105) 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. Fixes xfstest generic/016 021 022 Signed-off-by: Konstantin Komarov --- fs/ntfs3/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c index 5fb3508e5422..02ca665baa5f 100644 --- a/fs/ntfs3/file.c +++ b/fs/ntfs3/file.c @@ -587,8 +587,8 @@ 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. */ + err = -EOPNOTSUPP; goto out; } -- 2.33.0