mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Moyer <jmoyer@redhat.com>
To: Dmitri Monakhov <dmonakhov@openvz.org>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 1/2] fs: truncate blocks outside i_size after generic_file_direct_write error
Date: Mon, 20 Oct 2008 08:47:22 -0400	[thread overview]
Message-ID: <x498wsj302t.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <1224424981-5144-1-git-send-email-dmonakhov@openvz.org> (Dmitri Monakhov's message of "Sun, 19 Oct 2008 18:03:00 +0400")

Dmitri Monakhov <dmonakhov@openvz.org> writes:

> We need to remove block that was allocated in generic_file_direct_write()
> if we fail. We have to do it *regardless* to blocksize. At least ext2,
> ext3 and reiserfs interpret (i_size < biggest block) condition as error.
> Fsck will complain about wrong i_size. Then fsck will fix the error
> by changing i_size according to the biggest block. This is bad because
> this blocks contain gurbage from previous write attempt. And result in
> data corruption.
>
> In order to call vmtruncate() we have to hold host->i_mutex. This is true
> for generic_file_aio_write(). In fact occasionally it is also true for all
> generic_file_aio_write_nolock() callers except blockdev. But this situation
> may change someday. This patch fix only generic_write_aio_write() case.
> BTW: update generic_file_direct_write's comment with currently outdated.

Do you have a test case for this, by any chance?

Cheers,

Jeff

  parent reply	other threads:[~2008-10-20 12:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-19 14:03 Dmitri Monakhov
2008-10-19 14:03 ` [PATCH 2/2] ocfs2: truncate outstanding block after direct io failure Dmitri Monakhov
2008-10-20 12:47 ` Jeff Moyer [this message]
2008-10-20 13:43   ` [PATCH 1/2] fs: truncate blocks outside i_size after generic_file_direct_write error Dmitri Monakhov

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=x498wsj302t.fsf@segfault.boston.devel.redhat.com \
    --to=jmoyer@redhat.com \
    --cc=dmonakhov@openvz.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®