From: Boaz Harrosh <ooo@electrozaur.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: osd-dev@open-osd.org, linux-fsdevel@vger.kernel.org
Subject: Re: [RFC][exofs] locking for sbi->s_nextid?
Date: Sun, 06 Dec 2015 18:07:41 +0200 [thread overview]
Message-ID: <56645D4D.7060804@electrozaur.com> (raw)
In-Reply-To: <20151205235612.GC20997@ZenIV.linux.org.uk>
On 12/06/2015 01:56 AM, Al Viro wrote:
> Looks like exofs_new_inode() does this
>
> inode->i_ino = sbi->s_nextid++;
>
> without any locking; sure, the parent directory is locked, but that's not
> worth much on a filesystem that supports mkdir()... Am I missing something
> subtle here?
Yes I guess you are right. What bugs me is why this never failed. I mean
on a 64 bit system, why I never get a duplicate ino?
But I guess I should change this to an atomic.
> Another question in the code nearby:
>
> ret = ore_get_io_state(&sbi->layout, &oi->oc, &ios);
> if (unlikely(ret)) {
> EXOFS_ERR("exofs_new_inode: ore_get_io_state failed\n");
> return ERR_PTR(ret);
> }
>
> aren't we leaking a struct inode here? Path around ore_create() is
> also interesting - looks like its failure causes a leak (at least if
> it happens early on)...
>
Yes I'm afraid you are absolutely right. Just to show how much attention
this toy lab FS ever got. All ore_get_io_state needs to to fail is an OOM.
So this was never heavily tested right?
I'll see if I have some time to fix both. Just for the fun
Thanks Al
Boaz
prev parent reply other threads:[~2015-12-06 16:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-05 23:56 [RFC][exofs] locking for sbi->s_nextid? Al Viro
2015-12-06 16:07 ` Boaz Harrosh [this message]
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=56645D4D.7060804@electrozaur.com \
--to=ooo@electrozaur.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=osd-dev@open-osd.org \
--cc=viro@ZenIV.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 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.