All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Jean-Marc Eurin <jmeurin@google.com>
Cc: Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] mtdoops: Fix the size of the header read buffer.
Date: Mon, 7 Feb 2022 16:34:09 +0100	[thread overview]
Message-ID: <20220207163409.19c3bc4c@xps13> (raw)
In-Reply-To: <CAL3wywWSDJUsbgJf4NXctxJmrJRzyO9V-PVcu3qftM1GGPyU_Q@mail.gmail.com>

Hi Jean-Marc,

It looks like you changed the title when answering to my question, I
thought this was a v2 and could not find it in patchwork. That is
because the v2 does not actually exist?

jmeurin@google.com wrote on Thu, 3 Feb 2022 17:53:47
-0800:

> On Mon, Jan 31, 2022 at 2:00 AM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> >
> > Hi Jean-Marc,
> >
> > jmeurin@google.com wrote on Fri, 28 Jan 2022 14:01:56 -0800:
> >  
> > > The read buffer size depends on the MTDOOPS_HEADER_SIZE.
> > >
> > > Tested: Changed the header size, it doesn't panic, header is still
> > > read/written correctly.  
> >
> > On what Linux kernel version are you? It looks like we don't share the
> > same code base, are we?  
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/mtd/mtdoops.c?h=v5.17-rc2
> has that bug.  If you try to increase the MTDOOPS_HEADER_SIZE,
> find_next_position() will try to do an mtd_read() of
> MTDOOPS_HEADER_SIZE bytes in a count buffer that is fixed to only 8
> bytes.

I might have checked another function then. Indeed the fix looks legit.

Can you please send a v2 with:
- Your two patches in the same series (formatted with git-format-patch
  to get the dependency/order right)
- In the other commit, drop the reference pointing to (I believe) a
  commit hash that is local to your tree only.
- Use the right prefix ("mtd: mtdoops:").

And we should be good.

