| To: | Lukas Czerner <lczerner@xxxxxxxxxx> |
|---|---|
| Subject: | Re: [PATCH 1/6 v2] ext4: Update inode i_size after the preallocation |
| From: | tytso@xxxxxxx |
| Date: | Sat, 15 Mar 2014 23:27:56 -0400 |
| Cc: | linux-ext4@xxxxxxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx |
| Delivered-to: | xfs@xxxxxxxxxxx |
| Dkim-signature: | v=1; a=rsa-sha256; c=simple/simple; d=thunk.org; s=mail; t=1394940476; bh=qaE5UxW3u4PC/cGGk+QfXItdzffTaGOwEibQz6gL948=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NKgpEgIo2opwDTESFUHlnLeOFzKI9DmX15vfZAhS+SFaS8alSjP5XK19LDn48yjTV djHS/q2tuwygIhXcbE1X83Kp7fGOqmNIEEXnMwNQtUPCtU9D8kKWFhk9LwK5C+f1Pc aEUyi3/fEdzeWkIgcioVOvtavFORC7GLBIqDLwhk= |
| In-reply-to: | <1393355679-11160-2-git-send-email-lczerner@xxxxxxxxxx> |
| References: | <1393355679-11160-1-git-send-email-lczerner@xxxxxxxxxx> <1393355679-11160-2-git-send-email-lczerner@xxxxxxxxxx> |
| User-agent: | Mutt/1.5.22 (2013-10-16) |
On Tue, Feb 25, 2014 at 08:14:34PM +0100, Lukas Czerner wrote:
> Currently in ext4_fallocate we would update inode size, c_time and sync
> the file with every partial allocation which is entirely unnecessary. It
> is true that if the crash happens in the middle of truncate we might end
> up with unchanged i size, or c_time which I do not think is really a
> problem - it does not mean file system corruption in any way. Note that
> xfs is doing things the same way e.g. update all of the mentioned after
> the allocation is done.
>
> This commit moves all the updates after the allocation is done. In
> addition we also need to change m_time as not only inode has been change
> bot also data regions might have changed (unwritten extents). However
> m_time will be only updated when i_size changed.
>
> Also we do not need to be paranoid about changing the c_time only if the
> actual allocation have happened, we can change it even if we try to
> allocate only to find out that there are already block allocated. It's
> not really a big deal and it will save us some additional complexity.
>
> Also use ext4_debug, instead of ext4_warning in #ifdef EXT4FS_DEBUG
> section.
>
> Signed-off-by: Lukas Czerner <lczerner@xxxxxxxxxx>
Thanks, applied.
- Ted
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | I Want To Give You $20Dollars*, Dewayne Eller |
|---|---|
| Next by Date: | Re: [PATCH 2/6 v2] ext4: refactor ext4_fallocate code, tytso |
| Previous by Thread: | I Want To Give You $20Dollars*, Dewayne Eller |
| Next by Thread: | Re: [PATCH 1/6 v2] ext4: Update inode i_size after the preallocation, tytso |
| Indexes: | [Date] [Thread] [Top] [All Lists] |