All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: torvalds <torvalds@linux-foundation.org>
Cc: Daniel Palmer <daniel@0x0f.com>, hch <hch@lst.de>,
	 linux-mtd <linux-mtd@lists.infradead.org>,
	 linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [GIT PULL] JFFS2, UBI and UBIFS updates for v6.3-rc1
Date: Fri, 10 Mar 2023 18:32:17 +0100 (CET)	[thread overview]
Message-ID: <349964589.230468.1678469537890.JavaMail.zimbra@nod.at> (raw)
In-Reply-To: <CAHk-=wi29bbBNh3RqJKu3PxzpjDN5D5K17gEVtXrb7-6bfrnMQ@mail.gmail.com>

----- Ursprüngliche Mail -----
>> This seems to be causing one of my machines to lock up during boot.
>> It's using a squashfs root that is on a ubiblock that is located on an SPI NAND.
> 
> Hmm. That commit 91cc8fbcc8c7 ("ubi: block: set BLK_MQ_F_BLOCKING") is odd.
> 
> Christoph - you removed the
> 
>        blk_mq_start_request(req);
>        ...
>        blk_mq_end_request(req, errno_to_blk_status(ret));
> 
> from the workqueue function, but while you added the
> blk_mq_start_request() into ubiblock_read(), the 'end_request()' is
> missing.
> 
> So I suspect the IO has completed, but the change means that nobody
> was informed about said completion, so now trying to mount an ext4
> filesystem on it hangs on the read.
> 
> But I don't actually know this code, that was just from looking at the
> commit that breaks.
> 
> Christoph? Daniel used your infradead address, I don't know if it all
> goes into the same pile, but let's use your regular one. And I can't
> see Daniel's message on lore.kernel.org at all, for whatever reason,
> 

Indeed, I'm able to reproduce the problem and adding blk_mq_end_request()
back fixes it.

diff --git a/drivers/mtd/ubi/block.c b/drivers/mtd/ubi/block.c
index 1de87062c67b..3711d7f74600 100644
--- a/drivers/mtd/ubi/block.c
+++ b/drivers/mtd/ubi/block.c
@@ -221,7 +221,10 @@ static blk_status_t ubiblock_read(struct request *req)
 
 	rq_for_each_segment(bvec, req, iter)
 		flush_dcache_page(bvec.bv_page);
-	return errno_to_blk_status(ret);
+
+	blk_mq_end_request(req, errno_to_blk_status(ret));
+
+	return BLK_STS_OK;
 }
 
 static int ubiblock_open(struct block_device *bdev, fmode_t mode)

Thanks,
//richard

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

WARNING: multiple messages have this Message-ID (diff)
From: Richard Weinberger <richard@nod.at>
To: torvalds <torvalds@linux-foundation.org>
Cc: Daniel Palmer <daniel@0x0f.com>, hch <hch@lst.de>,
	linux-mtd <linux-mtd@lists.infradead.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [GIT PULL] JFFS2, UBI and UBIFS updates for v6.3-rc1
Date: Fri, 10 Mar 2023 18:32:17 +0100 (CET)	[thread overview]
Message-ID: <349964589.230468.1678469537890.JavaMail.zimbra@nod.at> (raw)
In-Reply-To: <CAHk-=wi29bbBNh3RqJKu3PxzpjDN5D5K17gEVtXrb7-6bfrnMQ@mail.gmail.com>

----- Ursprüngliche Mail -----
>> This seems to be causing one of my machines to lock up during boot.
>> It's using a squashfs root that is on a ubiblock that is located on an SPI NAND.
> 
> Hmm. That commit 91cc8fbcc8c7 ("ubi: block: set BLK_MQ_F_BLOCKING") is odd.
> 
> Christoph - you removed the
> 
>        blk_mq_start_request(req);
>        ...
>        blk_mq_end_request(req, errno_to_blk_status(ret));
> 
> from the workqueue function, but while you added the
> blk_mq_start_request() into ubiblock_read(), the 'end_request()' is
> missing.
> 
> So I suspect the IO has completed, but the change means that nobody
> was informed about said completion, so now trying to mount an ext4
> filesystem on it hangs on the read.
> 
> But I don't actually know this code, that was just from looking at the
> commit that breaks.
> 
> Christoph? Daniel used your infradead address, I don't know if it all
> goes into the same pile, but let's use your regular one. And I can't
> see Daniel's message on lore.kernel.org at all, for whatever reason,
> 

Indeed, I'm able to reproduce the problem and adding blk_mq_end_request()
back fixes it.

diff --git a/drivers/mtd/ubi/block.c b/drivers/mtd/ubi/block.c
index 1de87062c67b..3711d7f74600 100644
--- a/drivers/mtd/ubi/block.c
+++ b/drivers/mtd/ubi/block.c
@@ -221,7 +221,10 @@ static blk_status_t ubiblock_read(struct request *req)
 
 	rq_for_each_segment(bvec, req, iter)
 		flush_dcache_page(bvec.bv_page);
-	return errno_to_blk_status(ret);
+
+	blk_mq_end_request(req, errno_to_blk_status(ret));
+
+	return BLK_STS_OK;
 }
 
 static int ubiblock_open(struct block_device *bdev, fmode_t mode)

Thanks,
//richard

  reply	other threads:[~2023-03-10 17:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-01  8:07 [GIT PULL] JFFS2, UBI and UBIFS updates for v6.3-rc1 Richard Weinberger
2023-03-01  8:07 ` Richard Weinberger
2023-03-01 18:02 ` pr-tracker-bot
2023-03-01 18:02   ` pr-tracker-bot
     [not found] ` <CAFr9PXktRBm66vgVjOnwTeucBD36OuPjDVNd9cH1F8u0nesKrA@mail.gmail.com>
2023-03-10 17:17   ` Linus Torvalds
2023-03-10 17:17     ` Linus Torvalds
2023-03-10 17:32     ` Richard Weinberger [this message]
2023-03-10 17:32       ` Richard Weinberger
2023-03-11  8:14       ` hch
2023-03-11  8:14         ` hch

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=349964589.230468.1678469537890.JavaMail.zimbra@nod.at \
    --to=richard@nod.at \
    --cc=daniel@0x0f.com \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.