super1 - fix for bigendian machines.

devflags is a single byte so endian conversions are now wanted.

Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2011-12-23 14:07:47 +11:00
parent 887162637f
commit adbb382b55
1 changed files with 2 additions and 2 deletions

View File

@ -1064,9 +1064,9 @@ static int write_init_super1(struct supertype *st)
sb->dev_number = __cpu_to_le32(di->disk.number); sb->dev_number = __cpu_to_le32(di->disk.number);
if (di->disk.state & (1<<MD_DISK_WRITEMOSTLY)) if (di->disk.state & (1<<MD_DISK_WRITEMOSTLY))
sb->devflags |= __cpu_to_le32(WriteMostly1); sb->devflags |= WriteMostly1;
else else
sb->devflags &= ~(__cpu_to_le32(WriteMostly1)); sb->devflags &= ~WriteMostly1;
if ((rfd = open("/dev/urandom", O_RDONLY)) < 0 || if ((rfd = open("/dev/urandom", O_RDONLY)) < 0 ||
read(rfd, sb->device_uuid, 16) != 16) { read(rfd, sb->device_uuid, 16) != 16) {