All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] linear does not need chunksize
@ 2005-07-16 23:12 Michael Tokarev
  2005-07-16 23:22 ` Neil Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Tokarev @ 2005-07-16 23:12 UTC (permalink / raw)
  To: linux-raid

When debugging some weird raid failure case, we come
across a problem when kernel disallows assembling a
linear array with zero chunksize, printing
'no chunksize specified' in dmesg and mdadm failing
with EINVAL.  The following patch fixes the problem
(the patch is with large context to show why the change).

Note chunk size is never used on linear array.  The
only usage of chunk_size member is in /proc/mdstat,
as "rounding" parameter (linear.c) - looks like it
should be removed too.

Signed-Off-By: Michael Tokarev <mjt@tls.msk.ru>

--- linux-2.6.12/drivers/md/md.c.orig	2005-06-17 23:48:29.000000000 +0400
+++ linux-2.6.12/drivers/md/md.c	2005-07-17 03:07:05.000000000 +0400
@@ -1516,21 +1516,21 @@ static int do_md_run(mddev_t * mddev)
 
 	/*
 	 * Analyze all RAID superblock(s)
 	 */
 	if (!mddev->raid_disks)
 		analyze_sbs(mddev);
 
 	chunk_size = mddev->chunk_size;
 	pnum = level_to_pers(mddev->level);
 
-	if ((pnum != MULTIPATH) && (pnum != RAID1)) {
+	if ((pnum != MULTIPATH) && (pnum != RAID1) && (pnum != LINEAR)) {
 		if (!chunk_size) {
 			/*
 			 * 'default chunksize' in the old md code used to
 			 * be PAGE_SIZE, baaad.
 			 * we abort here to be on the safe side. We don't
 			 * want to continue the bad practice.
 			 */
 			printk(KERN_ERR 
 				"no chunksize specified, see 'man raidtab'\n");
 			return -EINVAL;

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-07-16 23:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-16 23:12 [patch] linear does not need chunksize Michael Tokarev
2005-07-16 23:22 ` Neil Brown
2005-07-16 23:50   ` Michael Tokarev

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.