mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Xuewen Wang <wangxuewen_ky@163.com>
To: linkinjeon@kernel.org, hyc.lee@gmail.com, liubaolin12138@163.com
Cc: ntfs@lists.linux.dev, linux-kernel@vger.kernel.org,
	Xuewen Wang <wangxuewen@kylinos.cn>,
	Baolin Liu <liubaolin@kylinos.cn>
Subject: [PATCH v6 08/37] ntfs: preserve buffered fallback writeback errors
Date: Wed, 18 Nov 2026 17:06:32 +0800	[thread overview]
Message-ID: <20261118090701.1858849-9-wangxuewen_ky@163.com> (raw)
In-Reply-To: <20261118090701.1858849-1-wangxuewen_ky@163.com>

From: Xuewen Wang <wangxuewen@kylinos.cn>

The buffered fallback of a direct write waits for writeback before
invalidating the written pages. It replaces any writeback failure with EIO,
discarding more specific errors such as ENOMEM.

Return the error from filemap_write_and_wait_range() through the existing
cleanup path.

Reviewed-by: Baolin Liu <liubaolin@kylinos.cn>
Signed-off-by: Xuewen Wang <wangxuewen@kylinos.cn>
---
Changes in v6:
Extract buffered-fallback writeback errno propagation from v5 patch 23.

Validation:
- Compiled and linked the NTFS module object with W=1 at this stage.
- No undefined references to ntfs_report_* or fserror_report_*.

 fs/ntfs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c
