mirror of
https://github.com/torvalds/linux.git
synced 2026-09-11 20:13:02 +02:00
ntfs: propagate reparse index insertion failure
update_reparse_data() ignores the return value of
set_reparse_index(). When index insertion fails, the code removes
the just-written reparse data as cleanup but still returns 0, so
symlink(2) (and WSL special file creation) reports success while
no reparse data exists on disk. When there was no previous reparse
data (oldsize == 0), the failure was likewise silently ignored.
Propagate the error to the caller.
Fixes: fc053f05ca ("ntfs: add reparse and ea operations")
Signed-off-by: Baolin Liu <liubaolin@kylinos.cn>
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
This commit is contained in:
parent
3d3de2aee1
commit
9692b1b4fc
|
|
@ -694,8 +694,9 @@ static int update_reparse_data(struct ntfs_inode *ni, struct ntfs_index_context
|
|||
goto put_rp_inode;
|
||||
}
|
||||
|
||||
if (set_reparse_index(ni, xr, ((const struct reparse_point *)value)->reparse_tag) &&
|
||||
oldsize > 0) {
|
||||
err = set_reparse_index(ni, xr,
|
||||
((const struct reparse_point *)value)->reparse_tag);
|
||||
if (err && oldsize > 0) {
|
||||
/*
|
||||
* If cannot index, try to remove the reparse
|
||||
* data and log the error. There will be an
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user