Re: [PATCH 2.6.24-rc4] proc: Remove/Fix proc generic d_revalidate

2007-12-10 Thread vandrove
Quoting Andrew Morton <[EMAIL PROTECTED]>:

> On Mon, 10 Dec 2007 16:32:18 +0300 "Denis V. Lunev" <[EMAIL PROTECTED]> wrote:
> >
> 
> Plese don't top-post.  It makes replying to you rather awkward.
> 
> > could you, plz, check patch sent by Eric above in this thread.
> > 
> > I have tried it on my test node and it works for module you have
> > provided. The problem exists without it.
> > 
> 
> When Peter says "with your patch in place" I assume that he's referring to
> Eric's latest patch, namely.

Sorry, I was not clear.  No, I meant Eric's original patch.  Without
d_revalidate() problem does not occur.
   Petr

> 
> --- a/fs/proc/generic.c~proc-remove-fix-proc-generic-d_revalidate
> +++ a/fs/proc/generic.c
> @@ -374,16 +374,9 @@ static int proc_delete_dentry(struct den
>   return 1;
>  }
>  
> -static int proc_revalidate_dentry(struct dentry *dentry, struct nameidata
> *nd)
> -{
> - d_drop(dentry);
> - return 0;
> -}
> -
>  static struct dentry_operations proc_dentry_operations =
>  {
>   .d_delete   = proc_delete_dentry,
> - .d_revalidate   = proc_revalidate_dentry,
>  };
>  
>  /*
> 
> So we still have problems, it appears.
> 
> > 
> > Petr Vandrovec wrote:
> > > Eric W. Biederman wrote:
> > >> Ultimately to implement /proc perfectly we need an implementation
> > >> of d_revalidate because files and directories can be removed behind
> > >> the back of the VFS, and d_revalidate is the only way we can let
> > >> the VFS know that this has happened.
> > >>
> > >> So until we get a proper test for keeping dentries in the dcache
> > >> fix the current d_revalidate method by completely removing it.  This
> > >> returns us to the current status quo.
> > > 
> > > Hello,
> > >I know that I'm late to the party, but mount points is not only
> > > problem with d_revalidate.  With your patch in place module below gets
> > > refcount incremented by two every time I do 'ls -la /proc/fs/vmblock'.
> > > 
> > >
> > > #include 
> > > #include 
> > > #include 
> > > 
> > > static int vmblockinit(void) {
> > >struct proc_dir_entry *controlProcDirEntry;
> > > 
> > >/* Create /proc/fs/vmblock */
> > >controlProcDirEntry = proc_mkdir("vmblock", proc_root_fs);
> > >if (!controlProcDirEntry) {
> > >   printk(KERN_DEBUG "Bad...\n");
> > >   return -EINVAL;
> > >}
> > >controlProcDirEntry->owner = THIS_MODULE;
> > >return 0;
> > > }
> > > 
> > > static void vmblockexit(void) {
> > >remove_proc_entry("vmblock", proc_root_fs);
> > > }
> > > 
> > > module_init(vmblockinit);
> > > module_exit(vmblockexit);
> > > 
> > > 
> > > (code comes from VMware's vmblock module,
> > > http://sourceforge.net/project/showfiles.php?group_id=204462)
> > > Thanks,
> > > Petr
> > > 
> > > 
> 
> 
> 



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.24-rc4] proc: Remove/Fix proc generic d_revalidate

2007-12-10 Thread Andrew Morton
On Mon, 10 Dec 2007 16:32:18 +0300 "Denis V. Lunev" <[EMAIL PROTECTED]> wrote:
>

Plese don't top-post.  It makes replying to you rather awkward.

> could you, plz, check patch sent by Eric above in this thread.
> 
> I have tried it on my test node and it works for module you have
> provided. The problem exists without it.
> 

When Peter says "with your patch in place" I assume that he's referring to
Eric's latest patch, namely.

--- a/fs/proc/generic.c~proc-remove-fix-proc-generic-d_revalidate
+++ a/fs/proc/generic.c
@@ -374,16 +374,9 @@ static int proc_delete_dentry(struct den
return 1;
 }
 
