Fix backwards MD_VERIFY logic for md devices.

If the MD_VERIFY flag is set, we should use O_VERIFY. If the MD_VERIFY flag
is not set, we should not.

Reviewed by:	stevek
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D13814
This commit is contained in:
Jonathan T. Looney 2018-01-10 00:08:57 +00:00
parent 7e40918452
commit f05c495660
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=327754

View File

@ -1392,7 +1392,7 @@ mdcreate_vnode(struct md_s *sc, struct md_ioctl *mdio, struct thread *td)
* set the FWRITE mask before trying to open the backing store.
*/
flags = FREAD | ((mdio->md_options & MD_READONLY) ? 0 : FWRITE) \
| ((mdio->md_options & MD_VERIFY) ? 0 : O_VERIFY);
| ((mdio->md_options & MD_VERIFY) ? O_VERIFY : 0);
NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, sc->file, td);
error = vn_open(&nd, &flags, 0, NULL);
if (error != 0)