Linux NFS development
 help / color / mirror / Atom feed
From: Wendy Cheng <s.wendy.cheng@gmail.com>
To: Janne Karhunen <janne.karhunen@gmail.com>
Cc: "J. Bruce Fields" <bfields@fieldses.org>,
	Peter Staubach <staubach@redhat.com>,
	linux-nfs@vger.kernel.org
Subject: Re: [patch] fix statd -n
Date: Fri, 02 May 2008 11:21:18 -0400	[thread overview]
Message-ID: <481B316E.8090800@gmail.com> (raw)
In-Reply-To: <24c1515f0805010628k6b57598btb27116c719b99fad-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1818 bytes --]

Janne Karhunen wrote:
> Hi,
>
> So effectively, it makes me sleep better. With it:
> - I can rely on clients identifying the server correctly,
> - I'm not exposing out anything that is not needed,
> - Can tell by the address what this traffic is,
> - Can be sure that packets are sent out via right interface
>
> It might be even better if it would exit if -n is used when
> no such interface is actually available. As I did it, it still
> gambles here just as before.
>
>   

After browsing thru "statd -n" flow, it is still not clear what will 
happen if there are more than 2 interfaces used to export NFS shares ? 

Using "statd -H", together with patches described in:
https://www.redhat.com/archives/cluster-devel/2007-April/msg00028.html ,

our cluster failover (with 4 IP interfaces per server) seemed to run 
well without troubles. Note that 2/3 of the patch in 4-3 can be removed 
*now* since it deals with moving server address from network header into 
lockd internal structures - another similar patch (by Frank van 
Maarseveen) was accepted into mainline kernel after our patch that has 
the required functionality:
http://lkml.org/lkml/2007/7/10/553 .

So the following is our (-H) flow:
* Server dispatches statd with "-N" option that has a user mode script
   (sample program fotest.c enclosed). It is expected the user mode script
   could structure its nlm directory accordingly.
* Upon failover, the take-over server notifies clients with:
   "/usr/sbin/sm-notify -f -v floating_ip_address -P an_sm_directory"

The advantages of "-H" approach over "-n" are (I think ?):
* It can handle multiple NFS export network interfaces.
* It knows which clients coming from which interfaces to allow selective 
grace period for each interface.

In many ways, I would think "-n" should be obsolete ?

-- Wendy

