From: Baokun Li <libaokun1@huawei.com>
To: Jan Kara <jack@suse.cz>
Cc: <linux-ext4@vger.kernel.org>, <tytso@mit.edu>,
<adilger.kernel@dilger.ca>, <linux-kernel@vger.kernel.org>,
<yi.zhang@huawei.com>, <yangerkun@huawei.com>,
Baokun Li <libaokun1@huawei.com>,
Baokun Li <libaokun@huaweicloud.com>
Subject: Re: [PATCH v2 5/8] ext4: abort journal on data writeback failure if in data_err=abort mode
Date: Tue, 21 Jan 2025 19:43:21 +0800 [thread overview]
Message-ID: <094e349d-57c1-4450-b813-a774b6dad1cc@huawei.com> (raw)
In-Reply-To: <cuanusobp4oiptmmyruiimehe25zizbgdxgx5a7oudvo6repox@drpwkdfp7hpw>
On 2025/1/21 19:13, Jan Kara wrote:
> On Tue 21-01-25 15:10:47, libaokun@huaweicloud.com wrote:
>> From: Baokun Li <libaokun1@huawei.com>
>>
>> The data_err=abort was initially introduced to address users' worries
>> about data corruption spreading unnoticed. With direct writes, we can
>> rely on return values to confirm successful writes to disk. But with
>> buffered writes, a successful return only means the data has been written
>> to memory. Users have no way of knowing if the data has actually written
>> it to disk unless they use fsync (which impacts performance and can
>> sometimes miss errors).
>>
>> The current data_err=abort implementation relies on the ordered data list,
>> but past changes have inadvertently altered its behavior. For example, if
>> an extent is unwritten, we do not add the inode to the ordered data list.
>> Therefore, jbd2 will not wait for the data write-back of that inode to
>> complete and check for errors in the inode mapping. Moreover, the checks
>> performed by jbd2 can also miss errors.
>>
>> Now, all buffered writes eventually call ext4_end_bio(), where I/O errors
>> are checked. Therefore, we can check for the data_err=abort mode at this
>> point and abort the journal in a kworker (due to the interrupt context).
>>
>> Therefore, when data_err=abort is enabled, the journal is aborted in
>> ext4_end_io_end() when an I/O error is detected in ext4_end_bio() to make
>> users who are concerned about the contents of the file happy.
>>
>> Suggested-by: Jan Kara <jack@suse.cz>
>> Link: https://patch.msgid.link/c7ab26f3-85ad-4b31-b132-0afb0e07bf79@huawei.com
>> Signed-off-by: Baokun Li <libaokun1@huawei.com>
>> Reviewed-by: Zhang Yi <yi.zhang@huawei.com>
> Looks good. Feel free to add:
>
> Reviewed-by: Jan Kara <jack@suse.cz>
>
> Just one naming suggestion below:
Thank you for your review!
>
>> +#define EXT4_IO_END_NEED_COMPLETION (EXT4_IO_END_UNWRITTEN | EXT4_IO_END_FAILED)
> I'd call this EXT4_IO_END_DEFER_COMPLETION
>
>> +static bool ext4_io_end_need_completion(ext4_io_end_t *io_end)
> And this would then be ext4_io_end_defer_completion().
>
> Honza
Okay, I'll replace need_completion with defer_completion
in the next version.
Thanks,
Baokun
next prev parent reply other threads:[~2025-01-21 11:43 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-21 7:10 [PATCH v2 0/8] ext4: fix issues caused by data write-back failures libaokun
2025-01-21 7:10 ` [PATCH v2 1/8] ext4: replace opencoded ext4_end_io_end() in ext4_put_io_end() libaokun
2025-01-21 7:10 ` [PATCH v2 2/8] ext4: do not convert the unwritten extents if data writeback fails libaokun
2025-01-21 7:10 ` [PATCH v2 3/8] ext4: reject the 'data_err=abort' option in nojournal mode libaokun
2025-01-21 11:37 ` Jan Kara
2025-01-21 12:11 ` Baokun Li
2025-01-21 7:10 ` [PATCH v2 4/8] ext4: extract ext4_check_nojournal_options() from __ext4_fill_super() libaokun
2025-01-21 11:04 ` Jan Kara
2025-01-21 11:22 ` Baokun Li
2025-01-21 7:10 ` [PATCH v2 5/8] ext4: abort journal on data writeback failure if in data_err=abort mode libaokun
2025-01-21 11:13 ` Jan Kara
2025-01-21 11:43 ` Baokun Li [this message]
2025-01-21 7:10 ` [PATCH v2 6/8] ext4: update the descriptions of data_err=abort and data_err=ignore libaokun
2025-01-21 11:14 ` Jan Kara
2025-01-21 7:10 ` [PATCH v2 7/8] ext4: remove unused member 'i_unwritten' from 'ext4_inode_info' libaokun
2025-01-21 7:10 ` [PATCH v2 8/8] ext4: pack holes in ext4_inode_info libaokun
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=094e349d-57c1-4450-b813-a774b6dad1cc@huawei.com \
--to=libaokun1@huawei.com \
--cc=adilger.kernel@dilger.ca \
--cc=jack@suse.cz \
--cc=libaokun@huaweicloud.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
--cc=yangerkun@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 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®