Several fixes, including the brown paperbag one for -ELOOP breakage
in the last commit of yesterday pull. Please, pull from the usual place -
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6.git/ for-linus
Shortlog:
Al Viro (1):
fix follow_link() breakage
Christoph Hellwig (1):
prune back iprune_sem
Stephen Rothwell (1):
vfs: add nonconflicting values for O_PATH
Diffstat:
arch/alpha/include/asm/fcntl.h | 2 ++
arch/parisc/include/asm/fcntl.h | 2 ++
arch/sparc/include/asm/fcntl.h | 2 ++
fs/inode.c | 32 ++++++++++++++------------------
fs/namei.c | 7 +++----
5 files changed, 23 insertions(+), 22 deletions(-)
On Wed, 16 Mar 2011, Al Viro wrote:
> Several fixes, including the brown paperbag one for -ELOOP breakage
> in the last commit of yesterday pull. Please, pull from the usual place -
> git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6.git/ for-linus
__fput doesn't need a cdev_put() for O_PATH handles.
Signed-off-by: [email protected]
---
fs/file_table.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Index: linux-2.6/fs/file_table.c
===================================================================
--- linux-2.6.orig/fs/file_table.c 2011-03-16 16:13:25.000000000 +0100
+++ linux-2.6/fs/file_table.c 2011-03-16 17:50:22.000000000 +0100
@@ -246,8 +246,10 @@ static void __fput(struct file *file)
file->f_op->release(inode, file);
security_file_free(file);
ima_file_free(file);
- if (unlikely(S_ISCHR(inode->i_mode) && inode->i_cdev != NULL))
+ if (unlikely(S_ISCHR(inode->i_mode) && inode->i_cdev != NULL &&
+ !(file->f_mode & FMODE_PATH))) {
cdev_put(inode->i_cdev);
+ }
fops_put(file->f_op);
put_pid(file->f_owner.pid);
file_sb_list_del(file);
On Wed, Mar 16, 2011 at 10:17 AM, Miklos Szeredi <[email protected]> wrote:
>
> __fput doesn't need a cdev_put() for O_PATH handles.
"doesn't need" or "must not have"?
Linus
On Wed, 16 Mar 2011, Linus Torvalds wrote:
> On Wed, Mar 16, 2011 at 10:17 AM, Miklos Szeredi <[email protected]> wrote:
> >
> > __fput doesn't need a cdev_put() for O_PATH handles.
>
> "doesn't need" or "must not have"?
It must not have one, otherwise refcounting will go astray.
That cdev_put() should really be moved into f_op->release(), but that
would be quite a bit of work.
Thanks,
Miklos
On Wed, Mar 16, 2011 at 11:17 AM, Miklos Szeredi <[email protected]> wrote:
>>
>> "doesn't need" or "must not have"?
>
> It must not have one, otherwise refcounting will go astray.
That's what I thought. The commit message just seemed to be off.
> That cdev_put() should really be moved into f_op->release(), but that
> would be quite a bit of work.
Yeah. Al?
Linus
On Wed, Mar 16, 2011 at 06:17:54PM +0100, Miklos Szeredi wrote:
> On Wed, 16 Mar 2011, Al Viro wrote:
> > Several fixes, including the brown paperbag one for -ELOOP breakage
> > in the last commit of yesterday pull. Please, pull from the usual place -
> > git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6.git/ for-linus
>
> __fput doesn't need a cdev_put() for O_PATH handles.
Good catch, thanks. Linus, do you want me to put that through vfs-2.6 or
would you rather apply directly?
On Wed, Mar 16, 2011 at 11:49:31AM -0700, Linus Torvalds wrote:
> On Wed, Mar 16, 2011 at 11:17 AM, Miklos Szeredi <[email protected]> wrote:
> >>
> >> "doesn't need" or "must not have"?
> >
> > It must not have one, otherwise refcounting will go astray.
>
> That's what I thought. The commit message just seemed to be off.
>
> > That cdev_put() should really be moved into f_op->release(), but that
> > would be quite a bit of work.
>
> Yeah. Al?
In tree, with edited commit message... Please, pull from
git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6.git/ for-linus
(just one commit in that branch)
On Wed, Mar 16, 2011 at 1:21 PM, Al Viro <[email protected]> wrote:
>
> In tree, with edited commit message...
Well, not edited enough. It still talks about "not needing".
That thing "doesn't need" a cdev_put() the same way I "don't need" to
be shot in the head.
But whatever. Pulled.
Linus