Page MenuHomeFreeBSD

nfscl: Clear out a lot of cruft related to B_DIRECT that is never executed
ClosedPublic

Authored by rmacklem on Apr 27 2024, 3:29 AM.
Tags
None
Referenced Files
F122039392: D44980.id.diff
Tue, Jul 1, 4:34 PM
F122023854: D44980.id137764.diff
Tue, Jul 1, 1:25 PM
Unknown Object (File)
Mon, Jun 30, 2:47 PM
Unknown Object (File)
Mon, Jun 30, 3:57 AM
Unknown Object (File)
Mon, Jun 30, 2:05 AM
Unknown Object (File)
Mon, Jun 30, 1:10 AM
Unknown Object (File)
Mon, Jun 30, 12:36 AM
Unknown Object (File)
Sun, Jun 29, 6:17 PM
Subscribers

Details

Summary

There is only one place in the unpatched sources where B_DIRECT is
set in the NFS client and this code is never executed. As such, this patch
removes this code that is never executed, since B_DIRECT should never
be set.

During a IETF testing event this week, I saw a crash in ncl_doio_directwrite(),
but this function is only called if B_DIRECT is set.
I cannot explain how ncl_doio_directwrite() got called, but once this patch
was applied to the sources, the crash did not recur. This is not surprising,
since this patch deleted the function.

Test Plan

Tested as a part of the IETF bakeathon this week and no further
crashes occurred. I have also put it through my typical NFS tests.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/fs/nfsclient/nfs_clbio.c
803
805
1615

Might be assert that B_DIRECT is not set?

sys/fs/nfsclient/nfs_clnfsiod.c
294

Again, assert?

rmacklem marked an inline comment as done.

Made the changes suggested by kib@.

This revision is now accepted and ready to land.Apr 27 2024, 11:06 PM