Skip to contentSkip to conversation

several fixes

GIT PULL Al Viro 3 participants 8 messages Mar 16, 2011 VFS

lore
Share & tools
lore

Al Viro

author maintainer
#0 lore raw

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(-)
#1 lore raw
Quoted 3 lines · Al Viro

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(-)
fs/file_table.c +3 -1
Index: linux-2.6/fs/file_table.c
===================================================================
@@ -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);
#2 lore raw
Quoted 2 lines · Miklos Szeredi

__fput doesn't need a cdev_put() for O_PATH handles.

"doesn't need" or "must not have"?

Linus

#3 lore raw
Quoted 5 lines · Linus Torvalds
Quoted 2 lines · Miklos Szeredi

__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

#4 lore raw
Quoted 4 lines · Miklos Szeredi
Quoted 2 lines

"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.

Quoted 2 lines

That cdev_put() should really be moved into f_op->release(), but that would be quite a bit of work.

Yeah. Al?

Linus

author maintainer
#7 lore raw
In reply to Miklos Szeredi
Quoted 6 lines · Miklos Szeredi
Quoted 3 lines · Al Viro

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?

author maintainer
#5 lore raw
In reply to Linus Torvalds
Quoted 4 lines · Linus Torvalds
Quoted 3 lines · Miklos Szeredi
Quoted 2 lines

"doesn't need" or "must not have"?

Quoted 8 lines
Quoted 1 line

It must not have one, otherwise refcounting will go astray.

That's what I thought. The commit message just seemed to be off.

Quoted 2 lines

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)

#6 lore raw
Quoted 2 lines · Al Viro

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