All of lore.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: James Pearson <james-p@moving-picture.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: How to control the order of different export options for different client formats?
Date: Wed, 18 May 2011 08:01:06 +1000	[thread overview]
Message-ID: <20110518080106.1159c5b8@notabene.brown> (raw)
In-Reply-To: <4DD2A084.1040905@moving-picture.com>

On Tue, 17 May 2011 17:21:24 +0100 James Pearson <james-p@moving-picture.com>
wrote:

> I'm using CentOS 5.x (nfs-utils based on v1.0.9) - and have been using 
> the following in /etc/exports:
> 
> /export *(rw,async) @backup(rw,no_root_squash,async)
> 
> which works fine - hosts in the backup NIS netgroup mount the file 
> system with no_root_squash and other clients with root_squash
> 
> However, I now want to restrict the export to all clients in a single 
> subnet - so I now have /etc/exports as:
> 
> /export 172.16.0.0/20(rw,async) @backup(rw,no_root_squash,async)
> 
> Unfortunately, hosts in the backup NIS netgroup (which are also in the 
> 172.16.0.0/20 subnet) no longer mount with no_root_squash
> 
> It appears that the subnet export takes precedence over the netgroup 
> export (it doesn't matter in what order the subnets/netgroups exports 
> are listed in /etc/exports) - so the netgroup client options are ignored 
> as a match has already been found in the subnet export.
> 
> Is there any way to control the order in which clients are checked for 
> export options?
> 
> i.e. I would like netgroups to take precedence over subnets

Unfortunately you cannot do that.

The place in the code where this is determined is towards the end of
'lookup_export' in utils/mountd/cache.c

Were I to try to 'fix' this I would probably define a new field in 'struct
exportent' which holds a 'priority'.

Then allow a setting like "priority=4" in /etc/exports

Then change the code in lookup_export to choose the one with the higher
priority, rather than the 'first' one.

NeilBrown

  reply	other threads:[~2011-05-17 22:01 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-17 16:21 How to control the order of different export options for different client formats? James Pearson
2011-05-17 22:01 ` NeilBrown [this message]
2011-05-18 10:19   ` James Pearson
2011-05-18 11:54     ` Performance Issue with multiple dataserver Taousif_Ansari
2011-05-18 16:12       ` J. Bruce Fields
2011-05-19  5:26         ` Taousif_Ansari
2011-05-19 11:50           ` J. Bruce Fields
2011-05-19 12:39             ` Taousif_Ansari
2011-05-19 13:12               ` J. Bruce Fields
2011-05-19 13:14                 ` Taousif_Ansari
2011-05-19 13:43                   ` J. Bruce Fields
2011-05-19 14:09                     ` Taousif_Ansari-G5Y5guI6XLZWk0Htik3J/w
2011-05-19 14:37                       ` Shyam_Iyer
2011-05-24 11:39                         ` Taousif_Ansari
2011-05-24 11:44                           ` Steven Whitehouse
2011-05-24 11:44                             ` [Cluster-devel] " Steven Whitehouse
2011-05-24 13:17                             ` J. Bruce Fields
2011-05-24 13:17                               ` [Cluster-devel] " J. Bruce Fields
2011-05-18 16:20     ` How to control the order of different export options for different client formats? J. Bruce Fields
2011-05-20 13:38       ` James Pearson
2011-05-20 16:41         ` J. Bruce Fields
2011-06-02 13:37           ` James Pearson
2011-06-04 18:20             ` J. Bruce Fields
2011-06-06 12:14               ` James Pearson
     [not found]             ` <4DE79236.1080808-5Ol4pYTxKWu0ML75eksnrtBPR1lH4CV8@public.gmane.org>
2011-06-07 20:33               ` Steve Dickson
2011-05-18  0:46 ` Max Matveev

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=20110518080106.1159c5b8@notabene.brown \
    --to=neilb@suse.de \
    --cc=james-p@moving-picture.com \
    --cc=linux-nfs@vger.kernel.org \
    /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.