Ted Unangst wrote:
> i removed these last two lines, since they were incorrect. thanks for spotting
> that. however the vop_close at the end still needs updating.

Thanks Ted,

Also I found another stray VOP_CLOSE() setup.

I have also put in the VOP_OPEN(vn, FREAD, ...) as I am not sure about 100% 
clear on what you mean by "the vop_close at the end still needs updating."

Do you mean it needs to actually be called with VOP_CLOSE(vn, FREAD | FWRITE, 
...)?

I am also confused by the opening of the key disk in read-write mode, when 
there doesn't seem to be any obvious need to write to it; what bit of metadata 
needs to be updated? All I see it doing is preventing the possibility of using 
write-protected key disks.


Index: sys/dev/softraid_crypto.c
===================================================================
RCS file: /cvs/src/sys/dev/softraid_crypto.c,v
retrieving revision 1.126
diff -u -p -r1.126 softraid_crypto.c
--- sys/dev/softraid_crypto.c   12 Apr 2016 16:26:54 -0000      1.126
+++ sys/dev/softraid_crypto.c   17 May 2016 10:13:02 -0000
@@ -797,7 +797,7 @@ sr_crypto_read_key_disk(struct sr_discip
                sr_error(sc, "cannot open key disk %s", devname);
                goto done;
        }
-       if (VOP_OPEN(vn, FREAD | FWRITE, NOCRED, curproc)) {
+       if (VOP_OPEN(vn, FREAD, NOCRED, curproc)) {
                DNPRINTF(SR_D_META,"%s: sr_crypto_read_key_disk cannot "
                    "open %s\n", DEVNAME(sc), devname);
                vput(vn);
@@ -811,8 +811,6 @@ sr_crypto_read_key_disk(struct sr_discip
            NOCRED, curproc)) {
                DNPRINTF(SR_D_META, "%s: sr_crypto_read_key_disk ioctl "
                    "failed\n", DEVNAME(sc));
-               VOP_CLOSE(vn, FREAD | FWRITE, NOCRED, curproc);
-               vput(vn);
                goto done;
        }
        if (label.d_partitions[part].p_fstype != FS_RAID) {

Reply via email to