Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp5097745pxb; Tue, 28 Sep 2021 10:27:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbSxo1Cv2Nkm1CYm/Fdzej0H6ZbjmZ1RFjORMMZdL+N+WQjVkHu1bXxDsnd8MkV2juH6jT X-Received: by 2002:a17:90b:4c05:: with SMTP id na5mr1248722pjb.49.1632850054268; Tue, 28 Sep 2021 10:27:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632850054; cv=none; d=google.com; s=arc-20160816; b=LiqboaF1CyYu5BLFW9/jXHrRk3CTZKXtQ/ZGjMIep0m2l2r5q6nbd6C5HPZCBMgNYm tODqa92g/yr29reW6bwS+RmmRY0h1/e3h54wh2hl9k/moEPNEjjZKfP0A6RpDHTTLMuj 4w1GLgDLvQW+wTICZ8x2fFPCSCWIIoHVAWxkqDPriT4BxYlL+u2TAe11nEzIqKAR4nqu KNAXUDeziTGgwXspcnvp3b7tU4DtW65Zro1H/R96Y1dF9omE5WpqDMJrGNIfy0bjlrfZ CvfGKwgfahCrIPQI06wTkvRdj5dTty/S94qWKHCVBQemeqXYXM6UZF+THfq25Gd4Rh+t k3gQ== 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=qvcqL2FG70khkZ51nwyvBDfwfec88Co6gUQWcIUcQ84=; b=eMX7xhggOW7WN0TeJyphUjXknNHBitUCay4GvJggzaaJCAO4PdYSBlHp/1gRvZjWwc mfoIofghGpzMukmYRK60C07sK8D/Opv6y28qidDqiz66Pw8eDh+twYLdVcm8o9gMJmCu m9oETxNcesvh9JwTR7QooSSsWgTpw5aW1wTOR69BE0sBg5StncTVFKdjVKVYHyS1aBex O3ExHEO2UVvaBxx307p5/yuHzVZzEQndvplzPHVOcfibmoA5kncWbN2PII4x/ulPPZd4 9PpimDR5R5tWn05yvH0sFO53/lzxAaI/rg1HK3DQxVLSKaDgRar2X/Mz4PwjWLXr0Dl7 Vt/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=RocjXS3s; 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 ip9si4646543pjb.79.2021.09.28.10.27.19; Tue, 28 Sep 2021 10:27:34 -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=RocjXS3s; 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 S242044AbhI1R1l (ORCPT + 99 others); Tue, 28 Sep 2021 13:27:41 -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