-static int proc_revalidate_dentry(struct dentry *dentry, struct nameidata *nd)
-{
-   d_drop(dentry);
-   return 0;
-}
-
 static struct dentry_operations proc_dentry_operations =
 {
.d_delete   = proc_delete_dentry,
-   .d_revalidate   = proc_revalidate_dentry,
 };
 
 /*

So we still have problems, it appears.

> 
> Petr Vandrovec wrote:
> > Eric W. Biederman wrote:
> >> Ultimately to implement /proc perfectly we need an implementation
> >> of d_revalidate because files and directories can be removed behind
> >> the back of the VFS, and d_revalidate is the only way we can let
> >> the VFS know that this has happened.
> >>
> >> So until we get a proper test for keeping dentries in the dcache
> >> fix the current d_revalidate method by completely removing it.  This
> >> returns us to the current status quo.
> > 
> > Hello,
> >I know that I'm late to the party, but mount points is not only
> > problem with d_revalidate.  With your patch in place module below gets
> > refcount incremented by two every time I do 'ls -la /proc/fs/vmblock'.
> > 
> >
> > #include 
> > #include 
> > #include 
> > 
> > static int vmblockinit(void) {
> >struct proc_dir_entry *controlProcDirEntry;
> > 
> >/* Create /proc/fs/vmblock */
> >controlProcDirEntry = proc_mkdir("vmblock", proc_root_fs);
> >if (!controlProcDirEntry) {
> >   printk(KERN_DEBUG "Bad...\n");
> >   return -EINVAL;
> >}
> >controlProcDirEntry->owner = THIS_MODULE;
> >return 0;
> > }
> > 
> > static void vmblockexit(void) {
> >remove_proc_entry("vmblock", proc_root_fs);
> > }
> > 
> > module_init(vmblockinit);
> > module_exit(vmblockexit);
> > 
> > 
> > (code comes from VMware's vmblock module,
> > http://sourceforge.net/project/showfiles.php?group_id=204462)
> > Thanks,
> > Petr
> > 
> > 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.24-rc4] proc: Remove/Fix proc generic d_revalidate

2007-12-10 Thread Denis V. Lunev
could you, plz, check patch sent by Eric above in this thread.

I have tried it on my test node and it works for module you have
provided. The problem exists without it.

Regards,
Den

Petr Vandrovec wrote:
> Eric W. Biederman wrote:
>> Ultimately to implement /proc perfectly we need an implementation
>> of d_revalidate because files and directories can be removed behind
>> the back of the VFS, and d_revalidate is the only way we can let
>> the VFS know that this has happened.
>>
>> So until we get a proper test for keeping dentries in the dcache
>> fix the current d_revalidate method by completely removing it.  This
>> returns us to the current status quo.
> 
> Hello,
>I know that I'm late to the party, but mount points is not only
> problem with d_revalidate.  With your patch in place module below gets
> refcount incremented by two every time I do 'ls -la /proc/fs/vmblock'.
> 
> 
> #include 
> #include 
> #include 
> 
> static int vmblockinit(void) {
>struct proc_dir_entry *controlProcDirEntry;
> 
>/* Create /proc/fs/vmblock */
>controlProcDirEntry = proc_mkdir("vmblock", proc_root_fs);
>if (!controlProcDirEntry) {
>   printk(KERN_DEBUG "Bad...\n");
>   return -EINVAL;
>}
>controlProcDirEntry->owner = THIS_MODULE;
>return 0;
> }
> 
> static void vmblockexit(void) {
>remove_proc_entry("vmblock", proc_root_fs);
> }
> 
> module_init(vmblockinit);
> module_exit(vmblockexit);
> 
> 
> (code comes from VMware's vmblock module,
> http://sourceforge.net/project/showfiles.php?group_id=204462)
> Thanks,
> Petr
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.24-rc4] proc: Remove/Fix proc generic d_revalidate

2007-12-10 Thread Denis V. Lunev
could you, plz, check patch sent by Eric above in this thread.

I have tried it on my test node and it works for module you have
provided. The problem exists without it.

Regards,
Den

Petr Vandrovec wrote:
 Eric W. Biederman wrote:
 Ultimately to implement /proc perfectly we need an implementation
 of d_revalidate because files and directories can be removed behind
 the back of the VFS, and d_revalidate is the only way we can let
 the VFS know that this has happened.

 So until we get a proper test for keeping dentries in the dcache
 fix the current d_revalidate method by completely removing it.  This
 returns us to the current status quo.
 
 Hello,
