mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
fs/ntfs3: prevent positive E_NTFS_NONRESIDENT from reaching writeback error handling
attr_data_write_resident() returns the internal positive status code E_NTFS_NONRESIDENT when the DATA attribute becomes non-resident. ntfs_writepages() propagates this value into generic writeback error handling, which expects a standard negative errno and triggers WARN_ON_ONCE(err > 0). Translate positive E_NTFS_* status codes to -EIO before recording the writeback error. This prevents positive internal status codes from reaching generic writeback code while preserving the existing behaviour of treating this path as a writeback error. Reported-by: syzbot+57f9327d593d301ce2a2@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=57f9327d593d301ce2a2 Signed-off-by: Vidhu Sarwal <vidhu.linux@gmail.com> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
This commit is contained in:
parent
86ba91170c
commit
2727ac2ba8
|
|
@ -1232,6 +1232,15 @@ static int ntfs_writepages(struct address_space *mapping,
|
|||
|
||||
folio_unlock(folio);
|
||||
if (err2) {
|
||||
/*
|
||||
* attr_data_write_resident() can return the
|
||||
* positive internal code E_NTFS_NONRESIDENT;
|
||||
* both mapping_set_error() and writeback_iter()
|
||||
* need a negative errno and warn on a positive
|
||||
* value.
|
||||
*/
|
||||
if (err2 > 0)
|
||||
err2 = -EIO;
|
||||
mapping_set_error(mapping, err2);
|
||||
if (!err)
|
||||
err = err2;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user