Skip to contentSkip to conversation

raid6check.c: add O_SYNC to open

PATCH New Piergiorgio Sartor 1 participant 1 message Feb 1, 2014 MD RAID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 raid6check.c: add O_SYNC to open

It could be better to make sure the
data reaches the disks, so open the
drives with O_SYNC flag.

Signed off: [email protected]

raid6check.c +1 -1
diff -uNrp a/raid6check.c b/raid6check.c
@@ -584,7 +584,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]);
Signature · 1 line
piergiorgio