index 55c48d174b28..b1c6a84bf955 100644
--- a/fs/ntfs/file.c
+++ b/fs/ntfs/file.c
@@ -805,7 +805,7 @@ static ssize_t ntfs_dio_write_iter(struct kiocb *iocb, struct iov_iter *from)
 		ret2 = filemap_write_and_wait_range(iocb->ki_filp->f_mapping,
 				offset, end);
 		if (ret2) {
-			ret = -EIO;
+			ret = ret2;
 			goto out;
 		}
 		invalidate_mapping_pages(iocb->ki_filp->f_mapping,
-- 
2.51.0


  parent reply	other threads:[~2026-11-18  9:09 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18  9:06 [PATCH v6 00/37] Report NTFS metadata errors and shutdown through FAN_FS_ERROR Xuewen Wang
2026-11-18  9:06 ` [PATCH v6 01/37] ntfs: propagate mapping-pairs update errors from inode writeback Xuewen Wang
2026-11-21 14:08   ` Namjae Jeon
2026-11-18  9:06 ` [PATCH v6 02/37] ntfs: preserve cluster-free counts in attribute cleanup Xuewen Wang
2026-11-22 10:48   ` Namjae Jeon
2026-11-18  9:06 ` [PATCH v6 03/37] ntfs: handle source record removal failure during attribute moves Xuewen Wang
2026-11-21 14:08   ` Namjae Jeon
2026-11-18  9:06 ` [PATCH v6 04/37] ntfs: preserve attribute search context initialization errors Xuewen Wang
2026-11-22 10:51   ` Namjae Jeon
2026-11-18  9:06 ` [PATCH v6 05/37] ntfs: preserve synchronous buffered read errors Xuewen Wang
2026-11-18  9:06 ` [PATCH v6 06/37] ntfs: preserve compressed I/O preparation errors Xuewen Wang
2026-11-18  9:06 ` [PATCH v6 07/37] ntfs: retain directory iteration state after errors Xuewen Wang
2026-11-18  9:06 ` Xuewen Wang [this message]
2026-11-21 14:09   ` [PATCH v6 08/37] ntfs: preserve buffered fallback writeback errors Namjae Jeon
2026-11-18  9:06 ` [PATCH v6 09/37] ntfs: serialize export parent reconstruction Xuewen Wang
2026-11-22 11:18   ` Namjae Jeon
2026-11-18  9:06 ` [PATCH v6 10/37] ntfs: add filesystem metadata error reporting helpers Xuewen Wang
2026-11-18  9:06 ` [PATCH v6 11/37] ntfs: report boot geometry and MFT bootstrap errors Xuewen Wang
2026-11-18  9:06 ` [PATCH v6 12/37] ntfs: report required system file and volume metadata errors Xuewen Wang
2026-11-18  9:06 ` [PATCH v6 13/37] ntfs: report logfile metadata and emptying errors Xuewen Wang
2026-11-18  9:06 ` [PATCH v6 14/37] ntfs: report runlist and cluster allocation metadata errors Xuewen Wang
2026-11-18  9:06 ` [PATCH v6 15/37] ntfs: report iomap metadata corruption Xuewen Wang
2026-11-18  9:06 ` [PATCH v6 16/37] ntfs: report LZNT1 and WOF compressed stream errors Xuewen Wang
2026-11-18  9:06 ` [PATCH v6 17/37] ntfs: report attribute lookup and validation errors Xuewen Wang
2026-11-18  9:06 ` [PATCH v6 18/37] ntfs: report attribute record update and cleanup failures Xuewen Wang
2026-11-18  9:06 ` [PATCH v6 19/37] ntfs: report attribute list update and recovery failures Xuewen Wang
2026-11-18  9:06 ` [PATCH v6 20/37] ntfs: report attribute conversion and mapping update failures Xuewen Wang
2026-11-18  9:06 ` [PATCH v6 21/37] ntfs: report attribute resize and relocation recovery failures Xuewen Wang
2026-11-18  9:06 ` [PATCH v6 22/37] ntfs: report incomplete attribute range updates Xuewen Wang
2026-11-18  9:06 ` [PATCH v6 23/37] ntfs: report inode metadata and eviction cleanup errors Xuewen Wang
2026-11-18  9:06 ` [PATCH v6 24/37] ntfs: report index validation and block I/O errors Xuewen Wang
2026-11-18  9:06 ` [PATCH v6 25/37] ntfs: preserve and report index traversal errors Xuewen Wang
2026-11-18  9:06 ` [PATCH v6 26/37] ntfs: report directory lookup and metadata corruption Xuewen Wang
2026-11-18  9:06 ` [PATCH v6 27/37] ntfs: report index update and recovery failures Xuewen Wang
2026-11-18  9:06 ` [PATCH v6 28/37] ntfs: report namespace and file recovery errors Xuewen Wang
2026-11-18  9:06 ` [PATCH v6 29/37] ntfs: report export parent reconstruction errors Xuewen Wang
2026-11-18  9:06 ` [PATCH v6 30/37] ntfs: report MFT record validation and lifecycle errors Xuewen Wang
2026-11-18  9:06 ` [PATCH v6 31/37] ntfs: report MFT bitmap and data growth recovery failures Xuewen Wang
2026-11-18  9:06 ` [PATCH v6 32/37] ntfs: report MFT writeback errors to fsnotify Xuewen Wang
2026-11-18  9:06 ` [PATCH v6 33/37] ntfs: report EA metadata and restoration errors Xuewen Wang
2026-11-18  9:06 ` [PATCH v6 34/37] ntfs: report named stream metadata and recovery errors Xuewen Wang
2026-11-18  9:06 ` [PATCH v6 35/37] ntfs: report reparse and object ID metadata errors Xuewen Wang
2026-11-18  9:07 ` [PATCH v6 36/37] ntfs: report each shutdown transition once Xuewen Wang
2026-11-18  9:07 ` [PATCH v6 37/37] ntfs: report attribute move removal and cleanup failures Xuewen Wang
2026-11-18  9:21 ` [PATCH v6 00/37] Report NTFS metadata errors and shutdown through FAN_FS_ERROR wangxuewen
2026-11-19  1:49   ` Hyunchul Lee
2026-11-19  2:32     ` wangxuewen
2026-11-19  2:36     ` Xuewen Wang
2026-11-18  9:33 ` liubaolin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261118090701.1858849-9-wangxuewen_ky@163.com \
    --to=wangxuewen_ky@163.com \
    --cc=hyc.lee@gmail.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liubaolin12138@163.com \
    --cc=liubaolin@kylinos.cn \
    --cc=ntfs@lists.linux.dev \
    --cc=wangxuewen@kylinos.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®