Bug 448171 - Send warning notification when device is unsafely removed while async IO operations were still in progress
Summary: Send warning notification when device is unsafely removed while async IO oper...
Status: REPORTED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: git master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-09 17:25 UTC by Nate Graham
Modified: 2024-05-10 19:08 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2022-01-09 17:25:31 UTC
This is an alternative to fixing Bug 281270, which may not be fixable at the KIO level.

When asynchronous file IO to removable devices is used, it's possible for the user to unplug a removable device without clicking "unmount" in the UI. In this case, any in progress background sync jobs will die and the files being transferred will be corrupted and destroyed.

KIO should detect this condition and display a critical notification saying something like:

> Possible data loss
> 
> The device was unplugged without unmounting it, which might have caused data loss.
> Plug it back in and [move, copy] the files again, and manually unmount the disk
> before unplugging it.

It should only do this when async IO is being used and there were actually any in progress transfers when the device disappeared. In all other cases, unplugging without umounting is harmless, so we shouldn't badger the user unnecessarily.