Setting the error flag of the mntfs for which the share
authorChristos Zoulas <christos@zoulas.com>
Thu, 10 Dec 2009 17:51:00 +0000 (12:51 -0500)
committerChristos Zoulas <christos@zoulas.com>
Thu, 10 Dec 2009 17:51:00 +0000 (12:51 -0500)
is already mounted results in the mount point not being
removed when it times out. (Amd considers it an error
mntfs and thus umount becomse a no-op.)
From: Krisztian Kovacs <Kris.Kovacs@morganstanley.com>

ChangeLog
amd/amfs_generic.c

index 580f1de28456678afdf60b9f195132de4849c1f6..0dcfb3cae333142e4c8b8379b97aee22d940acd3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2009-12-10  Christos Zoulas <christos@zoulas.com>
 
+       * Setting the error flag of the mntfs for which the share
+         is already mounted results in the mount point not being
+         removed when it times out. (Amd considers it an error
+         mntfs and thus umount becomse a no-op.)
+         From: Krisztian Kovacs <Kris.Kovacs@morganstanley.com>
+
        * Right now AMD sets all timeout values to their defaults
          even if you explicitly set them to zero. This patch
          introduces separate flags that store if the respective
index 4f1789d9a0fd00545c5209262f83e93117571857..502db7c28e7c9abdfe2ac24f5a82730c7abd7f0c 100644 (file)
@@ -892,16 +892,19 @@ amfs_bgmount(struct continuation *cp)
     return -1;
 
   failed:
-    amd_stats.d_merr++;
-    mf->mf_error = this_error;
-    mf->mf_flags |= MFF_ERROR;
+    if (!FSRV_ISDOWN(mf->mf_server)) {
+      /* mark the mount as failed unless the server is down */
+      amd_stats.d_merr++;
+      mf->mf_error = this_error;
+      mf->mf_flags |= MFF_ERROR;
 #ifdef HAVE_FS_AUTOFS
-    if (mp->am_autofs_fh)
-      autofs_release_fh(mp);
+      if (mp->am_autofs_fh)
+       autofs_release_fh(mp);
 #endif /* HAVE_FS_AUTOFS */
-    if (mf->mf_flags & MFF_MKMNT) {
-      rmdirs(mf->mf_mount);
-      mf->mf_flags &= ~MFF_MKMNT;
+      if (mf->mf_flags & MFF_MKMNT) {
+       rmdirs(mf->mf_mount);
+       mf->mf_flags &= ~MFF_MKMNT;
+      }
     }
     /*
      * Wakeup anything waiting for this mount