From: Oleg Nesterov <oleg@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>,
hpa@zytor.com, raven@themaw.net
Cc: Pavel Emelyanov <xemul@openvz.org>,
Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH] autofs: fix the wrong usage of the deprecated task_pgrp_nr()
Date: Sun, 18 Jan 2009 08:34:41 +0100 [thread overview]
Message-ID: <20090118073441.GA699@redhat.com> (raw)
parse_options(&pgid) sets pgid = task_pgrp_nr() which uses the global
namespace. This is wrong, we use this pgid to find "struct pid" in the
current's namespace. Change parse_options() to use task_pgrp_vnr().
Also do s/task_pgrp_nr/task_pgrp_vnr/ in the debugging printks.
checkpatch.pl complains about "line over 80 characters", but it should
blame the cuurent code, not the patch.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
--- CUR/fs/autofs/inode.c~1_AUTOFS 2009-01-12 23:07:46.000000000 +0100
+++ CUR/fs/autofs/inode.c 2009-01-18 06:18:49.000000000 +0100
@@ -78,7 +78,7 @@ static int parse_options(char *options,
*uid = current_uid();
*gid = current_gid();
- *pgrp = task_pgrp_nr(current);
+ *pgrp = task_pgrp_vnr(current);
*minproto = *maxproto = AUTOFS_PROTO_VERSION;
--- CUR/fs/autofs/root.c~1_AUTOFS 2008-10-10 00:13:53.000000000 +0200
+++ CUR/fs/autofs/root.c 2009-01-18 06:15:42.000000000 +0100
@@ -215,7 +215,7 @@ static struct dentry *autofs_root_lookup
oz_mode = autofs_oz_mode(sbi);
DPRINTK(("autofs_lookup: pid = %u, pgrp = %u, catatonic = %d, "
"oz_mode = %d\n", task_pid_nr(current),
- task_pgrp_nr(current), sbi->catatonic,
+ task_pgrp_vnr(current), sbi->catatonic,
oz_mode));
/*
@@ -550,7 +550,8 @@ static int autofs_root_ioctl(struct inod
struct autofs_sb_info *sbi = autofs_sbi(inode->i_sb);
void __user *argp = (void __user *)arg;
- DPRINTK(("autofs_ioctl: cmd = 0x%08x, arg = 0x%08lx, sbi = %p, pgrp = %u\n",cmd,arg,sbi,task_pgrp_nr(current)));
+ DPRINTK(("autofs_ioctl: cmd = 0x%08x, arg = 0x%08lx, sbi = %p, pgrp = %u\n",
+ cmd, arg, sbi, task_pgrp_vnr(current)));
if (_IOC_TYPE(cmd) != _IOC_TYPE(AUTOFS_IOC_FIRST) ||
_IOC_NR(cmd) - _IOC_NR(AUTOFS_IOC_FIRST) >= AUTOFS_IOC_COUNT)
next reply other threads:[~2009-01-18 7:37 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-18 7:34 Oleg Nesterov [this message]
2009-01-19 2:20 ` [PATCH] autofs: fix the wrong usage of the deprecated task_pgrp_nr() Ian Kent
2009-01-19 6:35 ` H. Peter Anvin
2009-01-19 7:45 ` Ian Kent
2009-01-19 17:09 ` H. Peter Anvin
2009-01-20 1:18 ` Ian Kent
2009-01-19 7:08 ` Oleg Nesterov
2009-01-19 8:11 ` Ian Kent
2009-01-19 8:32 ` Oleg Nesterov
2009-01-19 11:15 ` Ian Kent
2009-01-19 12:42 ` Oleg Nesterov
2009-01-19 13:33 ` Ian Kent
2009-01-19 14:30 ` Oleg Nesterov
2009-01-19 17:48 ` Serge E. Hallyn
2009-01-19 18:05 ` Oleg Nesterov
2009-01-19 18:24 ` Serge E. Hallyn
2009-01-19 19:17 ` Oleg Nesterov
2009-01-19 19:20 ` H. Peter Anvin
2009-01-19 19:32 ` Oleg Nesterov
2009-01-19 19:35 ` Serge E. Hallyn
2009-01-19 20:04 ` Oleg Nesterov
2009-01-19 20:48 ` Serge E. Hallyn
2009-01-19 21:31 ` Oleg Nesterov
2009-01-19 22:11 ` Serge E. Hallyn
2009-01-20 2:07 ` Ian Kent
2009-01-20 1:35 ` Ian Kent
2009-01-20 1:38 ` H. Peter Anvin
2009-01-20 7:08 ` Oleg Nesterov
2009-01-23 4:48 ` Ian Kent
2009-01-23 8:13 ` Oleg Nesterov
2009-01-23 9:09 ` Ian Kent
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090118073441.GA699@redhat.com \
--to=oleg@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=raven@themaw.net \
--cc=sukadev@linux.vnet.ibm.com \
--cc=xemul@openvz.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.