Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp103958pxb; Tue, 26 Oct 2021 22:30:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtKT1dQax8WpdbnnKtiWgXNgy7pvPduM4mR61G7rpYVWa5jL9xlao5ngcQ+rVv3VeMt1AY X-Received: by 2002:a17:90a:4e08:: with SMTP id n8mr3548455pjh.103.1635312629935; Tue, 26 Oct 2021 22:30:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635312629; cv=none; d=google.com; s=arc-20160816; b=Q5nkQFdyjcH+nXiKlk92cnfLh7JbolLyDbH7LPIBDJ14g9BYHjuEzjejoXwnO73w8H 7hVXKZPH6IShu25WqSJEQNiYeG2pcMxsi7ocweFNeAw5B35RTOo5uG1Ouzj2ak0MUj+4 9u9uufX9MDWie0c8hNa9VGT/oNIhfBsSlBtegFtfm11jqRK3uBIS7bR7LDw+m/TQbvb+ QuY1zv7U1GDz9OMcXRJhHonDUxzr59Jgp+iqsaN42SpOidor8TpXB6U99k/G6VPinjdh PwPQ+dcdh8eFx/kakwwzu5O1vuR2qgCBltKCOeaGmH4SG2KVt6v3J2g/6GSuxBfBB4E8 2Mbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=CbkycfBpiPzNz9mU9kLDzsxQuKQ9vzT3rMC0AKEjNkk=; b=0Fgxt230xQRtFVFbSLviHPgKQQDQxScWLE4PQUnuKejneC4EQ6et4j5Ogo1dVZkXM+ lDhDOs3SkimvWP3vvvAAHosrG0gRiDxWjN4K7rrzlqY2iYXk11KCxjpx+a5mfgLibWmN +A31z3MPoV3QN6hrhO6W2mz9qllekJyKKOQI50MAC9/66LDWm/hXW+iwqZ8OSi9J34P5 9/PGC+eMnP+lxoI0xCSuSwMG05CiqXsvQIPOd8RZIW35k7sc9TIxTNJdm4pTTvoiJ3d+ vmdAjmB3npUF2F9vxIiysIJ8VCjXbSXn5bAZSXRpc9qWxt4r1a4Ry3rJA61IIqA1w+6J 3vHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=PNi4bZGi; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h14si40647559plf.172.2021.10.26.22.30.16; Tue, 26 Oct 2021 22:30:29 -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=@gmail.com header.s=20210112 header.b=PNi4bZGi; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238158AbhJZSTu (ORCPT + 99 others); Tue, 26 Oct 2021 14:19:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232565AbhJZSTt (ORCPT ); Tue, 26 Oct 2021 14:19:49 -0400 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE5CAC061745; Tue, 26 Oct 2021 11:17:24 -0700 (PDT) Received: by mail-lj1-x232.google.com with SMTP id k13so251801ljj.12; Tue, 26 Oct 2021 11:17:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=CbkycfBpiPzNz9mU9kLDzsxQuKQ9vzT3rMC0AKEjNkk=; b=PNi4bZGi9qc5Fq5YyVp5QoxTeUJ4eSQu8LDldDiJBDWYN34lZPCOz3EeFMrhlenKim Fyy/EYZ293+ika4AtxlkXQ4GzvFfrza/RPydEgRtXmV4TDKYnDfTTNwVu3dO6vg5806s EtCO9NN7q75ENNFzuV/qwvS/iKLrwxNbWiQ5oVi2li3YdHqlqCNz+8JOJOdXR5b388D2 jM2OW+v/KALLxr5fUHrpIh+Qmujjg56HdN23B/SC5Wg1VLtwiXXwkFbmM+ZwQxL+UEgg DhZO89R+lM/raMYq2nvZ/vQiV9njZ1JzlsG2Y2xpwcnLfjky/Tj5iXNJhN0qBT6mYjWF 3PAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=CbkycfBpiPzNz9mU9kLDzsxQuKQ9vzT3rMC0AKEjNkk=; b=5HU5tsoIARgxcOwi/Gds7yaPNspllIB9F4PLmKUPMHGsGUlQQ1ttc23mIbX+LfTxYK lWwuQzGaCnIajAWiJ0getoDLb6auCIJYZv0EbyWQ5vP75QaDQGrMIYKp0ddikivG1KAz uQgTo8zTSGqcr9gXFH6q9RdhXLtdOV4Xdq7Ni1kEyNjvZDHEwobtJKjZLUmk7w1Ohmxd y3f/fnTfBiXmp1epomwbrNYpN18WEGVkOiAIvdWggEDfaD2ugUyIDwWVF7qnUSD3x4IC 9ZZcYz7hvnnpBPEatAV0LoyIXVqYRuFNIr8tgPO+hJ6q9b7g3hVRFSJmBbj30aGTU65+ /RhA== X-Gm-Message-State: AOAM532kvuUMhJOpunlJHz+LVvW+RX0aeFmXeBGjTjBMZoi1yqon4ZGe O2OiDNKEyWS/s59azo4Dsqk= X-Received: by 2002:a05:651c:617:: with SMTP id k23mr27312236lje.402.1635272243035; Tue, 26 Oct 2021 11:17:23 -0700 (PDT) Received: from kari-VirtualBox ([31.132.12.44]) by smtp.gmail.com with ESMTPSA id g18sm46711ljl.26.2021.10.26.11.17.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 11:17:22 -0700 (PDT) Date: Tue, 26 Oct 2021 21:17:20 +0300 From: Kari Argillander To: Konstantin Komarov Cc: ntfs3@lists.linux.dev, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Ganapathi Kamath Subject: Re: [PATCH 1/4] fs/ntfs3: Keep preallocated only if option prealloc enabled Message-ID: <20211026181720.46jaw46hn2vwtqgk@kari-VirtualBox> References: <19b0fc31-a28f-69aa-27dc-e6514a10643e@paragon-software.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <19b0fc31-a28f-69aa-27dc-e6514a10643e@paragon-software.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 26, 2021 at 07:40:57PM +0300, Konstantin Komarov wrote: > If size of file was reduced, we still kept allocated blocks. > This commit makes ntfs3 work as other fs like btrfs. > Link: https://bugzilla.kernel.org/show_bug.cgi?id=214719 > Fixes: 4342306f0f0d ("fs/ntfs3: Add file operations and implementation") > > Reported-by: Ganapathi Kamath > Tested-by: Ganapathi Kamath > Signed-off-by: Konstantin Komarov Reviewed-by: Kari Argillander > --- > fs/ntfs3/file.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c > index 43b1451bff53..3ac0482c6880 100644 > --- a/fs/ntfs3/file.c > +++ b/fs/ntfs3/file.c > @@ -494,7 +494,7 @@ static int ntfs_truncate(struct inode *inode, loff_t new_size) > > down_write(&ni->file.run_lock); > err = attr_set_size(ni, ATTR_DATA, NULL, 0, &ni->file.run, new_size, > - &new_valid, true, NULL); > + &new_valid, ni->mi.sbi->options->prealloc, NULL); > up_write(&ni->file.run_lock); > > if (new_valid < ni->i_valid) > -- > 2.33.0 > >