From: Theodore Ts'o <tytso@mit.edu>
To: Jan Kara <jack@suse.cz>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH 2/2] ext4: add ext4_iget_normal() which is to be used for dir tree lookups
Date: Mon, 6 Oct 2014 14:55:34 -0400 [thread overview]
Message-ID: <20141006185534.GA7567@thunk.org> (raw)
In-Reply-To: <20141006150903.GI7526@quack.suse.cz>
On Mon, Oct 06, 2014 at 05:09:03PM +0200, Jan Kara wrote:
> > + if (ret_inode && !IS_ERR(ret_inode) &&
> > + ino < EXT4_FIRST_INO(sb) && ino != EXT4_ROOT_INO)
> > + make_bad_inode(ret_inode);
> > + return ret_inode;
> Hum, why don't we just return an error (like EIO) when invalid inode
> number is passed?
Yeah, I guess we can do that. We need to support the make_bad_inode()
for the sake of EXT4_IOC_SWAP_BOOT. But that code path doesn't need
to use ext4_iget_normal(). So yeah, in the case of
ext4_iget_normal(), we should be able to just return -EIO and let the
userspace fail fast with the open(2) instead of later on with the
read(2) or write(2) or truncate(2) call.
- Ted
next prev parent reply other threads:[~2014-10-06 18:55 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-05 0:12 Intentionally corrupted ext4s causing two different kernel panics at umount Sami Liedes
2014-10-06 2:48 ` [PATCH 1/2] ext4: don't orphan or truncate the boot loader inode Theodore Ts'o
2014-10-06 2:48 ` [PATCH 2/2] ext4: add ext4_iget_normal() which is to be used for dir tree lookups Theodore Ts'o
2014-10-06 2:52 ` Andreas Dilger
2014-10-06 3:16 ` Theodore Ts'o
2014-10-06 15:09 ` Jan Kara
2014-10-06 18:55 ` Theodore Ts'o [this message]
2014-10-06 15:06 ` [PATCH 1/2] ext4: don't orphan or truncate the boot loader inode Jan Kara
2014-10-07 20:56 ` One more corrupted fs crash in ext4_put_super Sami Liedes
2014-10-07 21:57 ` Darrick J. Wong
2014-10-07 22:22 ` Darrick J. Wong
2014-10-09 20:15 ` Sami Liedes
2014-10-09 20:49 ` Darrick J. Wong
2014-10-09 21:28 ` A very similar crash on ext2 Sami Liedes
2014-10-21 0:28 ` Darrick J. Wong
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=20141006185534.GA7567@thunk.org \
--to=tytso@mit.edu \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.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.