mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Duane Griffin <duaneg@dghda.com>
Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
	akpm@linux-foundation.org, sct@redhat.com, adilger@clusterfs.com,
	Sami Liedes <sliedes@cc.hut.fi>
Subject: Re: [PATCH] ext3: handle corrupted orphan list at mount
Date: Tue, 24 Jun 2008 19:18:57 +0200	[thread overview]
Message-ID: <20080624171856.GH9959@duck.suse.cz> (raw)
In-Reply-To: <e9e943910806241016v743ce19s28bdf34177154799@mail.gmail.com>

On Tue 24-06-08 18:16:21, Duane Griffin wrote:
> 2008/6/24 Jan Kara <jack@suse.cz>:
> >> +     /*
> >> +      * If the orphans has i_nlinks > 0 then it should be able to be
> >> +      * truncated, otherwise it won't be removed from the orphan list
> >> +      * during processing and an infinite loop will result.
> >> +      */
> >> +     if (inode->i_nlink && !ext3_can_truncate(inode))
> >> +             goto bad_orphan;
> >> +
> >  Maybe I miss something but shouldn't above rather be ||?
> 
> No, it is correct. If i_nlink == 0 the orphan will be deleted in the
> cleanup loop by the iput. If i_nlink > 0 then ext3_truncate is called,
> which usually calls ext3_orphan_del on the way out, thereby removing
> the node from the orphan list. However, if it exits too early
> (basically if the ext3_can_truncate check fails, although there are
> other failure conditions such as OOM that can also cause it to exit
> early) then it doesn't, hence we end up in the infinite loop. So the
> check here says, if this node is not going to be deleted or truncated
> then it is invalid.
  Ah, OK, I forgot that you want to handle also truncation without deletion
of the inode itself. Thanks for explanation.

									Honza

-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2008-06-24 17:19 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080607121940.8ee6044a.akpm@linux-foundation.org>
2008-06-21  1:54 ` [PATCH] ext3: validate directory entry data before use Duane Griffin
2008-06-21 15:54   ` [PATCH, v2] " Duane Griffin
2008-06-21 16:13     ` Jochen Voß
2008-06-21 16:31       ` Duane Griffin
2008-06-25 10:08     ` Jan Kara
2008-06-25 11:30       ` Duane Griffin
2008-06-25 12:11         ` [PATCH, v3] " Duane Griffin
2008-06-25 12:18           ` Jan Kara
2008-06-24  6:36   ` [PATCH] " Andreas Dilger
2008-06-23 21:56 ` [PATCH] ext3: handle corrupted orphan list at mount Duane Griffin
2008-06-23 22:32   ` Sami Liedes
2008-06-24  0:09     ` Duane Griffin
2008-06-24 16:08   ` Jan Kara
2008-06-24 17:16     ` Duane Griffin
2008-06-24 17:18       ` Jan Kara [this message]
2008-06-24 13:47 ` [PATCH] ext3: handle deleting corrupted indirect blocks Duane Griffin
2008-06-24 13:57   ` Eric Sandeen
2008-06-24 14:17     ` Duane Griffin
2008-06-24 21:05   ` Andrew Morton
2008-06-25  0:13     ` Mingming
2008-06-25  0:15     ` Duane Griffin

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=20080624171856.GH9959@duck.suse.cz \
    --to=jack@suse.cz \
    --cc=adilger@clusterfs.com \
    --cc=akpm@linux-foundation.org \
    --cc=duaneg@dghda.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sct@redhat.com \
    --cc=sliedes@cc.hut.fi \
    /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

all inboxes | Powered by JetHome®