lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 14 Nov 2006 08:02:10 +0100
From:	Pierre Ossman <>
To:	Jens Axboe <>, LKML <>
Subject: How to cleanly shut down a block device

Hi Jens,

I've been trying to sort out some bugs in the MMC layer's block driver,
but my knowledge about the block layer is severely lacking. So I was
hoping you could educate me a bit. :)

Upon creation, the following happens:

blk_queue_*() (Set up limits)
disk->* = * (assign members)

And on a clean removal, where there are no users of a card when it is


So far everything seems nice and peachy. The question is what to do when
a card is removed when the device is open.

In that case, del_gendisk() will be called, which seems to be documented
as blocking any new requests to be added to the queue. But there will be
a lot of outstanding requests in the queue.

Is it up to each block device to iterate and fail these or can I tell
the kernel "I'm broken, go away!"?

When the queue eventually drains (without too many oopses) and the user
calls close(), then put_disk() and blk_cleanup_queue() will be called.

     -- Pierre Ossman

  Linux kernel, MMC maintainer
  PulseAudio, core developer
  rdesktop, core developer
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists