How to disable asynchronous writes to storage?

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
spamhog
Level 3
Level 3
Posts: 146
Joined: Thu Dec 17, 2009 6:21 pm
Contact:

How to disable asynchronous writes to storage?

Post by spamhog »

Vanessa, Linux 5.15.0-56-generic.

Is there a way to disable asynchronous writes to storage?

I can't find a use case where it's better to pretend that a slow write is finished when in reality it's not. Maybe when a gazillion small slow writes writes to a slow hard disk need to happen strictly sequentially with no chance/need to be interrupted, and will block an app from doing anything untill they are done? But when does that happen in reality?

My USB drives no longer have LEDs, so I no longer see that a write is still running which is prematurely reported as finished to userspace. Unmounting won't be allowed if the write is still ongoing. So after a write is reported finished I count to 10 before trying to unmount them, which is barbarous.

Already discussed here:
viewtopic.php?f=50&t=349917

Some unapplicable, related, funny IBM advice here:
rename IBM-issued libibmaio.so and libibmaiodbg.so
so IBM-issued WebSphere can't trigger them.
https://www.ibm.com/docs/en/filenet-p8- ... -libraries
Last edited by LockBot on Sat Jun 10, 2023 10:00 pm, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
t42
Level 11
Level 11
Posts: 3734
Joined: Mon Jan 20, 2014 6:48 pm

Re: How to disable asynchronous writes to storage?

Post by t42 »

spamhog wrote: Wed Dec 07, 2022 1:09 pm after a write is reported finished I count to 10 before trying to unmount them
You can't go wrong running sync and wait till shell prompt will appear.
-=t42=-
User avatar
spamhog
Level 3
Level 3
Posts: 146
Joined: Thu Dec 17, 2009 6:21 pm
Contact:

Re: How to disable asynchronous writes to storage?

Post by spamhog »

Thank you t42!

I thought sync only flushed hard disk onboard caches,
now I know it flushes memory caches to disk.
Locked

Return to “Storage”