[-- Attachment #2: fotest.c --]
[-- Type: text/x-csrc, Size: 1163 bytes --]

#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <sys/stat.h>      /* for mode_t */

void usage() 
{

	printf("\n");
	printf("    check out \"man rpc.statd\":\n");
	printf("    This callout program should receive callouts for\n");
	printf("    NLM  client  monitor and unmonitor requests. It is\n");
	printf("    run with 3 arguments: \n"); 
	printf("    1st: either add-client or del-client\n");
	printf("    2nd: the name of the client\n");
	printf("    3rd: the name of the server as known to the client.\n");

	return;
}

int main (int argc, char* argv[]) 
{
        char* file = "/tmp/NLM/from-ha";
        mode_t rw_mode;
        int rc, debug=0, i;
	FILE *fd;
        struct flock lock;

        /* Open a file descriptor to the file.  */
        rw_mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;     /* 0644 */
        fd = fopen(file, "a+");

	fprintf(fd, "%s is invoked with %d arguments.\n", argv[0], argc - 1); 
	if (argc != 4) {
		fprintf (fd, "    error: invalid arguments\n");
		debug = 1;
	}

	for (i = 1; i < argc; ++i) 
		fprintf (fd, "    %s\n", argv[i]); 

	fclose(fd);

	return 0; 
} 


  parent reply	other threads:[~2008-05-02 15:19 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-17 16:38 [patch] fix statd -n Janne Karhunen
     [not found] ` <24c1515f0804170938s23fe3ea3pfe77355ed01d8bbf-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-04-18 17:36   ` J. Bruce Fields
2008-04-18 18:11     ` Janne Karhunen
     [not found]       ` <24c1515f0804181111x465d7083o4b78e1ba36b51cb-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-04-18 18:25         ` J. Bruce Fields
2008-04-18 18:31           ` Janne Karhunen
     [not found]             ` <24c1515f0804181131i238a50a7v85ef80299ec2216f-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-04-18 18:34               ` J. Bruce Fields
2008-04-18 18:55                 ` Janne Karhunen
2008-04-18 19:46                 ` Janne Karhunen
2008-04-18 20:22         ` Peter Staubach
2008-04-18 20:39           ` Janne Karhunen
2008-04-18 18:20     ` Wendy Cheng
2008-04-18 20:21     ` Peter Staubach
2008-04-18 20:23       ` Peter Staubach
2008-04-18 20:32         ` J. Bruce Fields
2008-04-18 20:46           ` Janne Karhunen
     [not found]             ` <24c1515f0804181346g5867fa1fqfbbcd13af25027cb-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-04-21  0:02               ` J. Bruce Fields
2008-04-21  0:49                 ` Janne Karhunen
     [not found]                   ` <24c1515f0804201749x47bee916y9970fe1102bfb5-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-04-21  2:11                     ` J. Bruce Fields
2008-04-21 11:01                       ` Jeff Layton
     [not found]                         ` <20080421070107.454cfad2-RtJpwOs3+0O+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2008-04-21 13:39                           ` J. Bruce Fields
2008-04-21 14:10                             ` Jeff Layton
     [not found]                               ` <20080421101003.4e9d85a6-RtJpwOs3+0O+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2008-04-21 17:32                                 ` J. Bruce Fields
2008-04-21 17:55                                   ` Jeff Layton
2008-04-21 18:28                                   ` Wendy Cheng
2008-04-21 15:01                       ` Chuck Lever
2008-04-21 15:40                         ` Janne Karhunen
2008-04-21 14:46                 ` Janne Karhunen
     [not found]                   ` <24c1515f0804210746t2d392b8ct6575f09dc7254b07-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-04-21 16:59                     ` J. Bruce Fields
2008-04-21 17:25                       ` Janne Karhunen
2008-04-28 20:52                 ` Janne Karhunen
     [not found]                   ` <24c1515f0804281352u2d04ac89i820dc6807dde39f1-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-04-29 14:45                     ` Wendy Cheng
2008-04-29 16:16                       ` J. Bruce Fields
2008-05-01 12:57                         ` Janne Karhunen
     [not found]                           ` <24c1515f0805010557o5daf72f7hc3db5bf85354898e-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-05-01 13:28                             ` Janne Karhunen
     [not found]                               ` <24c1515f0805010628k6b57598btb27116c719b99fad-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-05-01 13:50                                 ` Wendy Cheng
2008-05-01 13:58                                   ` Janne Karhunen
2008-05-02 15:21                                 ` Wendy Cheng [this message]
2008-05-02 15:24                                   ` Wendy Cheng
2008-05-02 21:13                                   ` Janne Karhunen
     [not found]                                     ` <24c1515f0805021413u450d8bbcr806a90c327b287a1-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-05-02 21:15                                       ` Janne Karhunen
2008-05-02 22:33                                       ` Wendy Cheng
2008-05-02 22:54                                         ` Janne Karhunen
     [not found]                                           ` <24c1515f0805021554u483c471bm61cf3a6d8d434b45-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-05-03 15:29                                             ` Wendy Cheng
2008-05-03 17:31                                               ` Janne Karhunen
2008-05-03  0:24                                         ` Janne Karhunen
     [not found]                                           ` <24c1515f0805021724q7dfe5294r702a9c8ffde01129-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-05-05 14:45                                             ` J. Bruce Fields
2008-05-05 14:59                                               ` Wendy Cheng
2008-05-05 15:01                                                 ` Janne Karhunen
     [not found]                                                   ` <24c1515f0805050801m66cce68k94073914ba26511e-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-05-05 15:21                                                     ` Wendy Cheng
2008-05-05 15:23                                                       ` Janne Karhunen
     [not found]                                                         ` <24c1515f0805050823s14f4caf7s3a4ff06a70c220be-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-05-05 15:25                                                           ` J. Bruce Fields
2008-05-05 15:28                                                             ` Janne Karhunen
     [not found]                                                               ` <24c1515f0805050828o3aa5b33aod2a6e4e0b5b6c9dc-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-05-05 15:58                                                                 ` J. Bruce Fields
2008-05-05 16:42                                                                   ` Janne Karhunen
     [not found]                                                                     ` <24c1515f0805050942h26a0aaefi471216482fbabef5-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-05-05 17:02                                                                       ` J. Bruce Fields
2008-05-05 17:10                                                                         ` Janne Karhunen
2008-05-05 16:00                                                                 ` Wendy Cheng
2008-05-05 16:14                                                                   ` Janne Karhunen
2008-05-05 15:25                                                           ` Janne Karhunen

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=481B316E.8090800@gmail.com \
    --to=s.wendy.cheng@gmail.com \
    --cc=bfields@fieldses.org \
    --cc=janne.karhunen@gmail.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=staubach@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox