All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] vfs:9p: fix open-unlink-fstat bug
@ 2020-07-20  1:46 Jianyong Wu
  2020-07-20  1:46 ` [RFC PATCH 1/2] vfs: pass file down when getattr to avoid losing info Jianyong Wu
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jianyong Wu @ 2020-07-20  1:46 UTC (permalink / raw)
  To: ericvh, hch, dhowells, lucho, asmadeus
  Cc: v9fs-developer, linux-kernel, Kaly.Xin, justin.he, jianyong.wu, wei.chen

how to reproduce:
in 9p guest:

struct stat *statbuf;
int fd;

fd = open("tmp", O_RDWR);
unlink("tmp");
fstat(fd, statbuf);

fstat will fail as "tmp" in 9p server side has been removed. 9p server
can't retrieve the file context as the guest has not passed it down.
so we should pass the file info down in 9p guest in getattr op.
it need add a new file member in "struct kstat" as "struct istat" does.

Jianyong Wu (2):
  vfs: pass file down when getattr to avoid losing info.
  9p: retrieve fid from file if it exists when getattr.

 fs/9p/vfs_inode.c      | 9 +++++++--
 fs/9p/vfs_inode_dotl.c | 9 +++++++--
 fs/stat.c              | 1 +
 include/linux/stat.h   | 6 ++++++
 4 files changed, 21 insertions(+), 4 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-07-21 10:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-20  1:46 [RFC PATCH 0/2] vfs:9p: fix open-unlink-fstat bug Jianyong Wu
2020-07-20  1:46 ` [RFC PATCH 1/2] vfs: pass file down when getattr to avoid losing info Jianyong Wu
2020-07-20 14:53   ` Dominique Martinet
2020-07-21 10:03     ` Jianyong Wu
2020-07-20  1:46 ` [RFC PATCH 2/2] 9p: retrieve fid from file if it exists when getattr Jianyong Wu
2020-07-20  1:52 ` [RFC PATCH 0/2] vfs:9p: fix open-unlink-fstat bug Al Viro
2020-07-20  1:58   ` Jianyong Wu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.