|
From: | Eric Van Hensbergen |
Subject: | Re: [Qemu-devel] [Bug 1336794] Re: 9pfs does not honor open file handles on unlinked files |
Date: | Sun, 12 Apr 2015 14:08:15 -0500 |
On Sun, Apr 12, 2015 at 12:42:35PM -0000, Eric Van Hensbergen wrote:
> In other words, it only uses the open fd to derrive a path and then
> executes the getattr off of that path. If that path no longer exists
> (because of unlink or remove) then you are hosed. In my understanding, the
> "work around" I suppose is the so-called 'silly renaming' where
> remove/unlink simply does a rename until all open instances are closed.
What do you mean, "no longer exists"? Don't confuse path with pathname -
it's a mount,dentry pair. And dentry in question bloody well ought to still
have the FID associated with it - you shouldn't use the same FID for
TREMOVE and for TREAD/TWRITE.
TREMOVE clunks the FID passed to it; on
some servers you really have no choice - server discards the file completely
and on any FID that used to refer to it you get an error from that point on.
On those you'd really have to do something like sillyrename - the only
way to keep IO going for a file sitting on such server is to have it
visible somewhere. Normal fs(4) is that way; e.g. u9fs(4) isn't - there
FID maps to opened file descriptor on host and TREMOVE on another FID
doesn't break it, as long as host supports IO on opened-but-unlinked files.
I don't remember where qemu 9pfs falls in that respect, but I'd expect it
to be more like u9fs...
Which FID are you passing to server on unlink()?
diod: P9_TWALK tag 1 fid 1 newfid 2 nwname 1 'foobar'
diod: P9_RLERROR tag 1 ecode 2
diod: P9_TWALK tag 1 fid 1 newfid 2 nwname 0
diod: P9_RWALK tag 1 nwqid 0e
diod: P9_TLCREATE tag 1 fid 2 name 'foobar' flags 0x8042 mode 0100644 gid 0
diod: P9_RLCREATE tag 1 qid (000000000012524b 0 '') iounit 0
diod: P9_TWALK tag 1 fid 1 newfid 3 nwname 1 'foobar'
diod: P9_RWALK tag 1 nwqid 1 (000000000012524b 0 '')
diod: P9_TGETATTR tag 1 fid 3 request_mask 0x17ff
diod: P9_RGETATTR tag 1 valid 0x17ff qid (000000000012524b 0 '') mode 0100644 uid 0 gid 0 nlink 1 rdev 0 size 0 blksize 4096 blocks 0 atime Mon Apr 6 11:11:08 2015 mtime Mon Apr 6 11:11:08 2015 ctime Mon Apr 6 11:11:08 2015 btime X gen 0 data_version X
diod: P9_TUNLINKAT tag 1 dirfid 1 name 'foobar' flags 0
diod: P9_RLERROR tag 1 ecode 95
diod: P9_TWALK tag 1 fid 3 newfid 4 nwname 0
diod: P9_RWALK tag 1 nwqid 0
diod: P9_TREMOVE tag 1 fid 4
diod: P9_RREMOVE tag 1
diod: P9_TGETATTR tag 1 fid 3 request_mask 0x3fff
diod: P9_RLERROR tag 1 ecode 2
diod: P9_TCLUNK tag 1 fid 2
diod: P9_RCLUNK tag 1
diod: P9_TCLUNK tag 1 fid 3
diod: P9_RCLUNK tag 1
[Prev in Thread] | Current Thread | [Next in Thread] |