Skip to content
  • Kirill A. Shutemov's avatar
    hw/9pfs: fix P9_STATS_GEN handling · f8b7ee38
    Kirill A. Shutemov authored
    
    
    Currently we fail getattr request altogether if we can't read
    P9_STATS_GEN for some reason. It breaks valid use cases:
    
    E.g let's assume we have non-readable directory with execution bit set
    on host and we export it to client over 9p On host we can chdir into
    directory, but not open directory on read and list content.
    
    But if client will try to call getattr (as part of chdir(2)) for the
    directory it will fail with -EACCES. It happens because we try to open
    the directory on read to call ioctl(FS_IOC_GETVERSION), it fails and we
    return the error code to client.
    
    It's excessive. The solution is to make P9_STATS_GEN failure non-fatal
    for getattr request. Just don't set P9_STATS_GEN flag in result mask on
    failure.
    
    Signed-off-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
    Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
    f8b7ee38