[RFC,PATCH] libfs dcache_readdir() and dcache_dir_lseek() bugfix
jblunck_at_suse.de
Date: 11/04/05
- Previous message: Bernd Petrovitsch: "Re: [patch] swapin rlimit"
- Next in thread: Al Viro: "Re: [RFC,PATCH] libfs dcache_readdir() and dcache_dir_lseek() bugfix"
- Reply: Al Viro: "Re: [RFC,PATCH] libfs dcache_readdir() and dcache_dir_lseek() bugfix"
- Reply: Jörn Engel: "Re: [RFC,PATCH] libfs dcache_readdir() and dcache_dir_lseek() bugfix"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 4 Nov 2005 12:38:51 +0100 To: linux-kernel@vger.kernel.org "From: jblunck@suse.de"
This patch effects all users of libfs' dcache directory implementation.
Old glibc implementations (e.g. glibc-2.2.5) are lseeking after every call to
getdents(), subsequent calls to getdents() are starting to read from a wrong
f_pos, when the directory is modified in between. Therefore not all directory
entries are returned. IMHO this is a bug and it breaks applications, e.g. "rm
-fr" on tmpfs.
SuSV3 only says:
"If a file is removed from or added to the directory after the most recent
call to opendir() or rewinddir(), whether a subsequent call to readdir_r()
returns an entry for that file is unspecified."
Although I tried to provide a small fix, this is a complete rework of the
libfs' dcache_readdir() and dcache_dir_lseek(). This patch use the dentries
name hashes as the offsets for the directory entries. I'm not that sure it is
maybe a problem to use full_name_hash() for that. If hash collisions occur,
readdir() might return duplicate entries after an lseek(). Any ideas?
This patch is compile and boot tested. This patch is against 2.6.14-git of
today.
Comments, please.
Jan
-- Jan Blunck jblunck@suse.de SuSE LINUX AG - A Novell company Maxfeldstr. 5 +49-911-74053-608 D-90409 Nürnberg http://www.suse.de
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- text/plain attachment: test1.c
- text/plain attachment: libfs-dcache_readdir_lseek-fix.diff
- Previous message: Bernd Petrovitsch: "Re: [patch] swapin rlimit"
- Next in thread: Al Viro: "Re: [RFC,PATCH] libfs dcache_readdir() and dcache_dir_lseek() bugfix"
- Reply: Al Viro: "Re: [RFC,PATCH] libfs dcache_readdir() and dcache_dir_lseek() bugfix"
- Reply: Jörn Engel: "Re: [RFC,PATCH] libfs dcache_readdir() and dcache_dir_lseek() bugfix"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|