• Amir Goldstein's avatar
    fuse: fix parallel dio write on file open in passthrough mode · 7cc91126
    Amir Goldstein authored
    Parallel dio write takes a negative refcount of fi->iocachectr and so does
    open of file in passthrough mode.
    
    The refcount of passthrough mode is associated with attach/detach of a
    fuse_backing object to fuse inode.
    
    For parallel dio write, the backing file is irrelevant, so the call to
    fuse_inode_uncached_io_start() passes a NULL fuse_backing object.
    
    Passing a NULL fuse_backing will result in false -EBUSY error if the file
    is already open in passthrough mode.
    
    Allow taking negative fi->iocachectr refcount with NULL fuse_backing,
    because it does not conflict with an already attached fuse_backing object.
    
    Fixes: 4a90451b ("fuse: implement open in passthrough mode")
    Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
    Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
    7cc91126
iomode.c 7.06 KB