Skip to content

Commit

Permalink
md: round-trip the MUSTDEALLOC and RESERVE options
Browse files Browse the repository at this point in the history
If those options are requested when the device is created, ensure that
they will be reported by MDIOCQUERY.

Reviewed by:	imp
Pull Request:	#1270

(cherry picked from commit 9d449ca)
  • Loading branch information
asomers committed Jun 15, 2024
1 parent e6ecffc commit 35e9830
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sys/dev/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 35e9830

Please sign in to comment.