linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] [PATCH] mtd: sm_ftl: fix typo in major number.
       [not found] <20120317175827.GB12111@agk-dp.fab.redhat.com>
@ 2012-03-17 18:16 ` Maxim Levitsky
  2012-03-20 11:40   ` Artem Bityutskiy
  2012-05-19 11:28   ` Alex Elsayed
  0 siblings, 2 replies; 4+ messages in thread
From: Maxim Levitsky @ 2012-03-17 18:16 UTC (permalink / raw)
  To: linux-mtd
  Cc: Maxim Levitsky, John Mesmon, Alasdair G Kergon,
	LVM general discussion and development

major == 0 allocates dynamic major, not major == -1

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
---
 drivers/mtd/sm_ftl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/sm_ftl.c b/drivers/mtd/sm_ftl.c
index 072ed59..9e2dfd5 100644
--- a/drivers/mtd/sm_ftl.c
+++ b/drivers/mtd/sm_ftl.c
@@ -1256,7 +1256,7 @@ static void sm_remove_dev(struct mtd_blktrans_dev *dev)
 
 static struct mtd_blktrans_ops sm_ftl_ops = {
 	.name		= "smblk",
-	.major		= -1,
+	.major		= 0,
 	.part_bits	= SM_FTL_PARTN_BITS,
 	.blksize	= SM_SECTOR_SIZE,
 	.getgeo		= sm_getgeo,
-- 
1.7.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [linux-lvm] [PATCH] mtd: sm_ftl: fix typo in major number.
  2012-03-17 18:16 ` [linux-lvm] [PATCH] mtd: sm_ftl: fix typo in major number Maxim Levitsky
@ 2012-03-20 11:40   ` Artem Bityutskiy
  2012-05-19 11:28   ` Alex Elsayed
  1 sibling, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2012-03-20 11:40 UTC (permalink / raw)
  To: Maxim Levitsky
  Cc: LVM general discussion and development, linux-mtd, John Mesmon,
	G Kergon, Alasdair

[-- Attachment #1: Type: text/plain, Size: 249 bytes --]

On Sat, 2012-03-17 at 20:16 +0200, Maxim Levitsky wrote:
> major == 0 allocates dynamic major, not major == -1
> 
> Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>

Pushed to l2-mtd.git, thanks!

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [linux-lvm] [PATCH] mtd: sm_ftl: fix typo in major number.
  2012-03-17 18:16 ` [linux-lvm] [PATCH] mtd: sm_ftl: fix typo in major number Maxim Levitsky
  2012-03-20 11:40   ` Artem Bityutskiy
@ 2012-05-19 11:28   ` Alex Elsayed
  2012-05-19 11:37     ` Artem Bityutskiy
  1 sibling, 1 reply; 4+ messages in thread
From: Alex Elsayed @ 2012-05-19 11:28 UTC (permalink / raw)
  To: linux-lvm; +Cc: linux-mtd

Maxim Levitsky wrote:

> major == 0 allocates dynamic major, not major == -1

I would appreciate if this could be submitted for -stable, since the 
negative major number breaks LVM (regardless of whether any such devices are 
present). I found this out the hard way when my system failed to boot. 

-stable note: This is in Linus' tree as 
452380efbd72d8d41f53ea64c8a6ea1fedc4394d

For those who don't know (and potentially as a preface for -stable) the 
reason lies in LVM's filtering; in lib/filter/filter.c, lines 230-233:

        if ((line_maj <= 0) || (line_maj >= NUMBER_OF_MAJORS)) {
            blocksection = (line[i] == 'B') ? 1 : 0;
            continue;
        }

Basically, it scans through /proc/devices until it hits a line starting with 
'B', at which point it starts processing block major numbers and 
whitelisting them to be used as PVs. However, the negative number causes a 
problem because it a.) sorts to the top of the list and b.) short-circuits 
the if(). This causes blocksection to flip back to zero immediately, 
terminating the enumeration of permitted devices before any actually get 
whitelisted. As a result, *all* block devices are ignored, with messages 
such as

Skipping: Unrecognised LVM device type 259

259 being blkext, which LVM explicitly allows.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [linux-lvm] [PATCH] mtd: sm_ftl: fix typo in major number.
  2012-05-19 11:28   ` Alex Elsayed
@ 2012-05-19 11:37     ` Artem Bityutskiy
  0 siblings, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2012-05-19 11:37 UTC (permalink / raw)
  To: Alex Elsayed; +Cc: linux-mtd, linux-lvm

[-- Attachment #1: Type: text/plain, Size: 683 bytes --]

On Sat, 2012-05-19 at 04:28 -0700, Alex Elsayed wrote:
> Maxim Levitsky wrote:
> 
> > major == 0 allocates dynamic major, not major == -1
> 
> I would appreciate if this could be submitted for -stable, since the 
> negative major number breaks LVM (regardless of whether any such devices are 
> present). I found this out the hard way when my system failed to boot. 
> 
> -stable note: This is in Linus' tree as 
> 452380efbd72d8d41f53ea64c8a6ea1fedc4394d

It is in Linuses tree already, so I cannot add the "Cc:
stable@kernel.org" tag anymore. You should send a request to Greg and
explain that you want this patch in -stable.

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-05-19 11:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20120317175827.GB12111@agk-dp.fab.redhat.com>
2012-03-17 18:16 ` [linux-lvm] [PATCH] mtd: sm_ftl: fix typo in major number Maxim Levitsky
2012-03-20 11:40   ` Artem Bityutskiy
2012-05-19 11:28   ` Alex Elsayed
2012-05-19 11:37     ` Artem Bityutskiy

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).