NetBSD Problem Report #45105

From  Wed Jun 29 03:06:54 2011
Return-Path: <>
Received: from ( [])
	by (Postfix) with ESMTP id B6ACE63C9A4
	for <>; Wed, 29 Jun 2011 03:06:54 +0000 (UTC)
Message-Id: <>
Date: Wed, 29 Jun 2011 03:06:52 +0000 (UTC)
Subject: readdir() in FUSE implementations only called once
X-Send-Pr-Version: www-1.0

>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
NetBSD 5.1 NetBSD 5.1 (GENERIC) #0: Sat Nov  6 13:19:33 UTC 2010 amd64
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.

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

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD:,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.