lkml.org 
[lkml]   [2006]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjecthow stop sync on last close of removable medium?
Date
blkdev_close calls blkdev_put, which does a sync if we were the last
opener of the device and are now closing:

if (!--bdev->bd_openers) {
sync_blockdev(bdev);
kill_bdev(bdev);
}

This is bad news for nbd-like devices which use a client daemon
to transfer data out of the device. If there are requests pending
when the daemon is killed off (hey, we may want to shut down!)
then the sync in the daemon's close of its device creates a deadlock.
The sync will not complete until the daemon sends pending
requests which it will not do since it is closing due to death.

Is there a mechanism to prevent this sync occuring? Say for
removable devices?

(I don't see it, due to blindness and mental density ... I could change
blkdev_close in inode->i_fops, I suppose, but that is attached to an
inode, presumably of our special device node in the fs above, and by the
time I get to it we have already opened the device node and it seems
that changing the release method then doesn't actually do anything.
Shrug).

Peter
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-09-30 05:19    [W:0.030 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site