]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/nfs/nfs_socket.c
xnu-517.9.5.tar.gz
[apple/xnu.git] / bsd / nfs / nfs_socket.c
index 047714c00a17262f39130f1af5213adc7cfa7c63..ff2f55066d0e05d3edf18ec5deea59a6d6fc2d0c 100644 (file)
@@ -1036,10 +1036,12 @@ errout:
                                    error,
                                 rep->r_nmp->nm_mountp->mnt_stat.f_mntfromname);
                        error = nfs_sndlock(rep);
                                    error,
                                 rep->r_nmp->nm_mountp->mnt_stat.f_mntfromname);
                        error = nfs_sndlock(rep);
-                       if (!error)
+                       if (!error) {
                                error = nfs_reconnect(rep);
                                error = nfs_reconnect(rep);
-                       if (!error)
-                               goto tryagain;
+                               if (!error)
+                                       goto tryagain;
+                               nfs_sndunlock(rep);
+                       }
                }
        } else {
                /*
                }
        } else {
                /*
@@ -1190,7 +1192,7 @@ nfs_reply(myrep)
                /*
                 * Bailout asap if nfsmount struct gone (unmounted). 
                 */
                /*
                 * Bailout asap if nfsmount struct gone (unmounted). 
                 */
-               if (!myrep->r_nmp || !nmp->nm_so) {
+               if (!myrep->r_nmp) {
                        FSDBG(530, myrep->r_xid, myrep, nmp, -2);
                        return (ENXIO);
                }
                        FSDBG(530, myrep->r_xid, myrep, nmp, -2);
                        return (ENXIO);
                }
@@ -1199,14 +1201,15 @@ nfs_reply(myrep)
                        nfs_rcvunlock(myrep);
 
                        /* Bailout asap if nfsmount struct gone (unmounted). */
                        nfs_rcvunlock(myrep);
 
                        /* Bailout asap if nfsmount struct gone (unmounted). */
-                       if (!myrep->r_nmp || !nmp->nm_so)
+                       if (!myrep->r_nmp)
                                return (ENXIO);
 
                        /*
                         * Ignore routing errors on connectionless protocols??
                         */
                        if (NFSIGNORE_SOERROR(nmp->nm_soflags, error)) {
                                return (ENXIO);
 
                        /*
                         * Ignore routing errors on connectionless protocols??
                         */
                        if (NFSIGNORE_SOERROR(nmp->nm_soflags, error)) {
-                               nmp->nm_so->so_error = 0;
+                               if (nmp->nm_so)
+                                       nmp->nm_so->so_error = 0;
                                if (myrep->r_flags & R_GETONEREP)
                                        return (0);
                                continue;
                                if (myrep->r_flags & R_GETONEREP)
                                        return (0);
                                continue;
@@ -1228,6 +1231,7 @@ nfs_reply(myrep)
                  * just check here and get out. (ekn)
                 */
                if (!mrep) {
                  * just check here and get out. (ekn)
                 */
                if (!mrep) {
+                       nfs_rcvunlock(myrep);
                         FSDBG(530, myrep->r_xid, myrep, nmp, -3);
                         return (ENXIO); /* sounds good */
                 }
                         FSDBG(530, myrep->r_xid, myrep, nmp, -3);
                         return (ENXIO); /* sounds good */
                 }