I know that I'm late to the party, but mount points is not only
 problem with d_revalidate.  With your patch in place module below gets
 refcount incremented by two every time I do 'ls -la /proc/fs/vmblock'.
 
 
 #include linux/kernel.h
 #include linux/module.h
 #include linux/proc_fs.h
 
 static int vmblockinit(void) {
struct proc_dir_entry *controlProcDirEntry;
 
/* Create /proc/fs/vmblock */
controlProcDirEntry = proc_mkdir(vmblock, proc_root_fs);
if (!controlProcDirEntry) {
   printk(KERN_DEBUG Bad...\n);
   return -EINVAL;
}
controlProcDirEntry-owner = THIS_MODULE;
return 0;
 }
 
 static void vmblockexit(void) {
remove_proc_entry(vmblock, proc_root_fs);
 }
 
 module_init(vmblockinit);
 module_exit(vmblockexit);
 
 
 (code comes from VMware's vmblock module,
 http://sourceforge.net/project/showfiles.php?group_id=204462)
 Thanks,
 Petr
 
 

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.24-rc4] proc: Remove/Fix proc generic d_revalidate

2007-12-10 Thread Andrew Morton
On Mon, 10 Dec 2007 16:32:18 +0300 Denis V. Lunev [EMAIL PROTECTED] wrote:


Plese don't top-post.  It makes replying to you rather awkward.

 could you, plz, check patch sent by Eric above in this thread.
 
 I have tried it on my test node and it works for module you have
 provided. The problem exists without it.
 

When Peter says with your patch in place I assume that he's referring to
Eric's latest patch, namely.

--- a/fs/proc/generic.c~proc-remove-fix-proc-generic-d_revalidate
+++ a/fs/proc/generic.c
@@ -374,16 +374,9 @@ static int proc_delete_dentry(struct den
return 1;
 }
 
-static int proc_revalidate_dentry(struct dentry *dentry, struct nameidata *nd)
-{
-   d_drop(dentry);
-   return 0;
-}
-
 static struct dentry_operations proc_dentry_operations =
 {
.d_delete   = proc_delete_dentry,
-   .d_revalidate   = proc_revalidate_dentry,
 };
 
 /*

So we still have problems, it appears.

 
 Petr Vandrovec wrote:
  Eric W. Biederman wrote:
  Ultimately to implement /proc perfectly we need an implementation
  of d_revalidate because files and directories can be removed behind
  the back of the VFS, and d_revalidate is the only way we can let
  the VFS know that this has happened.
 
  So until we get a proper test for keeping dentries in the dcache
  fix the current d_revalidate method by completely removing it.  This
  returns us to the current status quo.
  
  Hello,
 I know that I'm late to the party, but mount points is not only
  problem with d_revalidate.  With your patch in place module below gets
  refcount incremented by two every time I do 'ls -la /proc/fs/vmblock'.
  
 
  #include linux/kernel.h
  #include linux/module.h
  #include linux/proc_fs.h
  
  static int vmblockinit(void) {
 struct proc_dir_entry *controlProcDirEntry;
  
 /* Create /proc/fs/vmblock */
 controlProcDirEntry = proc_mkdir(vmblock, proc_root_fs);
 if (!controlProcDirEntry) {
printk(KERN_DEBUG Bad...\n);
return -EINVAL;
 }
 controlProcDirEntry-owner = THIS_MODULE;
 return 0;
  }
  
  static void vmblockexit(void) {
 remove_proc_entry(vmblock, proc_root_fs);
  }
  
  module_init(vmblockinit);
  module_exit(vmblockexit);
  
  
  (code comes from VMware's vmblock module,
  http://sourceforge.net/project/showfiles.php?group_id=204462)
  Thanks,
  Petr
  
  

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.24-rc4] proc: Remove/Fix proc generic d_revalidate

2007-12-10 Thread vandrove
Quoting Andrew Morton [EMAIL PROTECTED]:

 On Mon, 10 Dec 2007 16:32:18 +0300 Denis V. Lunev [EMAIL PROTECTED] wrote:
 
 
 Plese don't top-post.  It makes replying to you rather awkward.
 
  could you, plz, check patch sent by Eric above in this thread.
  
  I have tried it on my test node and it works for module you have
  provided. The problem exists without it.
  
 
 When Peter says with your patch in place I assume that he's referring to
 Eric's latest patch, namely.

