lists.openwall.net   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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Thu, 3 May 2007 15:06:21 -0600
From:	"Grant Likely" <grant.likely@...retlab.ca>
To:	"Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>
Subject: Need help on block device error handling.

I've got a device driver for the Xilinx SystemACE CompactFlash
interface that I'm working on and I'm having problems adding error
handling and notification.  Specifically, I need to deal with the case
where the CF card might get pulled out by the user at any time without
notice.  While this situation will obviously result in data loss, I
need to make sure that the system is able to recover gracefully (ie.
the user will be ticked if it hangs or crashes.  :)

So, here are my questions.
- When a new CF is inserted/removed, how should I notify the
block/filesystem layer?
- If the CF is removed mid-transfer, how do I abort all pending bios
and block new requests?  What is the impact on user space processes
using the device, will they get signaled?

AFAICT, I've got two options.  One is to use the media_changed() and
revalidate_disk() so the block layer can determine when things have
changed.  However, I cannot figure out how to force all activity to
stop when the CF is removed while the device is still open.

The other seems to be not call add_gendisk() until media is inserted,
and then call del_gendisk() when it is removed, but I don't know if
this is safe, and it still doesn't solve the problem of cancling
pending transactions and forcing the block layer to close the device.

Should I be using invalidate_partition() for this?

Cheers,
g.

-- 
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
grant.likely@...retlab.ca
(403) 399-0195
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