linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: Masatake YAMATO <yamato@redhat.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 1/2] Read /etc/exports.d/*.export as extra export files
Date: Sat, 05 Mar 2011 16:42:06 -0500	[thread overview]
Message-ID: <4D72AE2E.2040700@RedHat.com> (raw)
In-Reply-To: <20110306.015430.825430197519907711.yamato@redhat.com>



On 03/05/2011 11:54 AM, Masatake YAMATO wrote:
> On Fri, 04 Mar 2011 11:21:54 -0500, Steve Dickson <SteveD@redhat.com> wrote
>>
>>
>> On 03/04/2011 01:10 AM, Masatake YAMATO wrote:
>>> Hi,
>>>
>>> thank you for replying.
>> Again.. my apologies for taking so long... 
>>
>>>
>>>> On 03/03/2011 09:01 AM, Masatake YAMATO wrote:
>>>>> No comment?
>>>> Sorry about that... I was traveling for the couple weeks... 
>>>>
>>>> Would you happen to have an example script on how 
>>>> this new feature would be used? I just want to run 
>>>> some quick tests...
>>>>
>>>> tia,
>>>>
>>>> steved.
>>>
>>> Could you try following one?
>>>
>>> # cd /tmp
>>> # mkdir /tmp/alpha
>>> # mkdir /tmp/beta
>>> # mkdir /etc/exports.d
>>> # mkdir /etc/exports.d
>>> # echo '/tmp/alpha *(ro)' > /etc/exports.d/alpha.export
>>> # echo '/tmp/beta *(ro)'  > /etc/exports.d/beta.export
>>> # /etc/init.d nfs restart
>>>
>>> After above setting up, when you do `exportfs', following lines 
>>> may be included in the output:
>>>
>>>     /tmp/alpha	 <world>
>>>     /tmp/beta        <world>
>> Question... Where is the race? Meaning who is reading the exports
>> file while its being modified?
> 
> Sorry, I don't understand well. Are you talking about race condition
> introduced with my patch?
I thought you were doing this because some one trying to read
the exports as they were being updated... but after reading 
your entire email I see I was mistaken... 

> 
>> The reason I ask is exporting (or re-exporting) pretty serial:
>>
>> exportfs read /etc/exports
>> exportfs writes the new exports to /var/lib/nfs/etab
>> mountd notices etab has changed and rereads its.
>> mountd flush the kernel cache cause the kernel to do upcalls to get the new exports.
> 
> With my patch doesn't change match this sequence:
> 
> (S1) exportfs read /etc/exports
> (S2) exportfs read /etc/exports.d/*.export 
> (S3) exportfs writes the new exports to /var/lib/nfs/etab
> (S4) mountd notices etab has changed and rereads its.
> (S5) mountd flush the kernel cache cause the kernel to do upcalls to get the new exports.
> 
> I've added (Sn) to make discussion easier. I've just added S2 stage.
>  
>> So since exportfs command not a daemon I don't see why 
>>    cp exports.new /etc/exports && exportfs -arv
>>
>> isn't all that is needed.  What am I missing?
> 
> Consider the case when an user wants to add following entry to /etc/exports:
> 
> 	 '/tmp/alpha *(ro)'
> 
> How one will do? Without my patch I image following sequence (sequence 1).
> 
>     cp /etc/exports exports.new
>     echo '/tmp/alpha *(ro)' >> exports.new
>     cp exports.new /etc/exports && exportfs -arv    
> 
> With my patch this sequence becomes simplified as (sequence 1'):
> 
>      echo '/tmp/alpha *(ro)' > /etc/exports.d/alpha.export
>      exportfs -arv    
> 
> When duplicated entries must be considered the sequence 1 may become
> more complex.
> 
> 
> Next, consider removing the export entry from /etc/exports.
> Without my patch I image following sequence (sequence 2).
> 
>     cp /etc/exports exports.old
>     grep -v '/tmp/alpha *(ro)' < exports.old > /etc/exports
>     exportfs -arv        
> 
> With my patch this sequence becomes simplified as (sequence 2'):
>     rm /etc/exports.d/alpha.export
>     exportfs -arv 
I understand and its a good idea.. thanks for the explanation...

> 
> 
> More background I'm thinking expanding the area of utilizing rpm package
> in system management. Consider installing an export entry to a system
> via rpm package. Without my patch you have to write down sequence 1
> to %post and sequence 2 to %postun of the spec file. With my patch
> you have to just put /etc/exports.d/alpha.export to %files section.
> 
> This story of rpm is just my application. However, I thik my patch may be
> useful for other purposes. 
I agree but I do have a question on the first patch which I will ask
in replay to that email...

Thanks again!

steved.

  reply	other threads:[~2011-03-05 21:42 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-17 12:59 [PATCH 1/2] Read /etc/exports.d/*.export as extra export files Masatake YAMATO
2011-02-17 13:03 ` [PATCH 2/2] Update man pages for /etc/exports.d Masatake YAMATO
2011-03-03 14:01 ` [PATCH 1/2] Read /etc/exports.d/*.export as extra export files Masatake YAMATO
2011-03-03 15:26   ` Ferenc Wagner
     [not found]     ` <87fwr4rzri.fsf-/U8DR9OPLL8grVaPS+uXcA@public.gmane.org>
2011-03-03 17:50       ` J. Bruce Fields
2011-03-03 20:52   ` Steve Dickson
2011-03-04  6:10     ` Masatake YAMATO
2011-03-04 16:21       ` Steve Dickson
2011-03-05 16:54         ` Masatake YAMATO
2011-03-05 21:42           ` Steve Dickson [this message]
2011-03-05 22:46 ` Steve Dickson
2011-03-06  1:51   ` Jim Rees
2011-03-06  6:11     ` Masatake YAMATO
2011-03-07 13:05       ` Steve Dickson
2011-03-07 13:17         ` Steve Dickson
2011-03-07 13:50           ` Masatake YAMATO
2011-03-07 14:14             ` Steve Dickson
     [not found]               ` <4D74E830.6020406-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2011-03-07 14:27                 ` Masatake YAMATO
2011-03-07 14:02         ` Jim Rees
2011-03-07 14:17           ` Steve Dickson
2011-03-07 14:29 ` Steve Dickson

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=4D72AE2E.2040700@RedHat.com \
    --to=steved@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=yamato@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;
as well as URLs for NNTP newsgroup(s).