[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200501131543.592652133@linuxfoundation.org>
Date: Fri, 1 May 2020 15:22:34 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org,
Кочетков Максим
<fido_max@...ox.ru>, Karl Olsen <karl@...ro-technic.com>,
Jef Driesen <jef.driesen@...o.eu>,
Richard Weinberger <richard@....at>,
Christian Eggers <ceggers@...i.de>,
"Christian Berger" <Christian.Berger@...bosch.com>
Subject: [PATCH 5.6 001/106] ubifs: Fix ubifs_tnc_lookup() usage in do_kill_orphans()
From: Richard Weinberger <richard@....at>
commit 4ab25ac8b2b5514151d5f91cf9514df08dd26938 upstream.
Orphans are allowed to point to deleted inodes.
So -ENOENT is not a fatal error.
Reported-by: Кочетков Максим <fido_max@...ox.ru>
Reported-and-tested-by: "Christian Berger" <Christian.Berger@...bosch.com>
Tested-by: Karl Olsen <karl@...ro-technic.com>
Tested-by: Jef Driesen <jef.driesen@...o.eu>
Fixes: ee1438ce5dc4 ("ubifs: Check link count of inodes when killing orphans.")
Signed-off-by: Richard Weinberger <richard@....at>
Cc: Christian Eggers <ceggers@...i.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
fs/ubifs/orphan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/fs/ubifs/orphan.c
+++ b/fs/ubifs/orphan.c
@@ -688,14 +688,14 @@ static int do_kill_orphans(struct ubifs_
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);
Powered by blists - more mailing lists