In sr_hotspare(), the error path of VOP_IOCTL() appears to do a
redundant VOP_CLOSE() and vput(). The diff below fixes that. The fail
branch will close the vnode because `open' is true.

OK?

Index: dev/softraid.c
===================================================================
RCS file: src/sys/dev/softraid.c,v
retrieving revision 1.399
diff -u -p -r1.399 softraid.c
--- dev/softraid.c      10 Mar 2020 08:41:19 -0000      1.399
+++ dev/softraid.c      5 Apr 2020 12:08:08 -0000
@@ -2846,8 +2846,6 @@ sr_hotspare(struct sr_softc *sc, dev_t d
            NOCRED, curproc)) {
                DNPRINTF(SR_D_META, "%s: sr_hotspare ioctl failed\n",
                    DEVNAME(sc));
-               VOP_CLOSE(vn, FREAD | FWRITE, NOCRED, curproc);
-               vput(vn);
                goto fail;
        }
        if (label.d_partitions[part].p_fstype != FS_RAID) {

Reply via email to