Sorry, I was not clear.  No, I meant Eric's original patch.  Without
d_revalidate() problem does not occur.
   Petr

 
 --- a/fs/proc/generic.c~proc-remove-fix-proc-generic-d_revalidate
 +++ a/fs/proc/generic.c
 @@ -374,16 +374,9 @@ static int proc_delete_dentry(struct den
   return 1;
  }
  
 -static int proc_revalidate_dentry(struct dentry *dentry, struct nameidata
 *nd)
 -{
 - d_drop(dentry);
 - return 0;
 -}
 -
  static struct dentry_operations proc_dentry_operations =
  {
   .d_delete   = proc_delete_dentry,
 - .d_revalidate   = proc_revalidate_dentry,
  };
  
  /*
 
 So we still have problems, it appears.
 
  
  Petr Vandrovec wrote:
   Eric W. Biederman wrote:
   Ultimately to implement /proc perfectly we need an implementation
   of d_revalidate because files and directories can be removed behind
   the back of the VFS, and d_revalidate is the only way we can let
   the VFS know that this has happened.
  
   So until we get a proper test for keeping dentries in the dcache
   fix the current d_revalidate method by completely removing it.  This
   returns us to the current status quo.
   
   Hello,
  I know that I'm late to the party, but mount points is not only
   problem with d_revalidate.  With your patch in place module below gets
   refcount incremented by two every time I do 'ls -la /proc/fs/vmblock'.
   
  
   #include linux/kernel.h
   #include linux/module.h
   #include linux/proc_fs.h
   
   static int vmblockinit(void) {
  struct proc_dir_entry *controlProcDirEntry;
   
  /* Create /proc/fs/vmblock */
  controlProcDirEntry = proc_mkdir(vmblock, proc_root_fs);
  if (!controlProcDirEntry) {
 printk(KERN_DEBUG Bad...\n);
 return -EINVAL;
  }
  controlProcDirEntry-owner = THIS_MODULE;
  return 0;
   }
   
   static void vmblockexit(void) {
  remove_proc_entry(vmblock, proc_root_fs);
   }
   
   module_init(vmblockinit);
   module_exit(vmblockexit);
   
   
   (code comes from VMware's vmblock module,
   http://sourceforge.net/project/showfiles.php?group_id=204462)
   Thanks,
   Petr
   
   
 
 
 



--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.24-rc4] proc: Remove/Fix proc generic d_revalidate

2007-12-09 Thread Petr Vandrovec

Eric W. Biederman wrote:

Ultimately to implement /proc perfectly we need an implementation
of d_revalidate because files and directories can be removed behind
the back of the VFS, and d_revalidate is the only way we can let
the VFS know that this has happened.

So until we get a proper test for keeping dentries in the dcache
fix the current d_revalidate method by completely removing it.  This
returns us to the current status quo.


Hello,
   I know that I'm late to the party, but mount points is not only 
problem with d_revalidate.  With your patch in place module below gets 
refcount incremented by two every time I do 'ls -la /proc/fs/vmblock'.



#include 
#include 
#include 

static int vmblockinit(void) {
   struct proc_dir_entry *controlProcDirEntry;

   /* Create /proc/fs/vmblock */
   controlProcDirEntry = proc_mkdir("vmblock", proc_root_fs);
   if (!controlProcDirEntry) {
  printk(KERN_DEBUG "Bad...\n");
  return -EINVAL;
   }
   controlProcDirEntry->owner = THIS_MODULE;
   return 0;
}

static void vmblockexit(void) {
   remove_proc_entry("vmblock", proc_root_fs);
}

module_init(vmblockinit);
module_exit(vmblockexit);


(code comes from VMware's vmblock module, 
http://sourceforge.net/project/showfiles.php?group_id=204462)

Thanks,
Petr

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.24-rc4] proc: Remove/Fix proc generic d_revalidate

2007-12-09 Thread Petr Vandrovec

Eric W. Biederman wrote:

Ultimately to implement /proc perfectly we need an implementation
of d_revalidate because files and directories can be removed behind
the back of the VFS, and d_revalidate is the only way we can let
the VFS know that this has happened.

So until we get a proper test for keeping dentries in the dcache
fix the current d_revalidate method by completely removing it.  This
returns us to the current status quo.


Hello,
   I know that I'm late to the party, but mount points is not only 
problem with d_revalidate.  With your patch in place module below gets 
refcount incremented by two every time I do 'ls -la /proc/fs/vmblock'.



#include linux/kernel.h
#include linux/module.h
#include linux/proc_fs.h

