From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Mike Snitzer <snitzer@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>,
Andrew Morton <akpm@linux-foundation.org>,
dm-devel@redhat.com, linux-kernel@vger.kernel.org,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>
Subject: Re: [PATCH] block: fix blk_stack_limits() regression due to lcm() change
Date: Mon, 30 Mar 2015 16:53:06 -0400 [thread overview]
Message-ID: <yq1fv8mmclp.fsf@sermon.lab.mkp.net> (raw)
In-Reply-To: <20150330173909.GA4836@redhat.com> (Mike Snitzer's message of "Mon, 30 Mar 2015 13:39:09 -0400")
>>>>> "Mike" == Mike Snitzer <snitzer@redhat.com> writes:
Mike> Linux 3.19 commit 69c953c ("lib/lcm.c: lcm(n,0)=lcm(0,n) is 0, not
Mike> n") caused blk_stack_limits() to not properly stack queue_limits
Mike> for stacked devices (e.g. DM).
Mike> Fix this regression by establishing lcm_not_zero() and switching
Mike> blk_stack_limits() over to using it.
I'm OK with that approach. The original lcm() behavior made sense when
we were the only user.
+unsigned long lcm_not_zero(unsigned long a, unsigned long b)
+{
+ unsigned long l = lcm(a, b);
+
+ if (l)
+ return l;
+
+ return (b ? : a);
+}
I always blink when I read b ?: a instead of b ? b : a. But no
biggie. That's just my personal preference.
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
next prev parent reply other threads:[~2015-03-30 20:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-09 21:03 [PATCH 1/2] lib/lcm.c: Ensure correct result whenever it fits Rasmus Villemoes
2014-12-09 21:03 ` [PATCH 2/2] lib/lcm.c: lcm(n,0)=lcm(0,n) is 0, not n Rasmus Villemoes
2015-03-29 2:44 ` Mike Snitzer
2015-03-30 17:39 ` [PATCH] block: fix blk_stack_limits() regression due to lcm() change Mike Snitzer
2015-03-30 20:53 ` Martin K. Petersen [this message]
2015-03-30 19:38 ` [PATCH 2/2] lib/lcm.c: lcm(n,0)=lcm(0,n) is 0, not n Rasmus Villemoes
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=yq1fv8mmclp.fsf@sermon.lab.mkp.net \
--to=martin.petersen@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=dm-devel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=snitzer@redhat.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
Powered by JetHome