* [PATCH/BUG] mdadm: write behind value does not have endian conversion
@ 2006-10-06 17:53 Paul Clements
2006-10-06 19:03 ` Paul Clements
0 siblings, 1 reply; 3+ messages in thread
From: Paul Clements @ 2006-10-06 17:53 UTC (permalink / raw)
To: linux-raid, neilb
[-- Attachment #1: Type: text/plain, Size: 648 bytes --]
Neil,
The write behind value does not get converted to/from little endian
which causes write behind not to work on big endian machines (RUN ARRAY
fails with invalid argument error):
# mdadm -B /dev/md0 -l1 -n2 --write-behind=256 /dev/sdb10 --write-mostly
/dev/nbd0 --bitmap=/bitmaps/test5
mdadm: RUN_ARRAY failed: Invalid argument
# tail /var/log/messages
Oct 6 13:14:48 caspian kernel: daemon sleep: 5s
Oct 6 13:14:48 caspian kernel: sync size: 1001456 KB
Oct 6 13:14:48 caspian kernel: max write behind: 65536
Oct 6 13:14:48 caspian kernel: md0: failed to create bitmap (-22)
Attached patch for mdadm fixes this.
Thanks,
Paul
[-- Attachment #2: mdadm-2.5.1-write-behind-endian-fix.diff --]
[-- Type: text/plain, Size: 416 bytes --]
--- mdadm-2.5.1/bitmap.c.orig Fri Oct 6 13:40:35 2006
+++ mdadm-2.5.1/bitmap.c Fri Oct 6 13:40:53 2006
@@ -33,6 +33,7 @@ inline void sb_le_to_cpu(bitmap_super_t
sb->chunksize = __le32_to_cpu(sb->chunksize);
sb->daemon_sleep = __le32_to_cpu(sb->daemon_sleep);
sb->sync_size = __le64_to_cpu(sb->sync_size);
+ sb->write_behind = __le32_to_cpu(sb->sync_size);
}
inline void sb_cpu_to_le(bitmap_super_t *sb)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH/BUG] mdadm: write behind value does not have endian conversion
2006-10-06 17:53 [PATCH/BUG] mdadm: write behind value does not have endian conversion Paul Clements
@ 2006-10-06 19:03 ` Paul Clements
2006-10-09 1:20 ` Neil Brown
0 siblings, 1 reply; 3+ messages in thread
From: Paul Clements @ 2006-10-06 19:03 UTC (permalink / raw)
To: neilb; +Cc: linux-raid
Paul Clements wrote:
> --- mdadm-2.5.1/bitmap.c.orig Fri Oct 6 13:40:35 2006
> +++ mdadm-2.5.1/bitmap.c Fri Oct 6 13:40:53 2006
> @@ -33,6 +33,7 @@ inline void sb_le_to_cpu(bitmap_super_t
> sb->chunksize = __le32_to_cpu(sb->chunksize);
> sb->daemon_sleep = __le32_to_cpu(sb->daemon_sleep);
> sb->sync_size = __le64_to_cpu(sb->sync_size);
> + sb->write_behind = __le32_to_cpu(sb->sync_size);
Obviously, sync_size should be write_behind in the above line.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH/BUG] mdadm: write behind value does not have endian conversion
2006-10-06 19:03 ` Paul Clements
@ 2006-10-09 1:20 ` Neil Brown
0 siblings, 0 replies; 3+ messages in thread
From: Neil Brown @ 2006-10-09 1:20 UTC (permalink / raw)
To: Paul Clements; +Cc: linux-raid
On Friday October 6, paul.clements@steeleye.com wrote:
> Paul Clements wrote:
>
> > --- mdadm-2.5.1/bitmap.c.orig Fri Oct 6 13:40:35 2006
> > +++ mdadm-2.5.1/bitmap.c Fri Oct 6 13:40:53 2006
> > @@ -33,6 +33,7 @@ inline void sb_le_to_cpu(bitmap_super_t
> > sb->chunksize = __le32_to_cpu(sb->chunksize);
> > sb->daemon_sleep = __le32_to_cpu(sb->daemon_sleep);
> > sb->sync_size = __le64_to_cpu(sb->sync_size);
>
> > + sb->write_behind = __le32_to_cpu(sb->sync_size);
>
> Obviously, sync_size should be write_behind in the above line.
Thanks.
Applied and push out to git.
NeilBrown
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-10-09 1:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-06 17:53 [PATCH/BUG] mdadm: write behind value does not have endian conversion Paul Clements
2006-10-06 19:03 ` Paul Clements
2006-10-09 1:20 ` Neil Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).