From: Amit Gud <agud@redhat.com>
To: Neil Brown <neilb@suse.de>
Cc: nfs@lists.sourceforge.net, Steve Dickson <SteveD@redhat.com>
Subject: [PATCH] fix lazy and force umounts for mount.nfs
Date: Fri, 28 Jul 2006 11:54:06 -0400 [thread overview]
Message-ID: <44CA331E.2080004@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 65 bytes --]
AG
--
May the source be with you.
http://www.cis.ksu.edu/~gud
[-- Attachment #2: lazy-umount-fix-v1.patch --]
[-- Type: text/plain, Size: 1791 bytes --]
Fixes lazy umount freezing when NFS server is down or unreachable. This
enables lazy and force umounting possible without bothering the server.
This is useful when NFS server is down or unreachable.
Signed-off-by: Amit Gud <agud@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
---
--- nfs-utils/utils/mount/nfsumount.c 2006-07-25 11:10:45.000000000 -0400
+++ nfs-utils-ag/utils/mount/nfsumount.c 2006-07-25 16:03:32.000000000 -0400
@@ -100,9 +100,9 @@ int nfs_call_umount(clnt_addr_t *mnt_ser
}
mnt_closeclnt(clnt, msock);
if (res == RPC_SUCCESS)
- return 1;
+ return 0;
out_bad:
- return 0;
+ return 1;
}
u_int get_mntproto(const char *);
@@ -251,9 +251,6 @@ int add_mtab2(const char *spec, const ch
return 1;
}
-/*
- * Returns 1 if everything went well, else 0.
- */
int _nfsumount(const char *spec, const char *opts)
{
char *hostname;
@@ -309,8 +306,8 @@ int _nfsumount(const char *spec, const c
goto out_bad;
return nfs_call_umount(&mnt_server, &dirname);
out_bad:
- fprintf(stderr, "%s: %s: not found or not mounted\n", progname, spec);
- return 0;
+ fprintf(stderr, "%s: %s: not found / mounted or server not reachable\n", progname, spec);
+ return 1;
}
static struct option umount_longopts[] =
@@ -393,14 +390,18 @@ int nfsumount(int argc, char *argv[])
}
}
- ret = _nfsumount(mc->m.mnt_fsname, mc->m.mnt_opts);
- if(ret)
+ ret = 0;
+ if(!force && !lazy)
+ ret = _nfsumount(mc->m.mnt_fsname, mc->m.mnt_opts);
+ if(!ret)
ret = add_mtab2(mc->m.mnt_fsname, mc->m.mnt_dir,
mc->m.mnt_type, mc->m.mnt_opts, mc);
}
else {
- ret = _nfsumount(spec, NULL);
- if(ret)
+ ret = 0;
+ if(!force && !lazy)
+ ret = _nfsumount(spec, NULL);
+ if(!ret)
ret = add_mtab2(spec, spec, spec, spec, NULL);
}
[-- Attachment #3: Type: text/plain, Size: 348 bytes --]
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
[-- Attachment #4: Type: text/plain, Size: 140 bytes --]
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
next reply other threads:[~2006-07-28 15:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-28 15:54 Amit Gud [this message]
2006-07-28 16:20 ` [PATCH] fix lazy and force umounts for mount.nfs Garrick Staples
2006-07-29 7:20 ` Amit Gud
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44CA331E.2080004@redhat.com \
--to=agud@redhat.com \
--cc=SteveD@redhat.com \
--cc=neilb@suse.de \
--cc=nfs@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.