> 
> Thanks,
> 
> Jean-Marc
> 
> >  
> > >
> > > Signed-off-by: Jean-Marc Eurin <jmeurin@google.com>
> > > ---
> > >  drivers/mtd/mtdoops.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c
> > > index 227df24387df..09a26747f490 100644
> > > --- a/drivers/mtd/mtdoops.c
> > > +++ b/drivers/mtd/mtdoops.c
> > > @@ -223,7 +223,7 @@ static void find_next_position(struct mtdoops_context *cxt)
> > >  {
> > >       struct mtd_info *mtd = cxt->mtd;
> > >       int ret, page, maxpos = 0;
> > > -     u32 count[2], maxcount = 0xffffffff;
> > > +     u32 count[MTDOOPS_HEADER_SIZE/sizeof(u32)], maxcount = 0xffffffff;
> > >       size_t retlen;
> > >
> > >       for (page = 0; page < cxt->oops_pages; page++) {  
> >
> >
> > Thanks,
> > Miquèl  


Thanks,
Miquèl

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

WARNING: multiple messages have this Message-ID (diff)
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Jean-Marc Eurin <jmeurin@google.com>
Cc: Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] mtdoops: Fix the size of the header read buffer.
Date: Mon, 7 Feb 2022 16:34:09 +0100	[thread overview]
Message-ID: <20220207163409.19c3bc4c@xps13> (raw)
In-Reply-To: <CAL3wywWSDJUsbgJf4NXctxJmrJRzyO9V-PVcu3qftM1GGPyU_Q@mail.gmail.com>

Hi Jean-Marc,

It looks like you changed the title when answering to my question, I
thought this was a v2 and could not find it in patchwork. That is
because the v2 does not actually exist?

jmeurin@google.com wrote on Thu, 3 Feb 2022 17:53:47
-0800:

> On Mon, Jan 31, 2022 at 2:00 AM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> >
> > Hi Jean-Marc,
> >
> > jmeurin@google.com wrote on Fri, 28 Jan 2022 14:01:56 -0800:
> >  
> > > The read buffer size depends on the MTDOOPS_HEADER_SIZE.
> > >
> > > Tested: Changed the header size, it doesn't panic, header is still
> > > read/written correctly.  
> >
> > On what Linux kernel version are you? It looks like we don't share the
> > same code base, are we?  
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/mtd/mtdoops.c?h=v5.17-rc2
> has that bug.  If you try to increase the MTDOOPS_HEADER_SIZE,
> find_next_position() will try to do an mtd_read() of
> MTDOOPS_HEADER_SIZE bytes in a count buffer that is fixed to only 8
> bytes.

I might have checked another function then. Indeed the fix looks legit.

Can you please send a v2 with:
- Your two patches in the same series (formatted with git-format-patch
  to get the dependency/order right)
- In the other commit, drop the reference pointing to (I believe) a
  commit hash that is local to your tree only.
- Use the right prefix ("mtd: mtdoops:").

And we should be good.

> 
> Thanks,
> 
> Jean-Marc
> 
> >  
> > >
> > > Signed-off-by: Jean-Marc Eurin <jmeurin@google.com>
> > > ---
> > >  drivers/mtd/mtdoops.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c
> > > index 227df24387df..09a26747f490 100644
> > > --- a/drivers/mtd/mtdoops.c
> > > +++ b/drivers/mtd/mtdoops.c
> > > @@ -223,7 +223,7 @@ static void find_next_position(struct mtdoops_context *cxt)
> > >  {
> > >       struct mtd_info *mtd = cxt->mtd;
> > >       int ret, page, maxpos = 0;
> > > -     u32 count[2], maxcount = 0xffffffff;
> > > +     u32 count[MTDOOPS_HEADER_SIZE/sizeof(u32)], maxcount = 0xffffffff;
> > >       size_t retlen;
> > >
> > >       for (page = 0; page < cxt->oops_pages; page++) {  
> >
> >
> > Thanks,
> > Miquèl  


Thanks,
Miquèl

  reply	other threads:[~2022-02-07 16:04 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-28 22:01 [PATCH] Fix the size of the header read buffer Jean-Marc Eurin
2022-01-28 22:01 ` Jean-Marc Eurin
2022-01-31 10:00 ` Miquel Raynal
2022-01-31 10:00   ` Miquel Raynal
2022-02-04  1:53   ` [PATCH v2] mtdoops: " Jean-Marc Eurin
2022-02-04  1:53     ` Jean-Marc Eurin
2022-02-07 15:34     ` Miquel Raynal [this message]
2022-02-07 15:34       ` Miquel Raynal
2022-03-30 18:28       ` [PATCH] " Jean-Marc Eurin
2022-03-30 18:28         ` Jean-Marc Eurin
2022-03-30 18:28         ` [PATCH v2 0/2] mtd: mtdoops: Structure the header of the dumped oops Jean-Marc Eurin
2022-03-30 18:28           ` Jean-Marc Eurin
2022-03-30 18:28         ` [PATCH v2 1/2] mtd: mtdoops: Fix the size of the header read buffer Jean-Marc Eurin
2022-03-30 18:28           ` Jean-Marc Eurin
2022-03-30 18:28         ` [PATCH v2 2/2] mtd: mtdoops: Create a header structure for the saved mtdoops Jean-Marc Eurin
2022-03-30 18:28           ` Jean-Marc Eurin
2022-03-30 22:23           ` kernel test robot
2022-03-30 22:23             ` kernel test robot
2022-03-31  0:14           ` kernel test robot
2022-03-31  0:14             ` kernel test robot
2022-03-30 19:59         ` [PATCH] Fix the size of the header read buffer Jean-Marc Eurin
2022-03-30 19:59           ` Jean-Marc Eurin
2022-04-15  0:13       ` [PATCH v3 0/3] mtd: mtdoops: Add timestamp to the dumped oops header Jean-Marc Eurin
2022-04-15  0:13         ` Jean-Marc Eurin
2022-04-15  0:13         ` [PATCH v3 1/3] mtd: mtdoops: Fix the size of the header read buffer Jean-Marc Eurin
2022-04-15  0:13           ` Jean-Marc Eurin
2022-04-21  7:35           ` Miquel Raynal
2022-04-21  7:35             ` Miquel Raynal
2022-04-15  0:13         ` [PATCH v3 2/3] mtd: mtdoops: Create a header structure for the saved mtdoops Jean-Marc Eurin
2022-04-15  0:13           ` Jean-Marc Eurin
2022-04-21  7:35           ` Miquel Raynal
2022-04-21  7:35             ` Miquel Raynal
2022-04-15  0:13         ` [PATCH v3 3/3] mtd: mtdoops: Add a timestamp to the mtdoops header Jean-Marc Eurin
2022-04-15  0:13           ` Jean-Marc Eurin
2022-04-21  7:35           ` Miquel Raynal
2022-04-21  7:35             ` Miquel Raynal
2022-04-21 23:42         ` [PATCH v4 0/3] mtd: mtdoops: Add timestamp to the dumped oops header Jean-Marc Eurin
2022-04-21 23:42           ` Jean-Marc Eurin
2022-04-21 23:42           ` [PATCH v4 1/3] mtd: mtdoops: Fix the size of the header read buffer Jean-Marc Eurin
2022-04-21 23:42             ` Jean-Marc Eurin
2022-04-26  7:34             ` Miquel Raynal
2022-04-26  7:34               ` Miquel Raynal
2022-04-21 23:42           ` [PATCH v4 2/3] mtd: mtdoops: Create a header structure for the saved mtdoops Jean-Marc Eurin
2022-04-21 23:42             ` Jean-Marc Eurin
2022-04-26  7:34             ` Miquel Raynal
2022-04-26  7:34               ` Miquel Raynal
2022-04-25  8:42           ` [PATCH v4 0/3] mtd: mtdoops: Add timestamp to the dumped oops header Miquel Raynal
2022-04-25  8:42             ` Miquel Raynal
2022-04-25 16:14             ` Jean-Marc Eurin
2022-04-25 16:14               ` Jean-Marc Eurin
2022-04-26  7:28               ` Miquel Raynal
2022-04-26  7:28                 ` Miquel Raynal
2022-04-25 16:09         ` [PATCH v4 3/3] mtd: mtdoops: Add a timestamp to the mtdoops header Jean-Marc Eurin
2022-04-25 16:09           ` Jean-Marc Eurin
2022-04-26  7:34           ` Miquel Raynal
2022-04-26  7:34             ` Miquel Raynal

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=20220207163409.19c3bc4c@xps13 \
    --to=miquel.raynal@bootlin.com \
    --cc=jmeurin@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.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 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.