Page MenuHomeFreeBSD

md: Add MD_MUSTDEALLOC support
ClosedPublic

Authored by khng on Wed, Sep 8, 6:41 PM.

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
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

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

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

sbin/mdconfig/mdconfig.8
289
sbin/mdconfig/mdconfig.c
92

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
287

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
220

These should be sorted.

sbin/mdconfig/mdconfig.8
287

Do you think "mayunmap" is a better name?

sbin/mdconfig/mdconfig.8
287

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.Wed, Sep 8, 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
251
253
255
259
262
264
270
This revision is now accepted and ready to land.Fri, Sep 10, 1:25 PM
This revision was automatically updated to reflect the committed changes.
khng marked 7 inline comments as done.