NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/45105: readdir() in FUSE implementations only called once



>Number:         45105
>Category:       lib
>Synopsis:       readdir() in FUSE implementations only called once
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 29 03:10:00 +0000 2011
>Originator:     Derrik Pates
>Release:        5.1
>Organization:
>Environment:
NetBSD nb5test.now.ai 5.1 NetBSD 5.1 (GENERIC) #0: Sat Nov  6 13:19:33 UTC 2010 
 
builds%b6.netbsd.org@localhost:/home/builds/ab/netbsd-5.1-RELEASE/amd64/201011061943Z-obj/home/builds/ab/netbsd-5.1-RELEASE/src/sys/arch/amd64/compile/GENERIC
 amd64
>Description:
FUSE implementations which implement the readdir() operation and link -lrefuse 
do not work correctly under certain circumstances. There are two modes of 
operation for the readdir() call:

 * The readdir() operation can return all directory entries in a single call. 
Each individual entry is passed to the filler function which is passed to 
readdir(), with an offset (the 'off' parameter) of 0. This tells FUSE that all 
entries are being passed at once, and not to attempt further calls to readdir() 
to get further entries from this directory.
 * The readdir() operation can return a partial list of entries for the current 
directory. This allows progressive reading of the directory entries. The 
readdir() implementation passes entry offsets, starting from 1, to the 'off' 
argument of the passed filler function; the 'off' argument to the readdir() 
operation itself indicates the offset to begin passing entries from, which will 
be 1 less than the first entry offset passed to the filler function.

The current librefuse implementation currently only handles the former mode of 
operation; if the implementation uses the latter mode of operation, readdir() 
is only called once, thus potentially missing directory elements. The missed 
elements may be reachable via certain operations, but (for example) chdir()ing 
into a directory that is one of the missed entries will cause the shell to 
complain that it cannot resolve the current directory.
>How-To-Repeat:

>Fix:
This requires retooling of the puffs_fuse_node_readdir() function in 
src/lib/librefuse/refuse.c, along with the filler function 
puffs_fuse_fill_dir().



Home | Main Index | Thread Index | Old Index