]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Subject: bitmap: used 4K aligned buffers when reading the bitmap.
authorNeilBrown <neilb@suse.de>
Fri, 23 Dec 2011 03:09:29 +0000 (14:09 +1100)
committerNeilBrown <neilb@suse.de>
Fri, 23 Dec 2011 03:09:29 +0000 (14:09 +1100)
This is needed on 4K block devices such as DASD as we do O_DIRECT
reads.

Do the same alignment for gpt just to be safe.

Signed-off-by: NeilBrown <neilb@suse.de>
bitmap.c
super-gpt.c

index 103706bebf3be1ab278b6992f74b252ee808a71e..c27688c5815951bd5388cab80ad7d839c7e53866 100644 (file)
--- a/bitmap.c
+++ b/bitmap.c
@@ -132,7 +132,7 @@ bitmap_info_t *bitmap_fd_read(int fd, int brief)
        void *buf;
        unsigned int n, skip;
 
-       if (posix_memalign(&buf, 512, 8192) != 0) {
+       if (posix_memalign(&buf, 4096, 8192) != 0) {
                fprintf(stderr, Name ": failed to allocate 8192 bytes\n");
                return NULL;
        }
index b8c9aae9baeb7e1e0abaa2136bc0a0a5747a2daa..75269bf19733ea4346f88bffe17851f0ce4d5629 100644 (file)
@@ -76,7 +76,7 @@ static int load_gpt(struct supertype *st, int fd, char *devname)
 
        free_gpt(st);
 
-       if (posix_memalign((void**)&super, 512, 32*512) != 0) {
+       if (posix_memalign((void**)&super, 4096, 32*512) != 0) {
                fprintf(stderr, Name ": %s could not allocate superblock\n",
                        __func__);
                return 1;