Page MenuHomeFreeBSD

Collection of fixes for exec/v_writecount handling.
ClosedPublic

Authored by kib on Sep 7 2019, 12:33 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 13 2024, 6:13 PM
Unknown Object (File)
Dec 22 2023, 10:51 PM
Unknown Object (File)
Nov 7 2023, 6:04 AM
Unknown Object (File)
Oct 6 2023, 5:01 AM
Unknown Object (File)
Sep 7 2023, 4:23 PM
Unknown Object (File)
Sep 1 2023, 7:30 PM
Unknown Object (File)
Sep 1 2023, 7:29 PM
Unknown Object (File)
Sep 1 2023, 7:29 PM

Details

Summary

[Each will be a separate commit]

  1. Remove unwanted code from the object deallocate. We track text mappings explicitly, there is no removal of the text refs on the object deallocate any more, so tmpfs objects should not be treated specially. Doing so causes excessive deref.
  2. In vm_object_coalesce(), avoid extending any OBJ_NOSPLIT objects, not only tmpfs backing.
  3. When loading ELF interpreter, initialize whole image_params with zero, otherwise we could mishandle imgp->textset.
  4. In do_execve(), switch to shared text vnode lock consistently.
  5. In do_execve(), clear imgp->textset when restarting for interpreter.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 26329

Event Timeline

sys/ufs/ufs/ufs_quota.c
620

Can you explain why this is needed? What happens when the text references are released following the quotaon()?

sys/ufs/ufs/ufs_quota.c
620

This is not about text refs, but to properly handle writers. The condition can be read as !WRITERS_EXIST(vp). If there are writers, we must attach dquot to the vnode, as if it happened during open for write.

Previously, !WRITERS_EXIST() was expressed as v_writecount == 0, but now it is <= 0.

This revision is now accepted and ready to land.Sep 7 2019, 2:42 PM

What scenario would ever have v_writecount be less than zero?

What scenario would ever have v_writecount be less than zero?

I removed VV_TEXT and made v_writecount count either writers for positive values, or text mappings for negative. Much more details are available at https://www.freebsd.org/news/status/report-2019-04-2019-06.html#Locking-changes-for-vnodes-during-execve(2)