static int vmblockinit(void) {
   struct proc_dir_entry *controlProcDirEntry;

   /* Create /proc/fs/vmblock */
   controlProcDirEntry = proc_mkdir(vmblock, proc_root_fs);
   if (!controlProcDirEntry) {
  printk(KERN_DEBUG Bad...\n);
  return -EINVAL;
   }
   controlProcDirEntry-owner = THIS_MODULE;
   return 0;
}

static void vmblockexit(void) {
   remove_proc_entry(vmblock, proc_root_fs);
}

module_init(vmblockinit);
module_exit(vmblockexit);


(code comes from VMware's vmblock module, 
http://sourceforge.net/project/showfiles.php?group_id=204462)

Thanks,
Petr

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.24-rc4] proc: Remove/Fix proc generic d_revalidate

2007-12-08 Thread Shane
On Dec 7, 2007 11:25 PM, Eric W. Biederman <[EMAIL PROTECTED]> wrote:
>
> Ultimately to implement /proc perfectly we need an implementation
> of d_revalidate because files and directories can be removed behind
> the back of the VFS, and d_revalidate is the only way we can let
> the VFS know that this has happened.
>
> Unfortunately the linux VFS can not cope with anything in the path
> to a mount point going away.  So a proper d_revalidate method that
> calls d_drop also needs to call have_submounts which is moderately
> expensive, so you really don't want a d_revalidate method that
> unconditionally calls it, but instead only calls it when the
> backing object has really gone away.
>
> proc generic entries only disappear on module_unload (when
> not counting the fledgling network namespace) so it is quite rare
> that we actually encounter that case and has not actually caused
> us real world trouble yet.
>
> So until we get a proper test for keeping dentries in the dcache
> fix the current d_revalidate method by completely removing it.  This
> returns us to the current status quo.
>
> So with CONFIG_NETNS=n things should look as they have always looked.
>
> For CONFIG_NETNS=y things work most of the time but there are a few
> rare corner cases that don't behave properly.  As the network namespace
> is barely present in 2.6.24 this should not be a problem.
>
> Signed-off-by: Eric W. Biederman <[EMAIL PROTECTED]>
> ---
>  fs/proc/generic.c |7 ---
>  1 files changed, 0 insertions(+), 7 deletions(-)
>
> diff --git a/fs/proc/generic.c b/fs/proc/generic.c
> index 8d49838..6a2fe51 100644
> --- a/fs/proc/generic.c
> +++ b/fs/proc/generic.c
> @@ -374,16 +374,9 @@ static int proc_delete_dentry(struct dentry * dentry)
> return 1;
>  }
>
> -static int proc_revalidate_dentry(struct dentry *dentry, struct nameidata 
> *nd)
> -{
> -   d_drop(dentry);
> -   return 0;
> -}
> -
>  static struct dentry_operations proc_dentry_operations =
>  {
> .d_delete   = proc_delete_dentry,
> -   .d_revalidate   = proc_revalidate_dentry,
>  };
>
>  /*
> --
> 1.5.3.rc6.17.g1911

Confirmed. This patch fixes the problem for me.

Shane
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.24-rc4] proc: Remove/Fix proc generic d_revalidate

2007-12-08 Thread Shane
On Dec 7, 2007 11:25 PM, Eric W. Biederman [EMAIL PROTECTED] wrote:

 Ultimately to implement /proc perfectly we need an implementation
 of d_revalidate because files and directories can be removed behind
 the back of the VFS, and d_revalidate is the only way we can let
 the VFS know that this has happened.

 Unfortunately the linux VFS can not cope with anything in the path
 to a mount point going away.  So a proper d_revalidate method that
 calls d_drop also needs to call have_submounts which is moderately
 expensive, so you really don't want a d_revalidate method that
 unconditionally calls it, but instead only calls it when the
 backing object has really gone away.

 proc generic entries only disappear on module_unload (when
 not counting the fledgling network namespace) so it is quite rare
 that we actually encounter that case and has not actually caused
 us real world trouble yet.

 So until we get a proper test for keeping dentries in the dcache
 fix the current d_revalidate method by completely removing it.  This
 returns us to the current status quo.

 So with CONFIG_NETNS=n things should look as they have always looked.

 For CONFIG_NETNS=y things work most of the time but there are a few
 rare corner cases that don't behave properly.  As the network namespace
 is barely present in 2.6.24 this should not be a problem.

 Signed-off-by: Eric W. Biederman [EMAIL PROTECTED]
 ---
  fs/proc/generic.c |7 ---
  1 files changed, 0 insertions(+), 7 deletions(-)

 diff --git a/fs/proc/generic.c b/fs/proc/generic.c
 index 8d49838..6a2fe51 100644
 --- a/fs/proc/generic.c
 +++ b/fs/proc/generic.c
 @@ -374,16 +374,9 @@ static int proc_delete_dentry(struct dentry * dentry)
 return 1;
  }

 -static int proc_revalidate_dentry(struct dentry *dentry, struct nameidata 
 *nd)
 -{
 -   d_drop(dentry);
 -   return 0;
 -}
 -
  static struct dentry_operations proc_dentry_operations =
  {
 .d_delete   = proc_delete_dentry,
 -   .d_revalidate   = proc_revalidate_dentry,
  };

  /*
 --
 1.5.3.rc6.17.g1911

Confirmed. This patch fixes the problem for me.

Shane
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2.6.24-rc4] proc: Remove/Fix proc generic d_revalidate

2007-12-07 Thread Eric W. Biederman

Ultimately to implement /proc perfectly we need an implementation
of d_revalidate because files and directories can be removed behind
the back of the VFS, and d_revalidate is the only way we can let
the VFS know that this has happened.

Unfortunately the linux VFS can not cope with anything in the path
to a mount point going away.  So a proper d_revalidate method that
calls d_drop also needs to call have_submounts which is moderately
expensive, so you really don't want a d_revalidate method that
unconditionally calls it, but instead only calls it when the
backing object has really gone away.

proc generic entries only disappear on module_unload (when
not counting the fledgling network namespace) so it is quite rare
that we actually encounter that case and has not actually caused
us real world trouble yet.

So until we get a proper test for keeping dentries in the dcache
fix the current d_revalidate method by completely removing it.  This
returns us to the current status quo.

So with CONFIG_NETNS=n things should look as they have always looked.

For CONFIG_NETNS=y things work most of the time but there are a few
rare corner cases that don't behave properly.  As the network namespace
is barely present in 2.6.24 this should not be a problem.

Signed-off-by: Eric W. Biederman <[EMAIL PROTECTED]>
---
 fs/proc/generic.c |7 ---
 1 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index 8d49838..6a2fe51 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -374,16 +374,9 @@ static int proc_delete_dentry(struct dentry * dentry)
return 1;
 }
 
-static int proc_revalidate_dentry(struct dentry *dentry, struct nameidata *nd)
-{
-   d_drop(dentry);
-   return 0;
-}
-
 static struct dentry_operations proc_dentry_operations =
 {
.d_delete   = proc_delete_dentry,
-   .d_revalidate   = proc_revalidate_dentry,
 };
 
 /*
-- 
1.5.3.rc6.17.g1911

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2.6.24-rc4] proc: Remove/Fix proc generic d_revalidate

2007-12-07 Thread Eric W. Biederman

Ultimately to implement /proc perfectly we need an implementation
of d_revalidate because files and directories can be removed behind
the back of the VFS, and d_revalidate is the only way we can let
the VFS know that this has happened.

Unfortunately the linux VFS can not cope with anything in the path
to a mount point going away.  So a proper d_revalidate method that
calls d_drop also needs to call have_submounts which is moderately
expensive, so you really don't want a d_revalidate method that
unconditionally calls it, but instead only calls it when the
backing object has really gone away.

proc generic entries only disappear on module_unload (when
not counting the fledgling network namespace) so it is quite rare
that we actually encounter that case and has not actually caused
us real world trouble yet.

So until we get a proper test for keeping dentries in the dcache
fix the current d_revalidate method by completely removing it.  This
returns us to the current status quo.

So with CONFIG_NETNS=n things should look as they have always looked.

For CONFIG_NETNS=y things work most of the time but there are a few
rare corner cases that don't behave properly.  As the network namespace
is barely present in 2.6.24 this should not be a problem.

Signed-off-by: Eric W. Biederman [EMAIL PROTECTED]
---
 fs/proc/generic.c |7 ---
 1 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index 8d49838..6a2fe51 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -374,16 +374,9 @@ static int proc_delete_dentry(struct dentry * dentry)
return 1;
 }
 
-static int proc_revalidate_dentry(struct dentry *dentry, struct nameidata *nd)
-{
-   d_drop(dentry);
-   return 0;
-}
-
 static struct dentry_operations proc_dentry_operations =
 {
.d_delete   = proc_delete_dentry,
-   .d_revalidate   = proc_revalidate_dentry,
 };
 
 /*
-- 
1.5.3.rc6.17.g1911

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/