Message ID | c81e7219e0736f80bfd3553676a19e2992cff41d.1732820037.git.qemu_oss@crudebyte.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [PULL,for-9.2,1/7] 9pfs: cleanup V9fsFidState | expand |
diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 851e36b9a1..578517739a 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -1596,7 +1596,13 @@ static void coroutine_fn v9fs_getattr(void *opaque) retval = -ENOENT; goto out_nofid; } - retval = v9fs_co_lstat(pdu, &fidp->path, &stbuf); + if ((fidp->fid_type == P9_FID_FILE && fidp->fs.fd != -1) || + (fidp->fid_type == P9_FID_DIR && fidp->fs.dir.stream)) + { + retval = v9fs_co_fstat(pdu, fidp, &stbuf); + } else { + retval = v9fs_co_lstat(pdu, &fidp->path, &stbuf); + } if (retval < 0) { goto out; }