git: 35e983028356 - stable/14 - md: round-trip the MUSTDEALLOC and RESERVE options

From: Alan Somers <asomers_at_FreeBSD.org>
Date: Sat, 15 Jun 2024 13:03:34 UTC
The branch stable/14 has been updated by asomers:

URL: https://cgit.FreeBSD.org/src/commit/?id=35e9830283561820a1fcb21b46b6f01e87700dec

commit 35e9830283561820a1fcb21b46b6f01e87700dec
Author:     Alan Somers <asomers@FreeBSD.org>
AuthorDate: 2024-06-01 18:00:03 +0000
Commit:     Alan Somers <asomers@FreeBSD.org>
CommitDate: 2024-06-15 13:03:23 +0000

    md: round-trip the MUSTDEALLOC and RESERVE options
    
    If those options are requested when the device is created, ensure that
    they will be reported by MDIOCQUERY.
    
    Reviewed by:    imp
    Pull Request:   https://github.com/freebsd/freebsd-src/pull/1270
    
    (cherry picked from commit 9d449caddd4f442ba4ebfd2edafa1aef4fcba4c8)
---
 sys/dev/md/md.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c
index a6f015962a24..1d531b88193f 100644
--- a/sys/dev/md/md.c
+++ b/sys/dev/md/md.c
@@ -1351,7 +1351,7 @@ mdcreate_malloc(struct md_s *sc, struct md_req *mdr)
 		sc->fwsectors = mdr->md_fwsectors;
 	if (mdr->md_fwheads != 0)
 		sc->fwheads = mdr->md_fwheads;
-	sc->flags = mdr->md_options & (MD_COMPRESS | MD_FORCE);
+	sc->flags = mdr->md_options & (MD_COMPRESS | MD_FORCE | MD_RESERVE);
 	sc->indir = dimension(sc->mediasize / sc->sectorsize);
 	sc->uma = uma_zcreate(sc->name, sc->sectorsize, NULL, NULL, NULL, NULL,
 	    0x1ff, 0);
@@ -1476,7 +1476,7 @@ mdcreate_vnode(struct md_s *sc, struct md_req *mdr, struct thread *td)
 	snprintf(sc->ident, sizeof(sc->ident), "MD-DEV%ju-INO%ju",
 	    (uintmax_t)vattr.va_fsid, (uintmax_t)vattr.va_fileid);
 	sc->flags = mdr->md_options & (MD_ASYNC | MD_CACHE | MD_FORCE |
-	    MD_VERIFY);
+	    MD_VERIFY | MD_MUSTDEALLOC);
 	if (!(flags & FWRITE))
 		sc->flags |= MD_READONLY;
 	sc->vnode = nd.ni_vp;