On Thu, Jun 26, 2025 at 08:06:03PM +0930, Qu Wenruo wrote: > > If I understand the @surprise parameter correctly, it should allow the fs > to do read/write as usual if it's not a surprise removal. > > And btrfs will take the chance to fully writeback all the dirty pages (more > than the default shutdown behavior which only writebacks the current > transaction, no dirty data pages.). That's already taken care of by the call to sync_filesystem in fs_bdev_mark_dead. > But in the real world, for test case like generic/730, the @surprise flag > is either not properly respected, I'm getting @surprise == false but the > block device is already gone. It only works for drivers that call blk_mark_disk_dead or bdev_mark_dead directly with the surprise flag. > So I'm not sure what's the real expected behavior here, and the new flag is > only for future expansion for now. Let's not add just in case arguments.