Commit 4ab25ac8 authored by Richard Weinberger's avatar Richard Weinberger

ubifs: Fix ubifs_tnc_lookup() usage in do_kill_orphans()

Orphans are allowed to point to deleted inodes.
So -ENOENT is not a fatal error.
Reported-by: default avatarКочетков Максим <fido_max@inbox.ru>
Reported-and-tested-by: default avatar"Christian Berger" <Christian.Berger@de.bosch.com>
Tested-by: default avatarKarl Olsen <karl@micro-technic.com>
Tested-by: default avatarJef Driesen <jef.driesen@niko.eu>
Fixes: ee1438ce ("ubifs: Check link count of inodes when killing orphans.")
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent 16fbf79b
......@@ -688,14 +688,14 @@ static int do_kill_orphans(struct ubifs_info *c, struct ubifs_scan_leb *sleb,
ino_key_init(c, &key1, inum);
err = ubifs_tnc_lookup(c, &key1, ino);
if (err)
if (err && err != -ENOENT)
goto out_free;
/*
* Check whether an inode can really get deleted.
* linkat() with O_TMPFILE allows rebirth of an inode.
*/
if (ino->nlink == 0) {
if (err == 0 && ino->nlink == 0) {
dbg_rcvry("deleting orphaned inode %lu",
(unsigned long)inum);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment