[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110321013213.GD4135@thunk.org>
Date: Sun, 20 Mar 2011 21:32:13 -0400
From: Ted Ts'o <tytso@....edu>
To: Amir Goldstein <amir73il@...il.com>
Cc: Ext4 Developers List <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH 2/2] ext4: handle errors in ext4_clear_blocks()
On Tue, Mar 01, 2011 at 02:28:26PM +0200, Amir Goldstein wrote:
> Checking return code from ext4_journal_get_write_access() is important
> with snapshots, because this function invokes COW, so may return new
> errors, such as ENOSPC.
>
> ext4_clear_blocks() now returns < 0 for fatal errors, in which case,
> ext4_free_data() is aborted.
I'll apply this patch because it's not wrong, but I don't think it's
enough. Just aborting ext4_free_data() is going to get you into
beaucoup trouble, since that happens inside ext4_truncate(). Aborting
ext4_free_data without even returning an error code is going to leave
the file system corrupted. But aborting the truncate code (this is
only in the non-extent-mapped inode case) is going to get _awfully_
messy.
I suspect you may need to estimate how many blocks you need, and check
to make sure you can COW that many blocks, and reserve them so the you
don't have to deal with a failure in the middle of an ext4_truncate()
operation. This is not going to be pretty....
- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists