Re: [PATCH] autofs4 - use simple_empty() for empty directory check

2012-11-16 Thread Ian Kent
On Fri, 2012-11-16 at 17:34 +, Al Viro wrote: > On Fri, Nov 16, 2012 at 08:43:28AM -0800, Linus Torvalds wrote: > > On Fri, Nov 16, 2012 at 8:36 AM, Ian Kent wrote: > > > > > > Sure, are you recommending I alter the fs/libfs.c functions to add a > > > function that doesn't have the outer

Re: [PATCH] autofs4 - use simple_empty() for empty directory check

2012-11-16 Thread Al Viro
On Fri, Nov 16, 2012 at 08:43:28AM -0800, Linus Torvalds wrote: > On Fri, Nov 16, 2012 at 8:36 AM, Ian Kent wrote: > > > > Sure, are you recommending I alter the fs/libfs.c functions to add a > > function that doesn't have the outer lock, and have simple_empty() call > > that, then use it in

Re: [PATCH] autofs4 - use simple_empty() for empty directory check

2012-11-16 Thread Linus Torvalds
On Fri, Nov 16, 2012 at 8:36 AM, Ian Kent wrote: > > Sure, are you recommending I alter the fs/libfs.c functions to add a > function that doesn't have the outer lock, and have simple_empty() call > that, then use it in autofs? Yup. That's the standard pattern, although usually we *strive* to

Re: [PATCH] autofs4 - use simple_empty() for empty directory check

2012-11-16 Thread Ian Kent
On Fri, 2012-11-16 at 07:45 -0800, Linus Torvalds wrote: > On Thu, Nov 15, 2012 at 8:15 PM, Ian Kent wrote: > > > > +static inline int __simple_empty(struct dentry *dentry) > > +{ > > This seems completely bogus. > > It's a duplicate of the existing fs/libfs.c "simple_empty()" function, > but

Re: [PATCH] autofs4 - use simple_empty() for empty directory check

2012-11-16 Thread Linus Torvalds
On Thu, Nov 15, 2012 at 8:15 PM, Ian Kent wrote: > > +static inline int __simple_empty(struct dentry *dentry) > +{ This seems completely bogus. It's a duplicate of the existing fs/libfs.c "simple_empty()" function, but without taking the outer lock. That kind of code duplication - and doing it

Re: [PATCH] autofs4 - use simple_empty() for empty directory check

2012-11-16 Thread Linus Torvalds
On Thu, Nov 15, 2012 at 8:15 PM, Ian Kent ik...@redhat.com wrote: +static inline int __simple_empty(struct dentry *dentry) +{ This seems completely bogus. It's a duplicate of the existing fs/libfs.c simple_empty() function, but without taking the outer lock. That kind of code duplication -

Re: [PATCH] autofs4 - use simple_empty() for empty directory check

2012-11-16 Thread Ian Kent
On Fri, 2012-11-16 at 07:45 -0800, Linus Torvalds wrote: On Thu, Nov 15, 2012 at 8:15 PM, Ian Kent ik...@redhat.com wrote: +static inline int __simple_empty(struct dentry *dentry) +{ This seems completely bogus. It's a duplicate of the existing fs/libfs.c simple_empty() function, but

Re: [PATCH] autofs4 - use simple_empty() for empty directory check

2012-11-16 Thread Linus Torvalds
On Fri, Nov 16, 2012 at 8:36 AM, Ian Kent ik...@redhat.com wrote: Sure, are you recommending I alter the fs/libfs.c functions to add a function that doesn't have the outer lock, and have simple_empty() call that, then use it in autofs? Yup. That's the standard pattern, although usually we

Re: [PATCH] autofs4 - use simple_empty() for empty directory check

2012-11-16 Thread Al Viro
On Fri, Nov 16, 2012 at 08:43:28AM -0800, Linus Torvalds wrote: On Fri, Nov 16, 2012 at 8:36 AM, Ian Kent ik...@redhat.com wrote: Sure, are you recommending I alter the fs/libfs.c functions to add a function that doesn't have the outer lock, and have simple_empty() call that, then use it

Re: [PATCH] autofs4 - use simple_empty() for empty directory check

2012-11-16 Thread Ian Kent
On Fri, 2012-11-16 at 17:34 +, Al Viro wrote: On Fri, Nov 16, 2012 at 08:43:28AM -0800, Linus Torvalds wrote: On Fri, Nov 16, 2012 at 8:36 AM, Ian Kent ik...@redhat.com wrote: Sure, are you recommending I alter the fs/libfs.c functions to add a function that doesn't have the outer

[PATCH] autofs4 - use simple_empty() for empty directory check

2012-11-15 Thread Ian Kent
From: Ian Kent For direct (and offset) mounts, if an automounted mount is manually umounted the trigger mount dentry can appear non-empty causing it to not trigger mounts. This can also happen if there is a file handle leak in a user space automounting application. It happens because, when the

[PATCH] autofs4 - use simple_empty() for empty directory check

2012-11-15 Thread Ian Kent
From: Ian Kent ra...@themaw.net For direct (and offset) mounts, if an automounted mount is manually umounted the trigger mount dentry can appear non-empty causing it to not trigger mounts. This can also happen if there is a file handle leak in a user space automounting application. It happens