mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: stable <stable@vger.kernel.org>
Cc: linux-mtd <linux-mtd@lists.infradead.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	John Ogness <john.ogness@linutronix.de>
Subject: Please queue ubifs: Fix ubifs_tnc_lookup() usage in do_kill_orphans() for stable (was: Re: [PATCH] ubifs: Fix ubifs_tnc_lookup() usage in do_kill_orphans())
Date: Wed, 29 Apr 2020 20:51:06 +0200 (CEST)	[thread overview]
Message-ID: <1537701093.171645.1588186266734.JavaMail.zimbra@nod.at> (raw)
In-Reply-To: <875zdibasg.fsf@vostro.fn.ogness.net>

----- Ursprüngliche Mail -----
> Von: "John Ogness" <john.ogness@linutronix.de>
> An: "richard" <richard@nod.at>
> CC: "linux-mtd" <linux-mtd@lists.infradead.org>, "linux-kernel" <linux-kernel@vger.kernel.org>
> Gesendet: Mittwoch, 29. April 2020 16:56:31
> Betreff: Re: [PATCH] ubifs: Fix ubifs_tnc_lookup() usage in do_kill_orphans()

> Hi Richard,
> 
> Could you CC this patch to stable? It fixes a serious problem that I am
> seeing on real devices (i.e. Linux not being able to mount its root
> filesystem after a power cut). Thanks.

Just checked again, better ask stable maintainers. :-)

Stable maintainers, can you please make sure this patch will make it
into stable?
The upstream commit is:
4ab25ac8b2b5 ("ubifs: Fix ubifs_tnc_lookup() usage in do_kill_orphans()")

I always thought havings a Fixes-Tag is enough to make sure it will
get picked up. Isn't this the case?

Thanks,
//richard
 
> John Ogness
> 
> On 2020-01-19, Richard Weinberger <richard@nod.at> wrote:
>> Orphans are allowed to point to deleted inodes.
>> So -ENOENT is not a fatal error.
>>
>> Reported-by: Кочетков Максим <fido_max@inbox.ru>
>> Reported-and-tested-by: "Christian Berger" <Christian.Berger@de.bosch.com>
>> Fixes: ee1438ce5dc4 ("ubifs: Check link count of inodes when killing orphans.")
>> Signed-off-by: Richard Weinberger <richard@nod.at>
>> ---
>>  fs/ubifs/orphan.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/fs/ubifs/orphan.c b/fs/ubifs/orphan.c
>> index 54d6db61106f..2645917360b9 100644
>> --- a/fs/ubifs/orphan.c
>> +++ b/fs/ubifs/orphan.c
>> @@ -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);

  parent reply	other threads:[~2020-04-29 18:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-19 21:52 [PATCH] ubifs: Fix ubifs_tnc_lookup() usage in do_kill_orphans() Richard Weinberger
2020-04-29 14:56 ` John Ogness
2020-04-29 15:03   ` Richard Weinberger
2020-04-29 18:51   ` Richard Weinberger [this message]
2020-04-30  7:11     ` Please queue ubifs: Fix ubifs_tnc_lookup() usage in do_kill_orphans() for stable (was: Re: [PATCH] ubifs: Fix ubifs_tnc_lookup() usage in do_kill_orphans()) Greg KH
2020-04-30  7:41       ` Richard Weinberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1537701093.171645.1588186266734.JavaMail.zimbra@nod.at \
    --to=richard@nod.at \
    --cc=john.ogness@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®