linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: Han Xu <xhnjupt@gmail.com>
Cc: Han Xu <han.xu@nxp.com>, linux-mtd <linux-mtd@lists.infradead.org>
Subject: Re: 5.2.0-rc1 UBIFS bad unlock balance
Date: Tue, 13 Aug 2019 21:48:10 +0200 (CEST)	[thread overview]
Message-ID: <1755548283.65333.1565725690268.JavaMail.zimbra@nod.at> (raw)
In-Reply-To: <CA+EcR23WqQGJQ2AD1daTnw7vR5+bfhEokDwEX1UyumoJfTt74Q@mail.gmail.com>

----- Ursprüngliche Mail -----
>> Huh? The bad commit was dropped. Are you still seeing this on Linus' tree?
>> Maybe something else is bad.
>>
> 
> Should be related to this commit. Seems working fine after reverting the patch.
> 
> commit 8009ce956c3d28022af6b122e50213ad830fc902
> Author: Richard Weinberger <richard@nod.at>
> Date:   Wed May 15 21:52:34 2019 +0200
> 
>    ubifs: Don't leak orphans on memory during commit

You are perfectly right, there is still a problem!
Does the following patch make the problem go away?
After orphan_delete() c->orphan_lock is being unlocked,
so a double unlock can happen.

diff --git a/fs/ubifs/orphan.c b/fs/ubifs/orphan.c
index b52624e28fa1..3b4b4114f208 100644
--- a/fs/ubifs/orphan.c
+++ b/fs/ubifs/orphan.c
@@ -129,7 +129,6 @@ static void __orphan_drop(struct ubifs_info *c, struct ubifs_orphan *o)
 static void orphan_delete(struct ubifs_info *c, struct ubifs_orphan *orph)
 {
 	if (orph->del) {
-		spin_unlock(&c->orphan_lock);
 		dbg_gen("deleted twice ino %lu", orph->inum);
 		return;
 	}
@@ -138,7 +137,6 @@ static void orphan_delete(struct ubifs_info *c, struct ubifs_orphan *orph)
 		orph->del = 1;
 		orph->dnext = c->orph_dnext;
 		c->orph_dnext = orph;
-		spin_unlock(&c->orphan_lock);
 		dbg_gen("delete later ino %lu", orph->inum);
 		return;
 	}

Thanks,
//richard

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2019-08-13 19:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-04 20:21 5.2.0-rc1 UBIFS bad unlock balance Han Xu
2019-06-04 20:59 ` Richard Weinberger
2019-08-12 19:40   ` Han Xu
2019-08-12 19:55     ` Richard Weinberger
2019-08-13 19:33       ` Han Xu
2019-08-13 19:48         ` Richard Weinberger [this message]
2019-08-13 19:59           ` [EXT] " Han Xu

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=1755548283.65333.1565725690268.JavaMail.zimbra@nod.at \
    --to=richard@nod.at \
    --cc=han.xu@nxp.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=xhnjupt@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).