On Fri, Aug 5, 2011 at 3:28 PM, Christoph Hellwig <h...@lst.de> wrote: > On Fri, Aug 05, 2011 at 02:12:48PM +0100, Daniel P. Berrange wrote: >> > Because you cannot change O_DIRECT on an open fd :(. This is why >> > we're going through this pain. >> >> Hmm, I remember hearing that before, but looking at the current fcntl() >> manpage, it claims you *can* change O_DIRECT using SET_FL. Perhaps this >> is a newish feature, but it'd be nicer to use it if possible ? > > It's been there since day 1 of O_DIRECT support.
Sorry, my bad. So for Linux we could just use fcntl for block_set_hostcache and not bother with reopening. However, we will need to reopen should we wish to support changing O_DSYNC. Stefan