Skip to content
Commit 7c7dce92 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds
Browse files

[PATCH] Fix double decrement of mqueue_mnt->mnt_count in sys_mq_open



Fixed the refcounting on failure exits in sys_mq_open() and
cleaned the logics up.  Rules are actually pretty simple - dentry_open()
expects vfsmount and dentry to be pinned down and it either transfers
them into created struct file or drops them.  Old code had been very
confused in that area - if dentry_open() had failed either in do_open()
or do_create(), we ended up dentry and mqueue_mnt dropped twice, once
by dentry_open() cleanup and then by sys_mq_open().

Fix consists of making the rules for do_create() and do_open()
same as for dentry_open() and updating the sys_mq_open() accordingly;
that actually leads to more straightforward code and less work on
normal path.

Signed-off-by: default avatarAl Viro <aviro@redhat.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 12dbf3fc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment