how stop sync on last close of removable medium?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux