9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] device close
@ 2005-05-23 19:47 Sam
  2005-05-23 20:10 ` Russ Cox
  0 siblings, 1 reply; 2+ messages in thread
From: Sam @ 2005-05-23 19:47 UTC (permalink / raw)
  To: 9fans

In my aoe driver I'm getting closes on QIDs that were never
opened:

(assuming devaoe is bound to the CWD)


rb1# echo bind /net/ether1 >aoectl
aoeopen: c->qid.path=0x2
aoeclose: c->qid.path=0x2
rb1# cd aoe2.9
rb1# ls -l
aoeclose: c->qid.path=0x16
aoeopen: c->qid.path=0x16
aoeclose: c->qid.path=0x16
--rw-rw-rw-  0 dennis dennis           0 May 23 14:44 config
--rw-rw-rw-  0 dennis dennis           0 May 23 14:44 ctl
--rw-rw-rw-  0 dennis dennis 41174138880 May 23 14:44 data
--r--r--r--  0 dennis dennis           0 May 23 14:44 stat
rb1# ls -l data
aoeclose: c->qid.path=0x19
aoe2.9 data close (nopen=0)
called from 8016c789
--rw-rw-rw-  0 dennis dennis 41174138880 May 23 14:44 data


8016c789 is in cclose. (which is obvious now)

I had hoped to keep a reference count on data so i can know
whether or not it's safe to switch to a new disk on the same
blade.  I don't think it's very fair to change disks while a
proc is holding the device open for IO.

Devwalk seems to be the immediate culprit, but I don't think
it's wrong.  How would one do ref counting in the face of
dup'ing channels and potentially open references using the
dev architecture?

Cheers,

Sam



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

* Re: [9fans] device close
  2005-05-23 19:47 [9fans] device close Sam
@ 2005-05-23 20:10 ` Russ Cox
  0 siblings, 0 replies; 2+ messages in thread
From: Russ Cox @ 2005-05-23 20:10 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> In my aoe driver I'm getting closes on QIDs that were never
> opened:

You get a close call for each fid that is clunked.
Some fids are never opened.  You can test c->flag&COPEN
in aoeclose to see if the fid was an open one.

See /sys/src/9/port/devmouse.c:/^mouseclose for
a very simple ref count.

Russ


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

end of thread, other threads:[~2005-05-23 20:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-23 19:47 [9fans] device close Sam
2005-05-23 20:10 ` Russ Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).