diff options
| author | Yue Yang <xkeyc@qq.com> | 2026-11-13 11:26:15 +0800 |
|---|---|---|
| committer | Namjae Jeon <linkinjeon@kernel.org> | 2026-11-21 21:05:19 +0900 |
| commit | 136760737a7659518e5aaa17b2630246ad0b7f33 (patch) | |
| tree | bcaa87436883fec6f07728526defc755a18a9219 /tools/lib/python | |
| parent | ae6985a0d20d1621feed98b89903944513a221e1 (diff) | |
ntfs: don't let a fatal signal interrupt metadata reads
read_mapping_folio() returns -EINTR when the caller has a fatal signal
pending while it waits for the read it submitted. ntfs reads its metadata
through it and treats the failure as a volume error, so killing a task
that waits on a metadata read turns the volume read-only with
errors=remount-ro. A read that is part of an update also stops the update
half way: killing an rm can leave clusters allocated in $Bitmap, an MFT
record in use without a directory entry, or a directory index with
entries that point to freed records. Killing a mount makes it fail with
bogus $AttrDef and $UpCase errors, or leaves the volume mounted read-only
with a bogus $MFTMirr or $BadClus error.
Add ntfs_read_metadata_folio(), which waits for the read uninterruptibly,
and use it for metadata reads. Named stream contents, compressed data and
the read-only bitmap scans through ntfs_get_locked_folio(), whose callers
do not report a volume error, keep using read_mapping_folio(). A named
stream write that is interrupted that way no longer reports a volume
error either. A killed task now waits for its metadata read to complete,
as it does on filesystems that use the buffer cache.
Closes: https://github.com/namjaejeon/linux-ntfs/issues/98
Fixes: 11ccc9107dc4 ("ntfs: update runlist handling and cluster allocator")
Fixes: 115380f9a2f9 ("ntfs: update mft operations")
Fixes: af0db57d4293 ("ntfs: update inode operations")
Fixes: 495e90fa3348 ("ntfs: update attrib operations")
Fixes: 0a8ac0c1fa0b ("ntfs: update directory operations")
Fixes: 5218cd102aec ("ntfs: update misc operations")
Fixes: 6251f0b0de7d ("ntfs: update super block operations")
Fixes: 8506a8031ebf ("ntfs: validate and reserve bad clusters at mount")
Cc: stable@vger.kernel.org
Signed-off-by: Yue Yang <xkeyc@qq.com>
Reviewed-by: Baolin Liu <liubaolin@kylinos.cn>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
