[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4B066F1F.7090902@gmail.com>
Date: Fri, 20 Nov 2009 11:27:43 +0100
From: Jiri Slaby <jirislaby@...il.com>
To: Oleg Nesterov <oleg@...hat.com>
CC: Ingo Molnar <mingo@...e.hu>, Neil Horman <nhorman@...driver.com>,
Stephen Rothwell <sfr@...b.auug.org.au>,
linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
marcin.slusarz@...il.com, tglx@...utronix.de, mingo@...hat.com,
hpa@...or.com, Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: acct_file_reopen() && do_acct_process() (Was: [PATCH 0/3] extend
get/setrlimit to support setting rlimits external to a process (v7))
On 11/20/2009 03:11 AM, Oleg Nesterov wrote:
> Hmm. you are right. Do you know why acct_file_reopen() does
>
> if (old_acct)
> do_acct_process();
>
> ???
>
> This looks just strange. What is the point ? If the caller doesn't
> exit, we shouldn't account it?
I have no idea. I just checked free and net bsds and they record only
exiting tasks. Maybe someone added it to record the process which
disabled the acct (last entry). Dunno.
> And this is just wrong, no? Even if we forget about rlim, since
> do_acct_process() does override_creds() + revert_creds(), any
> __task_cred() in between is fooled?
>
> Probably I greatly misread something in acct.c, otherwise I can't
> see why, say, mntput() should ever record the caller in acct file.
>From how I understand the code, it is the last mntput before the fs gets
unmounted. It's to close the acct file. But I don't understand why it
accounts.
> IOW: could someone explain why the patch below is wrong?
For me, it makes sense. But that's not important ;).
> --- a/kernel/acct.c
> +++ b/kernel/acct.c
> @@ -206,7 +206,6 @@ static void acct_file_reopen(struct bsd_
> if (old_acct) {
> mnt_unpin(old_acct->f_path.mnt);
> spin_unlock(&acct_lock);
> - do_acct_process(acct, old_ns, old_acct);
> filp_close(old_acct, NULL);
> spin_lock(&acct_lock);
thanks,
--
js
Faculty of Informatics, Masaryk University
Suse Labs, Novell
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists