Page MenuHomeFreeBSD

Make pseudofs(9) create directory entries in order
ClosedPublic

Authored by trasz on Sep 6 2019, 1:07 PM.
Tags
None
Referenced Files
F106153225: D21550.id61832.diff
Thu, Dec 26, 6:44 AM
Unknown Object (File)
Sat, Dec 21, 3:39 PM
Unknown Object (File)
Tue, Dec 10, 5:22 AM
Unknown Object (File)
Wed, Nov 27, 6:55 PM
Unknown Object (File)
Nov 23 2024, 12:19 PM
Unknown Object (File)
Nov 23 2024, 8:38 AM
Unknown Object (File)
Oct 25 2024, 2:26 PM
Unknown Object (File)
Oct 2 2024, 5:01 AM
Subscribers

Details

Summary

Make pseudofs(9) create directory entries in order, instead
of the reverse.

This fixes Linux sysctl(8) binary - it assumes the first two
directory entries are always "." and "..". There might be other
Linux apps affected by this.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/fs/pseudofs/pseudofs.c
145 ↗(On Diff #61728)

I think you do not need this check, instead fold it with the previous pn_nodes == NULL branch. KASSERT() there demonstrates it nicely.

172 ↗(On Diff #61728)

What if pn_next never equal to pn ?

trasz marked an inline comment as done.

Fixes from kib.

Thanks; does the updated version look ok?

Did you considered switching to sys/queue.h ?

This revision is now accepted and ready to land.Sep 9 2019, 12:41 PM

I've thought about it; I guess des@ hadn't used that to avoid contaminating pseudofs headers with queue.h, and I didn't want to change it.

I've thought about it; I guess des@ hadn't used that to avoid contaminating pseudofs headers with queue.h, and I didn't want to change it.

Lets take a look. Very first line of pseudofs.h includes sys/jail.h. In sys/jail.h line 121 we see inclusion of sys/queue.h.