[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <yq1fv8mmclp.fsf@sermon.lab.mkp.net>
Date: Mon, 30 Mar 2015 16:53:06 -0400
From: "Martin K. Petersen" <martin.petersen@...cle.com>
To: Mike Snitzer <snitzer@...hat.com>
Cc: Jens Axboe <axboe@...nel.dk>,
Andrew Morton <akpm@...ux-foundation.org>, dm-devel@...hat.com,
linux-kernel@...r.kernel.org,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>
Subject: Re: [PATCH] block: fix blk_stack_limits() regression due to lcm() change
>>>>> "Mike" == Mike Snitzer <snitzer@...hat.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@...cle.com>
--
Martin K. Petersen Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists