Page MenuHomeFreeBSD

md: Add MD_MUSTDEALLOC support
ClosedPublic

Authored by khng on Sep 8 2021, 6:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Mar 26, 3:50 AM
Unknown Object (File)
Feb 22 2024, 7:11 PM
Unknown Object (File)
Feb 22 2024, 7:07 PM
Unknown Object (File)
Feb 7 2024, 3:04 AM
Unknown Object (File)
Feb 3 2024, 10:34 PM
Unknown Object (File)
Jan 15 2024, 7:19 AM
Unknown Object (File)
Dec 29 2023, 4:41 PM
Unknown Object (File)
Dec 22 2023, 10:02 PM
Subscribers

Details

Summary

This adds an option to detect if hole-punching is implemented by the
underlying file system. If this flag is set, and if the underlying file
system does not support hole-punching, md(4) fails BIO_DELETE requests
by returning unsupported.

Sponsored by: The FreeBSD Foundation

Diff Detail

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

Event Timeline

khng requested review of this revision.Sep 8 2021, 6:41 PM

Looks ok, but why not silently fall back to a default implementation for VOP_DEALLOCATE()?

sbin/mdconfig/mdconfig.8
290
sbin/mdconfig/mdconfig.c
93

Keep them sorted?

Looks ok, but why not silently fall back to a default implementation for VOP_DEALLOCATE()?

Eh, sorry, I misunderstood.

khng marked 2 inline comments as done.

markj@'s suggestion

sbin/mdconfig/mdconfig.8
288

I think it could be a bit more clear:

  • Start the description with "For .Cm vnode backed devices:" like other vnode-specific option descriptions.
  • What happens if the file system does support hole-punching?
  • What happens when autounmap is not specified and BIO_DELETE is received?
  • Probably reference fspacectl.2 or just briefly describe the meaning of "hole-punching".

"autounmap" also seems like a somewhat strange name to me. Is it named after something similar elsewhere?

sbin/mdconfig/mdconfig.c
221

These should be sorted.

sbin/mdconfig/mdconfig.8
288

Do you think "mayunmap" is a better name?

sbin/mdconfig/mdconfig.8
288

Is "unmap" the usual terminology? fspacectl.2 refers to space deallocation, and we have _PC_DEALLOC_PRESENT, so maybe "mustdealloc"?

khng retitled this revision from md: Add MD_AUTOUNMAP support to md: Add MD_MUSTDEALLOC support.Sep 8 2021, 8:03 PM
  • MD_AUTOUNMAP -> MD_MUSTDEALLOC
  • Clarifications on behavior regarding with/without the flag
  • Sort the options over the code and manpage

Looks ok to me, just nit-picking the manual page changes.

sbin/mdconfig/mdconfig.8
252
254
256
260
263
265
271
This revision is now accepted and ready to land.Sep 10 2021, 1:25 PM
This revision was automatically updated to reflect the committed changes.
khng marked 7 inline comments as done.