9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] reuse of values of qid.path
@ 1998-06-03 23:48 philw
  0 siblings, 0 replies; 5+ messages in thread
From: philw @ 1998-06-03 23:48 UTC (permalink / raw)


the namespace code in the kernel will not work
unless qid.path is unique for a given mounted
connection. I suggest you don't reuse them.

phil




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

* [9fans] reuse of values of qid.path
@ 1998-06-05 13:23 Srinivas.Narendula
  0 siblings, 0 replies; 5+ messages in thread
From: Srinivas.Narendula @ 1998-06-05 13:23 UTC (permalink / raw)














How important is it to not reuse old values of qid.path?

The current fileserver uses sb->qidgen to give a new file/dir
a new path value, but allows duplicates since there is no
handling of overflow.  There is a "check" command option called
"setqid" to resequence the qids if qidgen is in danger of overflow,
but was not implemented.

Having two files/directories with the same qid.path is a "bad thing",
but is possible in the current system.

It seems that qid.path is used like an inode number (and in fact is
the device and inode number in u9fs).  If that is the case, then
instead of using qidgen, use the block address of the directory
block shifted by the size of the slot and or'ed with the slot.

qid.path = (p->addr << log2(DIRPERBUF)) | (slot % DIRPERBUF);

The only problem is that the sequence:

    cp file_of_size_x a
    rm a
    cp different_file_of_size_x a

would result in the two files having the same qid and so would

    cp file_of_size_x a
    rm a
    cp different_file_of_size_x b

but

    cp file_of_size_x a
    cp different_file_of_size_x a

would not (since cp does a truncate before a create).

So again, how important is that?

David Butler
gdb@dbSystems.com







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

* [9fans] reuse of values of qid.path
@ 1998-06-05 13:18 Srinivas.Narendula
  0 siblings, 0 replies; 5+ messages in thread
From: Srinivas.Narendula @ 1998-06-05 13:18 UTC (permalink / raw)








How important is it to not reuse old values of qid.path?

The current fileserver uses sb->qidgen to give a new file/dir
a new path value, but allows duplicates since there is no
handling of overflow.  There is a "check" command option called
"setqid" to resequence the qids if qidgen is in danger of overflow,
but was not implemented.

Having two files/directories with the same qid.path is a "bad thing",
but is possible in the current system.

It seems that qid.path is used like an inode number (and in fact is
the device and inode number in u9fs).  If that is the case, then
instead of using qidgen, use the block address of the directory
block shifted by the size of the slot and or'ed with the slot.

qid.path = (p->addr << log2(DIRPERBUF)) | (slot % DIRPERBUF);

The only problem is that the sequence:

    cp file_of_size_x a
    rm a
    cp different_file_of_size_x a

would result in the two files having the same qid and so would

    cp file_of_size_x a
    rm a
    cp different_file_of_size_x b

but

    cp file_of_size_x a
    cp different_file_of_size_x a

would not (since cp does a truncate before a create).

So again, how important is that?

David Butler
gdb@dbSystems.com






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

* [9fans] reuse of values of qid.path
@ 1998-06-05 13:12 Srinivas.Narendula
  0 siblings, 0 replies; 5+ messages in thread
From: Srinivas.Narendula @ 1998-06-05 13:12 UTC (permalink / raw)








How important is it to not reuse old values of qid.path?

The current fileserver uses sb->qidgen to give a new file/dir
a new path value, but allows duplicates since there is no
handling of overflow.  There is a "check" command option called
"setqid" to resequence the qids if qidgen is in danger of overflow,
but was not implemented.

Having two files/directories with the same qid.path is a "bad thing",
but is possible in the current system.

It seems that qid.path is used like an inode number (and in fact is
the device and inode number in u9fs).  If that is the case, then
instead of using qidgen, use the block address of the directory
block shifted by the size of the slot and or'ed with the slot.

qid.path = (p->addr << log2(DIRPERBUF)) | (slot % DIRPERBUF);

The only problem is that the sequence:

    cp file_of_size_x a
    rm a
    cp different_file_of_size_x a

would result in the two files having the same qid and so would

    cp file_of_size_x a
    rm a
    cp different_file_of_size_x b

but

    cp file_of_size_x a
    cp different_file_of_size_x a

would not (since cp does a truncate before a create).

So again, how important is that?

David Butler
gdb@dbSystems.com






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

* [9fans] reuse of values of qid.path
@ 1998-06-03 19:16 G.David
  0 siblings, 0 replies; 5+ messages in thread
From: G.David @ 1998-06-03 19:16 UTC (permalink / raw)


How important is it to not reuse old values of qid.path?

The current fileserver uses sb->qidgen to give a new file/dir
a new path value, but allows duplicates since there is no
handling of overflow.  There is a "check" command option called
"setqid" to resequence the qids if qidgen is in danger of overflow,
but was not implemented.

Having two files/directories with the same qid.path is a "bad thing",
but is possible in the current system.

It seems that qid.path is used like an inode number (and in fact is
the device and inode number in u9fs).  If that is the case, then
instead of using qidgen, use the block address of the directory
block shifted by the size of the slot and or'ed with the slot.

qid.path = (p->addr << log2(DIRPERBUF)) | (slot % DIRPERBUF);

The only problem is that the sequence:

    cp file_of_size_x a
    rm a
    cp different_file_of_size_x a

would result in the two files having the same qid and so would

    cp file_of_size_x a
    rm a
    cp different_file_of_size_x b

but

    cp file_of_size_x a
    cp different_file_of_size_x a

would not (since cp does a truncate before a create).

So again, how important is that?

David Butler
gdb@dbSystems.com




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

end of thread, other threads:[~1998-06-05 13:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-06-03 23:48 [9fans] reuse of values of qid.path philw
  -- strict thread matches above, loose matches on Subject: below --
1998-06-05 13:23 Srinivas.Narendula
1998-06-05 13:18 Srinivas.Narendula
1998-06-05 13:12 Srinivas.Narendula
1998-06-03 19:16 G.David

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).