Message ID | 3fbcb5a7-2b6f-44ae-8355-06461e7a1447@paragon-software.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp4171295vqy; Wed, 6 Dec 2023 07:13:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IEXv3buJTR7D6GTR56ya3shRa28GJI1pUKpVUIHKomo5aT0vGg82dHAmXgvSl814DrY60YR X-Received: by 2002:a05:6a00:23c1:b0:6ce:2731:e86b with SMTP id g1-20020a056a0023c100b006ce2731e86bmr1269516pfc.50.1701875586565; Wed, 06 Dec 2023 07:13:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701875586; cv=none; d=google.com; s=arc-20160816; b=iRU3R/lN/8DbDeKBEPPp1aIdDATOfA051EVlUBwmKG3WmXYjfSna/r/mzfiuYTpH64 mPuFGwPqVS5gBBL0bA8BNJ4XsvVW7Hl5cqKdMa4PACZbGuQLtLpwXhEH7A93SoP4gEZ0 B80/Ra/sPF3nwUHlZp1KIA78PiLwZ/PdQ0RNid98LefOEzkJGWgSMSHV32gkbkOR7QsI fBasRQFqcMb/mGReL2sGVEO6XcrafmQfalVOwdcueeyo7Ly+hvxyFYFB7ZaZK2qFbny+ qTTyZXrCRYdwWmM5vA30iJ9NBikKz1iwGK8GM/4ZQ86pdVvAHwXAUBVNzokwqbEEwgag 9xSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=5WNxqIEiVf5xBesOyM4G/OuoGM3roOgonpEjUNzMoQc=; fh=P7I85FIabZcM8ojWdeG8ABpTZepe/Xtte9jKWDfUHBM=; b=bedM47Fs0FggHfNtGQXFxT6rHvq48svoJGZcujGWpIyb7/Aez787YJ5zZ5tmYc+sZB q/DIPFrsA14ffK8ItpzuQQ+Eb+qe6HpgpXZ9M140p5VCFGIDxrzDgXd0bYmTeFdxxTN0 S8DvW+xNMLoCv+MsgnsYbEi9U1thItbfhhzD+DUTF0hN1fBm6bw+jGJ1CvbSEJloxOtI PMWT9u9PTaL+fMhmlkd9EDyRkmbHCmvvGC+oLtO+7aJ40DuqgMJH2hmUYfTZ51Pqd+EQ PBO7mnRcuroptJjfTqsAJh7HdA3j/nJ9RjSTcR16UuakaRnqASCc6RYc5OIH+t9wpxhZ e8Rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=SKOa+CHd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id fc12-20020a056a002e0c00b006ce56664fd5si87348pfb.157.2023.12.06.07.13.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 07:13:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=SKOa+CHd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 6D185826EEA0; Wed, 6 Dec 2023 07:13:04 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442399AbjLFPMz (ORCPT <rfc822;pusanteemu@gmail.com> + 99 others); Wed, 6 Dec 2023 10:12:55 -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 <rfc822;linux-kernel@vger.kernel.org>); 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 <almaz.alexandrovich@paragon-software.com> To: <ntfs3@lists.linux.dev> CC: <linux-kernel@vger.kernel.org>, <linux-fsdevel@vger.kernel.org> 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: 8bit 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) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 06 Dec 2023 07:13:04 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784545894668524750 X-GMAIL-MSGID: 1784545894668524750 |
Series |
fs/ntfs3: Bugfix and refactoring
|
|
Commit Message
Konstantin Komarov
Dec. 6, 2023, 3:12 p.m. UTC
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
---
fs/ntfs3/file.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
filemap_invalidate_unlock(mapping);
@@ -1040,6 +1046,7 @@ static ssize_t ntfs_file_write_iter(struct kiocb
*iocb, struct iov_iter *from)
struct address_space *mapping = file->f_mapping;
struct inode *inode = mapping->host;
ssize_t ret;
+ int err;
struct ntfs_inode *ni = ntfs_i(inode);
if (is_encrypted(ni)) {
@@ -1067,6 +1074,12 @@ static ssize_t ntfs_file_write_iter(struct kiocb
*iocb, struct iov_iter *from)
if (ret <= 0)
goto out;
+ err = file_modified(iocb->ki_filp);
+ if (err) {
+ ret = err;
+ goto out;
+ }
+
if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) {
/* Should never be here, see ntfs_file_open(). */
ret = -EOPNOTSUPP;
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 mode, loff_t vbo, loff_t len) &ni->file.run, i_size, &ni->i_valid, true, NULL); ni_unlock(ni); + if (err) + goto out; } else if (new_size > i_size) { inode->i_size = new_size; } } + err = file_modified(file); + if (err) + goto out; + out: if (map_locked)