From: Rusty Russell <rusty@rustcorp.com.au>
To: Davide Libenzi <davidel@xmailserver.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Arnd Bergmann <arnd@arndb.de>, Al Viro <viro@ftp.linux.org.uk>
Subject: Re: [PATCH] anon_inodes.c cleanups.
Date: Sun, 13 Apr 2008 04:26:09 +1000 [thread overview]
Message-ID: <200804130426.09365.rusty@rustcorp.com.au> (raw)
In-Reply-To: <Pine.LNX.4.64.0804111807340.12407@alien.or.mcafeemobile.com>
On Saturday 12 April 2008 11:15:26 Davide Libenzi wrote:
> On Fri, 11 Apr 2008, Rusty Russell wrote:
> > Arnd pointed me at anon_inode_getfd(), and the code annoyed me enough
> > to send this patch.
> >
> > Mainly because the init routine carefully checks for errors, then panics
> > (because we shouldn't run out of memory at boot). Unfortunately, it's
> > actually worse than simply oopsing, where we'd know what had failed.
> >
> > 1) anon_inode_inode can be read_mostly, same as anon_inode_mnt.
>
> Sure.
>
> > 3) anon_inode_mkinode has one caller, so it's a little confusing.
>
> Hmm? The function groups the code necessary to create the anonfds inode.
> If every function that has one call site would be inlined, we'd have
> monster long functions. Functions also have the purpose to group some code
> that does some task, into a single unit (and the function name hopefully
> gives an hint about what's doing). The compiler (not that in this case
> really matter, since it's not even a slow-path, is a once-run path) may
> take care of inlining, if sees that appropriate.
If you'd called it, say, "setup_anon_inode()", it would be fine. It seems
overly generic unless you planned on calling it elsewhere.
> > 2) The IS_ERR(anon_inode_inode) check is unneeded, since we panic on
> > boot if that were true.
> > 4) Don't clean up before panic.
> > 5) Panic gives less information than an oops would, plus is untested.
>
> I remember we changed the failure-path of anonfds a couple of times along
> the way, but I can't find email traces about why we did it.
> So, I prefer error-checked code instead of oopses, and given that the
> anonfds subsystem is not a required one for most of the components of the
> kernel/userspace, I'd rather prefer to drop the panic().
We've seen this debate before, and I'm firmly on the "don't turn oopses into
errors on boot paths" side. I know others disagree.
Given that it should never happen, I'd argue the highest priority minimal
amount of code, and second is ease of debugging if it ever did happen to
someone. Oopsing has those features.
> Anyway, I'll let this handle with Al (cc-ed now). The ananofds interface
> has been changed to remove the inode** and file** parameters (noone but
> KVM was using them), and Al already has those changes in his vfs tree
> (plus fixes for KVM, I think).
OK, fine.
Thanks,
Rusty.
next prev parent reply other threads:[~2008-04-12 18:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-10 22:35 [PATCH] anon_inodes.c cleanups Rusty Russell
2008-04-12 1:15 ` Davide Libenzi
2008-04-12 18:26 ` Rusty Russell [this message]
2008-04-13 20:37 ` Davide Libenzi
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=200804130426.09365.rusty@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=arnd@arndb.de \
--cc=davidel@xmailserver.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@ftp.linux.org.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox