From: Jan Kara <jack@suse.cz>
To: Ashish Sangwan <ashishsangwan2@gmail.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: query about truncate and orphan list
Date: Wed, 29 Aug 2012 15:17:58 +0200 [thread overview]
Message-ID: <20120829131758.GA21169@quack.suse.cz> (raw)
In-Reply-To: <CAOiN93=uvi37EMuOYvd+Nr2up=giPikL+sLEOFTpqOzyHi+Tfw@mail.gmail.com>
On Wed 29-08-12 14:52:22, Ashish Sangwan wrote:
> I have a query about orphan list and truncate.
> Currently these steps are performed in ext4_ext_truncate():
> a) Start journal handle.
> b) add inode to orphan list.
> c) i_disksize is updated and inode is mark dirty.
> d) actual truncate happen.
> e) remove inode from orphan list.
> f) handle stop.
>
> If system crash during step d) will i_disksize is actually updated on disk?
> AFAIK i_disksize might be updated on the journal but not on its
> original location because the transaction is not commited yet.
Yes, that can happen.
> If this is the case than what is the use of re-starting truncate
> operation while processing orphan inode list?
Because it can be on disk (noone guarantees when a transaction commits)
and in that case we have to perform the truncate because some of the blocks
might have been already freed by a transaction which is also committed.
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
next prev parent reply other threads:[~2012-08-29 13:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-29 9:22 query about truncate and orphan list Ashish Sangwan
2012-08-29 13:17 ` Jan Kara [this message]
2012-08-30 9:24 ` Ashish Sangwan
2012-08-30 9:54 ` Jan Kara
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=20120829131758.GA21169@quack.suse.cz \
--to=jack@suse.cz \
--cc=ashishsangwan2@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).