Files
linux/drivers
Neil Brown 286f3e13a1 [SCSI] fix possible deadlock in scsi_lib.c
If a filesystem, while writing out data, decides that it is good
to issue a cache flush on a SCSI drive (or other 'sd' device), it will
call blkdev_issue_flush which calls ->issue_flush_fn which is
scsi_issue_flush_fn.
This calls sd_issue_flush which calls sd_sync_cache, which calls
scsi_execute_request.
This will (as sshdr != NULL) call
    kmalloc(SCSI_SENSE_BUFFERSIZE, GFP_KERNEL)

If memory is tight, the presence of GFP_KERNEL may cause write
requests to be sent to some filesystem to free up memory, however if
that filesystem is waiting for the issue_flush_fn to complete, you
could get a deadlock.

I wonder if it might be more appropriate to use GFP_NOIO as in the
following patch.

I wonder if it might be even more appropriate to cope better with a
kmalloc failure, especially as in this use, sd_sync_cache only will
use the sense information to print out a more informative error
message.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-09-09 10:29:22 -05:00
..
2005-09-07 18:44:33 -07:00
2005-07-30 09:47:53 -05:00
2005-09-07 17:17:33 -07:00
2005-09-07 16:57:20 -07:00
2005-09-06 17:52:54 -05:00
2005-09-07 16:57:17 -07:00
2005-09-06 22:15:20 -04:00
2005-08-30 21:46:19 -07:00
2005-06-21 18:46:32 -07:00