Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1258178
| From | Jiri Slaby <jslaby@suse.cz> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 3.12 050/123] dm raid: fix round up of default region size |
| Date | 2015-10-28 15:30 +0100 |
| Message-ID | <qozTL-3KE-77@gated-at.bofh.it> (permalink) |
| References | <qozqF-3k6-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Mikulas Patocka <mpatocka@redhat.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 042745ee53a0a7c1f5aff191a4a24213c6dcfb52 upstream.
Commit 3a0f9aaee028 ("dm raid: round region_size to power of two")
intended to make sure that the default region size is a power of two.
However, the logic in that commit is incorrect and sets the variable
region_size to 0 or 1, depending on whether min_region_size is a power
of two.
Fix this logic, using roundup_pow_of_two(), so that region_size is
properly rounded up to the next power of two.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Fixes: 3a0f9aaee028 ("dm raid: round region_size to power of two")
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/md/dm-raid.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c
index 59715389b3cf..19cfd7affebe 100644
--- a/drivers/md/dm-raid.c
+++ b/drivers/md/dm-raid.c
@@ -325,8 +325,7 @@ static int validate_region_size(struct raid_set *rs, unsigned long region_size)
*/
if (min_region_size > (1 << 13)) {
/* If not a power of 2, make it the next power of 2 */
- if (min_region_size & (min_region_size - 1))
- region_size = 1 << fls(region_size);
+ region_size = roundup_pow_of_two(min_region_size);
DMINFO("Choosing default region size of %lu sectors",
region_size);
} else {
--
2.6.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH 3.12 038/123] spi: spi-pxa2xx: Check status register to determine if SSSR_TINT is disabled Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:00 +0100
[PATCH 3.12 118/123] usb: core: implement AMD remote wakeup quirk Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:00 +0100
[PATCH 3.12 120/123] USB: Add OTG PET device to TPL Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:00 +0100
[PATCH 3.12 092/123] crypto: sparc - initialize blkcipher.ivsize Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:00 +0100
[PATCH 3.12 116/123] [media] v4l: vsp1: Fix VI6_WPF_SZCLIP_SIZE_MASK macro Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:00 +0100
[PATCH 3.12 093/123] crypto: ahash - ensure statesize is non-zero Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:00 +0100
[PATCH 3.12 115/123] [media] v4l: vsp1: Fix VI6_DPR_ROUTE_FP_MASK macro Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:00 +0100
[PATCH 3.12 062/123] ipvs: do not use random local source address for tunnels Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:00 +0100
[PATCH 3.12 122/123] ath9k: declare required extra tx headroom Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:00 +0100
[PATCH 3.12 041/123] ALSA: hda - Apply SPDIF pin ctl to MacBookPro 12,1 Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:00 +0100
[PATCH 3.12 121/123] Revert "USB: Add device quirk for ASUS T100 Base Station keyboard" Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:00 +0100
[PATCH 3.12 117/123] [media] gscpa_m5602: use msecs_to_jiffies for conversions Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:00 +0100
Re: [PATCH 3.12 117/123] [media] gscpa_m5602: use msecs_to_jiffies for conversions Nicholas Mc Guire <der.herr@hofr.at> - 2015-10-28 15:50 +0100
[PATCH 3.12 110/123] Input: serio - fix blocking of parport Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 094/123] btrfs: fix use after free iterating extrefs Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 100/123] drm/nouveau/fbcon: take runpm reference when userspace has an open fd Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 109/123] Input: psmouse - add small delay for IBM trackpoint pass-through mode Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 083/123] af_unix: return data from multiple SKBs on recv() with MSG_PEEK flag Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 103/123] usb: chipidea: debug: add runtime pm for register access Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 096/123] i2c: rcar: enable RuntimePM before registering to the core Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 095/123] arm64: errata: use KBUILD_CFLAGS_MODULE for erratum #843419 Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 079/123] mm/slab: fix unexpected index mapping result of kmalloc_size(INDEX_NODE+1) Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 090/123] asix: Don't reset PHY on if_up for ASIX 88772 Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 080/123] 3w-9xxx: don't unmap bounce buffered commands Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 108/123] HID: quirks: add QUIRK_NOGET for an other TPV touchscreen Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 099/123] workqueue: make sure delayed work run in local cpu Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 107/123] HID: apple: Add support for the 2015 Macbook Pro Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 097/123] i2c: s3c2410: enable RuntimePM before registering to the core Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 104/123] USB: symbolserial: Correct transferred data size Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 102/123] rbd: fix double free on rbd_dev->header_name Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 111/123] Input: omap4-keypad - fix memory leak Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 098/123] i2c: designware: Do not use parameters from ACPI on Dell Inspiron 7348 Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 105/123] usb: musb: cppi41: improve rx channel abort routine Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 089/123] ethtool: Use kcalloc instead of kmalloc for ethtool_get_strings Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 106/123] usb: musb: fix cppi channel teardown for isoch transfer Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 112/123] Input: zhenhua - ensure we have BITREVERSE Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 091/123] asix: Do full reset during ax88772_bind Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 101/123] dm thin: fix missing pool reference count decrement in pool_ctr error path Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 070/123] USB: Add reset-resume quirk for two Plantronics usb headphones. Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 073/123] UBI: return ENOSPC if no enough space available Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 068/123] usb: Use the USB_SS_MULT() macro to get the burst multiplier. Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 088/123] ppp: don't override sk->sk_state in pppoe_flush_dev() Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 075/123] m68k: Define asmlinkage_protect Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 076/123] genirq: Fix race in register_irq_proc() Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 065/123] regmap: debugfs: Ensure we don't underflow when printing access masks Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 082/123] af_unix: Convert the unix_sk macro to an inline function for type safety Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 066/123] regmap: debugfs: Don't bother actually printing when calculating max length Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 058/123] usb: xhci: Clear XHCI_STATE_DYING on start Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 069/123] usb: Add device quirk for Logitech PTZ cameras Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 061/123] Initialize msg/shm IPC objects before doing ipc_addid() Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 085/123] skbuff: Fix skb checksum flag on skb pull Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 087/123] net: add pfmemalloc check in sk_add_backlog() Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 071/123] MIPS: dma-default: Fix 32-bit fall back to GFP_DMA Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 074/123] arm64: readahead: fault retry breaks mmap file read random detection Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 077/123] dm cache: fix NULL pointer when switching from cleaner policy Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 067/123] security: fix typo in security_task_prctl Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 072/123] UBI: Validate data_size Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 086/123] skbuff: Fix skb checksum partial check. Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 040/123] ALSA: synth: Fix conflicting OSS device registration on AWE32 Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 084/123] net/unix: fix logic about sk_peek_offset Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 060/123] usb: xhci: Add support for URB_ZERO_PACKET to bulk/sg transfers Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 043/123] ASoC: fix broken pxa SoC support Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 039/123] mm: hugetlbfs: skip shared VMAs when unmapping private pages to satisfy a fault Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 047/123] Btrfs: update fix for read corruption of compressed and shared extents Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 048/123] dm btree: add ref counting ops for the leaves of top level btrees Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 045/123] btrfs: skip waiting on ordered range for special files Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 054/123] drm/qxl: only report first monitor as connected if we have no state Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 053/123] disabling oplocks/leases via module parm enable_oplocks broken for SMB3 Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 055/123] drm/qxl: recreate the primary surface when the bo is not primary Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 051/123] netfilter: nf_conntrack: Support expectations in different zones Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 049/123] USB: option: add ZTE PIDs Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 046/123] Btrfs: fix read corruption of compressed and shared extents Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 064/123] cifs: use server timestamp for ntlmv2 authentication Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 059/123] xhci: change xhci 1.0 only restrictions to support xhci 1.1 Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 056/123] drm: Reject DRI1 hw lock ioctl functions for kms drivers Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 042/123] ASoC: pxa: pxa2xx-ac97: fix dma requestor lines Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 057/123] USB: whiteheat: fix potential null-deref at probe Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 052/123] netfilter: ctnetlink: put back references to master ct and expect objects Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 044/123] ASoC: dwc: correct irq clear method Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 050/123] dm raid: fix round up of default region size Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
csiph-web