spd_readdir.c and readdir_r

Ross Boylan ross at biostat.ucsf.edu
Sun Jun 8 05:30:38 UTC 2008

I still haven't been able to pinpoint exactly where bacula hangs up when
LD_PRELOAD is set to use spd_readdir, but I have a suspect.  bacula-fd
gets directory entries with readdir_r, which is a function that is not
reimplemented in spd_readdir.

So when bacula calls opendir it gets the shadow version, which calls the
original open, read, and closedir functions.  It then returns its
private dir_s structure.  The (unshadowed) readdir_r then tries to work
with dir_s.

It looks as if I (or one of you gurus?) need to implement a wrapper for
readdir_r.  A quick looks suggests there may be a couple of subtleties
(the spd_readdir struct dir_s is allocated, and so thread safe, but it's
dir entry is not; and readdir_r is expecting some "real" system data
structures back and users may have problems with fake ones).


More information about the Ext3-users mailing list