summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2023-06-30 15:52:19 +0400
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2023-09-28 15:03:55 +0300
commit87d1888aa40f25773fa0b948bcb2545f97e2cb15 (patch)
tree8a9120a6749305877424c40d5fb598285eb99f48 /fs
parent0bb80ecc33a8fb5a682236443c1e740d5c917d1d (diff)
downloadlinux-stable-87d1888aa40f25773fa0b948bcb2545f97e2cb15.tar.gz
linux-stable-87d1888aa40f25773fa0b948bcb2545f97e2cb15.tar.bz2
linux-stable-87d1888aa40f25773fa0b948bcb2545f97e2cb15.zip
fs/ntfs3: Add ckeck in ni_update_parent()
Check simple case when parent inode equals current inode. Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/ntfs3/frecord.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
index 2b85cb10f0be..d49fbb22bd5e 100644
--- a/fs/ntfs3/frecord.c
+++ b/fs/ntfs3/frecord.c
@@ -3208,6 +3208,12 @@ static bool ni_update_parent(struct ntfs_inode *ni, struct NTFS_DUP_INFO *dup,
if (!fname || !memcmp(&fname->dup, dup, sizeof(fname->dup)))
continue;
+ /* Check simple case when parent inode equals current inode. */
+ if (ino_get(&fname->home) == ni->vfs_inode.i_ino) {
+ ntfs_set_state(sbi, NTFS_DIRTY_ERROR);
+ continue;
+ }
+
/* ntfs_iget5 may sleep. */
dir = ntfs_iget5(sb, &fname->home, NULL);
if (IS_ERR(dir)) {