linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Mason <chris.mason@oracle.com>
To: Miao Xie <miaox@cn.fujitsu.com>
Cc: Linux Btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 2/2] Btrfs: fix wrong i_size when truncating a file to a larger size
Date: Wed, 14 Dec 2011 11:51:47 -0500	[thread overview]
Message-ID: <20111214165147.GF31158@shiny> (raw)
In-Reply-To: <4EE84D29.5070601@cn.fujitsu.com>

On Wed, Dec 14, 2011 at 03:15:53PM +0800, Miao Xie wrote:
> Btrfsck report error 100 after the 83th case of xfstests was run, it means
> the i_size of the file is wrong.
> 
> The reason of this bug is that:
> Btrfs increased i_size of the file at the beginning, but it failed to expand
> the file, and failed to update the i_size to the old size because there is no
> enough space in the file system, so we found a wrong i_size.
> 
> This patch fixes this bug by updating the i_size just when we pass the file
> expanding and get enough space to update i-node.

Hmmm, have you tested this one with fsx-linux?  It should be ok to call
truncate_pagecache before bumping i_size in this case, since we
shouldn't have pages past i_size.

But, truncate_pagecache does expect i_size to be accurate before the
call.

-chris

  reply	other threads:[~2011-12-14 16:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-14  7:15 [PATCH 2/2] Btrfs: fix wrong i_size when truncating a file to a larger size Miao Xie
2011-12-14 16:51 ` Chris Mason [this message]
2011-12-15  6:02   ` Miao Xie
2011-12-15  9:55   ` [PATCH V2 " Miao Xie

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=20111214165147.GF31158@shiny \
    --to=chris.mason@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=miaox@cn.fujitsu.com \
    /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).