All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Elsayed <eternaleye+usenet@gmail.com>
To: linux-lvm@redhat.com
Cc: linux-mtd@lists.infradead.org
Subject: Re: [linux-lvm] [PATCH] mtd: sm_ftl: fix typo in major number.
Date: Sat, 19 May 2012 04:28:20 -0700	[thread overview]
Message-ID: <jp804k$r4o$3@dough.gmane.org> (raw)
In-Reply-To: 1332008213-3940-1-git-send-email-maximlevitsky@gmail.com

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.

WARNING: multiple messages have this Message-ID (diff)
From: Alex Elsayed <eternaleye+usenet@gmail.com>
To: linux-mtd@lists.infradead.org
Cc: linux-lvm@redhat.com
Subject: Re: [PATCH] mtd: sm_ftl: fix typo in major number.
Date: Sat, 19 May 2012 04:28:20 -0700	[thread overview]
Message-ID: <jp804k$r4o$3@dough.gmane.org> (raw)
In-Reply-To: 1332008213-3940-1-git-send-email-maximlevitsky@gmail.com

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.

  parent reply	other threads:[~2012-05-19 11:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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-17 18:16   ` Maxim Levitsky
2012-03-20 11:40   ` Unquarantined: Re: [linux-lvm] " Artem Bityutskiy
2012-03-20 11:40   ` Artem Bityutskiy
2012-03-20 11:40     ` Artem Bityutskiy
2012-05-19 11:28   ` Alex Elsayed [this message]
2012-05-19 11:28     ` Alex Elsayed
2012-05-19 11:37     ` [linux-lvm] " Artem Bityutskiy
2012-05-19 11:37       ` Artem Bityutskiy

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='jp804k$r4o$3@dough.gmane.org' \
    --to=eternaleye+usenet@gmail.com \
    --cc=linux-lvm@redhat.com \
    --cc=linux-mtd@lists.infradead.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.