]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
raid6check.c: add O_SYNC to open
authorPiergiorgio Sartor <piergiorgio.sartor@nexgo.de>
Sat, 1 Feb 2014 21:27:58 +0000 (22:27 +0100)
committerNeilBrown <neilb@suse.de>
Tue, 4 Feb 2014 05:06:46 +0000 (16:06 +1100)
It could be better to make sure the
data reaches the disks, so open the
drives with O_SYNC flag.

Signed off: piergiorgio.sartor@nexgo.de

Signed-off-by: NeilBrown <neilb@suse.de>
raid6check.c

index 48e9094a2f7b5e736d52a52b1d26ff80b4f1f1ad..22b74cc1245059239a7d23a7136fb5e04823ad5d 100644 (file)
@@ -592,7 +592,7 @@ int main(int argc, char *argv[])
                if(disk_slot >= 0) {
                        disk_name[disk_slot] = map_dev(comp->disk.major, comp->disk.minor, 0);
                        offsets[disk_slot] = comp->data_offset * 512;
-                       fds[disk_slot] = open(disk_name[disk_slot], O_RDWR);
+                       fds[disk_slot] = open(disk_name[disk_slot], O_RDWR | O_SYNC);
                        if (fds[disk_slot] < 0) {
                                perror(disk_name[disk_slot]);
                                fprintf(stderr,"%s: cannot open %s\n", prg, disk_name[disk_slot]);