From: "Theodore Y. Ts'o" <tytso@mit.edu>
To: "zhangyi (F)" <yi.zhang@huawei.com>
Cc: <linux-ext4@vger.kernel.org>, <jack@suse.cz>,
<adilger.kernel@dilger.ca>, <miaoxie@huawei.com>
Subject: Re: [PATCH v4 2/4] jbd2: discard dirty data when forgetting an un-journalled buffer
Date: Sun, 10 Feb 2019 23:31:28 -0500 [thread overview]
Message-ID: <20190211043128.GF23000@mit.edu> (raw)
In-Reply-To: <1548830980-29482-3-git-send-email-yi.zhang@huawei.com>
On Wed, Jan 30, 2019 at 02:49:38PM +0800, zhangyi (F) wrote:
> We do not unmap and clear dirty flag when forgetting a buffer without
> journal or does not belongs to any transaction, so the invalid dirty
> data may still be written to the disk later. It's fine if the
> corresponding block is never used before the next mount, and it's also
> fine that we invoke clean_bdev_aliases() related functions to unmap
> the block device mapping when re-allocating such freed block as data
> block. But this logic is somewhat fragile and risky that may lead to
> data corruption if we forget to clean bdev aliases. So, It's better to
> discard dirty data during forget time.
>
> We have been already handled all the cases of forgetting journalled
> buffer, this patch deal with the remaining two cases.
>
> - buffer is not journalled yet,
> - buffer is journalled but doesn't belongs to any transaction.
>
> We invoke __bforget() instead of __brelese() when forgetting an
> un-journalled buffer in jbd2_journal_forget(). After this patch we can
> remove all clean_bdev_aliases() related calls in ext4.
>
> Suggested-by: Jan Kara <jack@suse.cz>
> Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
> Reviewed-by: Jan Kara <jack@suse.cz>
Thanks, applied.
- Ted
next prev parent reply other threads:[~2019-02-11 4:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-30 6:49 [PATCH v4 0/4] ext4: fix a data corruption problem zhangyi (F)
2019-01-30 6:49 ` [PATCH v4 1/4] jbd2: make sure dirty flag is cleared while revorking a buffer which belongs to older transaction zhangyi (F)
2019-02-11 4:24 ` Theodore Y. Ts'o
2019-02-12 12:20 ` zhangyi (F)
2019-01-30 6:49 ` [PATCH v4 2/4] jbd2: discard dirty data when forgetting an un-journalled buffer zhangyi (F)
2019-02-11 4:31 ` Theodore Y. Ts'o [this message]
2019-01-30 6:49 ` [PATCH v4 3/4] ext4: cleanup clean_bdev_aliases() calls zhangyi (F)
2019-02-11 4:38 ` Theodore Y. Ts'o
2019-01-30 6:49 ` [PATCH v4 4/4] ext4: convert ext4_split_extent() to return requested length zhangyi (F)
2019-02-11 4:49 ` Theodore Y. Ts'o
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=20190211043128.GF23000@mit.edu \
--to=tytso@mit.edu \
--cc=adilger.kernel@dilger.ca \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=miaoxie@huawei.com \
--cc=yi.zhang@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.