Re: [PATCH v5 2/2] usb: storage: set surprise_removal flag on physical removal

From: Greg Kroah-Hartman

Date: Fri Nov 20 2026 - 06:49:21 EST


On Fri, Oct 09, 2026 at 11:31:42AM +0000, 胡连勤 wrote:
> Set the surprise_removal flag in struct Scsi_Host when the USB device
> state is USB_STATE_NOTATTACHED, indicating the device has been
> physically removed and cannot handle I/O.
>
> This flag is checked by sd_remove() (added in the previous patch) to
> skip sync_filesystem() during surprise removal, avoiding a hang waiting
> for I/O that can never complete.

There is no previous patch.

> For orderly removal (e.g. rmmod, sysfs unbind) the USB device state is
> not NOTATTACHED, so the flag is not set and sync proceeds normally,
> preserving dirty data writeback.
>
> Signed-off-by: Lianqin Hu <hulianqin@xxxxxxxx>

Does not match the From: line :(