• E
    storage: don't read storage volumes in nonblock mode · 655ea8dc
    Eric Blake 提交于
    Commit 348b4e25 introduced a potential problem (thankfully not
    in any release): we are attempting to use virFileReadHeaderFD()
    on a file that was opened with O_NONBLOCK.  While this
    shouldn't be a problem in practice (because O_NONBLOCK
    typically doesn't affect regular or block files, and fifos and
    sockets cannot be storage volumes), it's better to play it safe
    to avoid races from opening an unexpected file type while also
    avoiding problems with having to handle EAGAIN while read()ing.
    
    Based on a report by Dan Berrange.
    
    * src/storage/storage_backend.c
    (virStorageBackendVolOpenCheckMode): Fix up fd after avoiding race.
    Signed-off-by: NEric Blake <eblake@redhat.com>
    655ea8dc
storage_backend.c 55.6 KB