From nobody Fri Sep 12 00:29:40 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1CCBC10DC1 for ; Wed, 6 Dec 2023 15:13:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442465AbjLFPM4 (ORCPT ); Wed, 6 Dec 2023 10:12:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379090AbjLFPMy (ORCPT ); Wed, 6 Dec 2023 10:12:54 -0500 Received: from relayaws-01.paragon-software.com (relayaws-01.paragon-software.com [35.157.23.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BAA0D44; Wed, 6 Dec 2023 07:13:00 -0800 (PST) Received: from dlg2.mail.paragon-software.com (vdlg-exch-02.paragon-software.com [172.30.1.105]) by relayaws-01.paragon-software.com (Postfix) with ESMTPS id 346BF1E1A; Wed, 6 Dec 2023 15:06:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1701875194; bh=5WNxqIEiVf5xBesOyM4G/OuoGM3roOgonpEjUNzMoQc=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=SKOa+CHdhTDrT3JdA0I4GHvBuQyY1T0VvV9P7kGKydPxnb9m3t+8rtPN4g79s6Lwt nT3xoGGzTdH0XsfnMSCfZnc21q3dm8plyc7QvNSfcNOYeCRijRrabXr/Meqx8jTC9w xi4LFnvnnREfe4Bd80iBXzJ2WaMh/hFMKhNHYV+w= Received: from [172.16.192.129] (192.168.211.144) 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.2375.7; Wed, 6 Dec 2023 18:12:58 +0300 Message-ID: <3fbcb5a7-2b6f-44ae-8355-06461e7a1447@paragon-software.com> Date: Wed, 6 Dec 2023 18:12:58 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 10/16] fs/ntfs3: Add file_modified Content-Language: en-US From: Konstantin Komarovc To: CC: , References: <00fd1558-fda5-421b-be43-7de69e32cb4e@paragon-software.com> In-Reply-To: <00fd1558-fda5-421b-be43-7de69e32cb4e@paragon-software.com> Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [192.168.211.144] 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 Signed-off-by: Konstantin Komarov --- =C2=A0fs/ntfs3/file.c | 13 +++++++++++++ =C2=A01 file changed, 13 insertions(+) diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c index 5691f04e6751..bb80ce2eec2f 100644 --- a/fs/ntfs3/file.c +++ b/fs/ntfs3/file.c @@ -632,11 +632,17 @@ static long ntfs_fallocate(struct file *file, int=20 mode, loff_t vbo, loff_t len) =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 &ni->file.run, i_size, &ni-= >i_valid, =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 true, NULL); =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0ni_unlock(n= i); +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0if (err) +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2= =A0goto out; =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0} else if (new_size > i_size) { =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0inode->i_si= ze =3D new_size; =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0} =C2=A0=C2=A0=C2=A0 =C2=A0} +=C2=A0=C2=A0 =C2=A0err =3D file_modified(file); +=C2=A0=C2=A0 =C2=A0if (err) +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0goto out; + =C2=A0out: =C2=A0=C2=A0=C2=A0 =C2=A0if (map_locked) =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0filemap_invalidate_unlock(mapp= ing); @@ -1040,6 +1046,7 @@ static ssize_t ntfs_file_write_iter(struct kiocb=20 *iocb, struct iov_iter *from) =C2=A0=C2=A0=C2=A0 =C2=A0struct address_space *mapping =3D file->f_mapping; =C2=A0=C2=A0=C2=A0 =C2=A0struct inode *inode =3D mapping->host; =C2=A0=C2=A0=C2=A0 =C2=A0ssize_t ret; +=C2=A0=C2=A0 =C2=A0int err; =C2=A0=C2=A0=C2=A0 =C2=A0struct ntfs_inode *ni =3D ntfs_i(inode); =C2=A0=C2=A0=C2=A0 =C2=A0if (is_encrypted(ni)) { @@ -1067,6 +1074,12 @@ static ssize_t ntfs_file_write_iter(struct kiocb=20 *iocb, struct iov_iter *from) =C2=A0=C2=A0=C2=A0 =C2=A0if (ret <=3D 0) =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0goto out; +=C2=A0=C2=A0 =C2=A0err =3D file_modified(iocb->ki_filp); +=C2=A0=C2=A0 =C2=A0if (err) { +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0ret =3D err; +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0goto out; +=C2=A0=C2=A0 =C2=A0} + =C2=A0=C2=A0=C2=A0 =C2=A0if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MAS= K)) { =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0/* Should never be here, see n= tfs_file_open(). */ =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0ret =3D -EOPNOTSUPP; --=20 2.34.1