Closed GoogleCodeExporter closed 9 years ago
Examine the output of the ns command. These are probably binds.
Original comment by stanley....@gmail.com
on 13 May 2012 at 3:40
For example:
term% ls /mnt
/mnt/exportfs
/mnt/factotum
/mnt/plumb
/mnt/temp
/mnt/web
/mnt/webcookies
/mnt/wsys
term% auth/factotum
term% ls /mnt
/mnt/exportfs
/mnt/factotum
/mnt/factotum
/mnt/plumb
/mnt/temp
/mnt/web
/mnt/webcookies
/mnt/wsys
Original comment by stanley....@gmail.com
on 13 May 2012 at 3:42
Agreed, they are binds, but should ls print duplicate entries?
Original comment by rahul.g....@gmail.com
on 13 May 2012 at 6:33
Depending on what options were used when mounting/binding the resource, the
directory listing may include items from multiple resources, even items with
the same file names:
term% touch tmp/rc
term% ls -q tmp/rc
(00000000000db916 1 00) tmp/rc
term% ls -q /bin/rc
(00000000000001cd 864 00) /bin/rc
term% bind -a tmp /bin
term% ls -q /bin | grep -e '\/rc$'
(00000000000001cd 864 00) /bin/rc
(00000000000db916 1 00) /bin/rc
The items are still distinct, identified by quid. From stat(2):
typedef
struct Dir {
/* system-modified data */
uint type; /* server type */
uint dev; /* server subtype */
/* file data */
Qid qid; /* unique id from server */
ulong mode; /* permissions */
ulong atime; /* last read time */
ulong mtime; /* last write time */
vlong length; /* file length: see <u.h> */
char *name; /* last element of path */
char *uid; /* owner name */
char *gid; /* group name */
char *muid; /* last modifier name */
} Dir;
Original comment by stanley....@gmail.com
on 13 May 2012 at 7:00
If bind had been called without any flags in the example above, tmp would have
completely replaced /bin in the present namespace. Thus, tmp/rc would have
replaced the original /bin/rc and there would be no duplicate file name in the
directory listing.
Original comment by stanley....@gmail.com
on 13 May 2012 at 7:07
To answer your question, the current behavior is intentional.
Original comment by stanley....@gmail.com
on 13 May 2012 at 7:08
Thanks, makes sense.
Original comment by 9...@vrtra.net
on 14 May 2012 at 4:30
Original comment by stanley....@gmail.com
on 14 May 2012 at 4:32
Original issue reported on code.google.com by
9...@vrtra.net
on 13 May 2012 at 1:12