Re: [PATCH] block: Avoid divide by 0 when max_discard_sectors is 0

2012-12-18 Thread Doug Anderson
David, On Tue, Dec 18, 2012 at 4:42 PM, David Rientjes wrote: > On Tue, 18 Dec 2012, Doug Anderson wrote: > >> The recent commit "block: discard granularity might not be power of 2" >> introduced a divide by 0 in the kernel. Previously the code didn't >> try to divide by discard_granularity

Re: [PATCH] block: Avoid divide by 0 when max_discard_sectors is 0

2012-12-18 Thread David Rientjes
On Tue, 18 Dec 2012, Doug Anderson wrote: > The recent commit "block: discard granularity might not be power of 2" > introduced a divide by 0 in the kernel. Previously the code didn't > try to divide by discard_granularity when max_discard_sectors was 0. > > Fix the code to only do the division

[PATCH] block: Avoid divide by 0 when max_discard_sectors is 0

2012-12-18 Thread Doug Anderson
The recent commit "block: discard granularity might not be power of 2" introduced a divide by 0 in the kernel. Previously the code didn't try to divide by discard_granularity when max_discard_sectors was 0. Fix the code to only do the division if max_discard_sectors is specified. Error looked

[PATCH] block: Avoid divide by 0 when max_discard_sectors is 0

2012-12-18 Thread Doug Anderson
The recent commit block: discard granularity might not be power of 2 introduced a divide by 0 in the kernel. Previously the code didn't try to divide by discard_granularity when max_discard_sectors was 0. Fix the code to only do the division if max_discard_sectors is specified. Error looked

Re: [PATCH] block: Avoid divide by 0 when max_discard_sectors is 0

2012-12-18 Thread David Rientjes
On Tue, 18 Dec 2012, Doug Anderson wrote: The recent commit block: discard granularity might not be power of 2 introduced a divide by 0 in the kernel. Previously the code didn't try to divide by discard_granularity when max_discard_sectors was 0. Fix the code to only do the division if

Re: [PATCH] block: Avoid divide by 0 when max_discard_sectors is 0

2012-12-18 Thread Doug Anderson
David, On Tue, Dec 18, 2012 at 4:42 PM, David Rientjes rient...@google.com wrote: On Tue, 18 Dec 2012, Doug Anderson wrote: The recent commit block: discard granularity might not be power of 2 introduced a divide by 0 in the kernel. Previously the code didn't try to divide by