[systemd-devel] how to handle filesystems that do not support d_type in readdirs dirent?

Andrey Borzenkov arvidjaar at mail.ru
Thu Mar 3 04:52:24 PST 2011


On Thu, Mar 3, 2011 at 3:05 PM, Marius Tolzmann <tolzmann at molgen.mpg.de> wrote:
>
> hello..
>
> we are currently using reiserfs on our root-partition..
>
> since reiserfs always sets d_type to DT_UNKNOWN in dirent entries some tools
> like systemd-tmpfiles do not work as expected.
>

Hmm .. this could be the reason for my problem with utmp:

http://lists.freedesktop.org/archives/systemd-devel/2011-March/001433.html

> in src/util.c:3905 DT_UNKNOWN is already included when checking file for
> type DT_REG or DT_LNK.
>

Do not assume that everyone is having exactly the same sources as you
:) Either include exact commit number for reference, or better just
name function; they are mostly small enough.

> since there seems to be no special handling for symlinks (e.g. checking the
> type of the symlinks destionation) i just fixed scandir_filter to also
> accept DT_UNKNOWN.
>
> (other) places where DT_REG checks may fail on reiserfs or other fs that
> don't support setting the correct type of file in d_type:
>
> src/tty-ask-password-agent.c:510: if (de->d_type != DT_REG)
> src/modules-load.c:45: if (d->d_type != DT_REG &&
> src/tmpfiles.c:781: if (d->d_type != DT_REG &&
>
> .. how is this supposed to be handled?


Care to provide a patch to include missing DT_UNKNOWN in all places? :)


More information about the systemd-devel mailing list