From: Jan Kara <jack@suse.cz>
To: zhangshida <starzhangzsd@gmail.com>
Cc: tytso@mit.edu, adilger.kernel@dilger.ca, jack@suse.com,
ebiggers@kernel.org, linux-ext4@vger.kernel.org,
linux-kernel@vger.kernel.org, zhangshida@kylinos.cn,
Jan Kara <jack@suse.cz>
Subject: Re: [PATCH 2/3] ext4: hoist ext4_block_write_begin and replace the __block_write_begin
Date: Thu, 29 Aug 2024 11:26:31 +0200 [thread overview]
Message-ID: <20240829092631.oa2fxpfs3ok6uzbw@quack3> (raw)
In-Reply-To: <20240829091250.gq2cgkfubbvlysxy@quack3>
On Thu 29-08-24 11:12:50, Jan Kara wrote:
> On Thu 29-08-24 16:54:06, zhangshida wrote:
> > From: Shida Zhang <zhangshida@kylinos.cn>
> >
> > Using __block_write_begin() make it inconvenient to journal the
> > user data dirty process. We can't tell the block layer maintainer,
> > ‘Hey, we want to trace the dirty user data in ext4, can we add some
> > special code for ext4 in __block_write_begin?’:P
> >
> > So use ext4_block_write_begin() instead.
> >
> > The two functions are basically doing the same thing except for the
> > fscrypt related code. Remove the unnecessary #ifdef since
> > fscrypt_inode_uses_fs_layer_crypto() returns false (and it's known at
> > compile time) when !CONFIG_FS_ENCRYPTION.
> >
> > And hoist the ext4_block_write_begin so that it can be used in other
> > files.
> >
> > Suggested-by: Jan Kara <jack@suse.cz>
> > Suggested-by: Eric Biggers <ebiggers@kernel.org>
> > Signed-off-by: Shida Zhang <zhangshida@kylinos.cn>
>
> I think I've given my Reviewed-by on this already in previous version - you
> can keep those tags unless the patch significantly changes. Anyway: feel
> free to add:
>
> Reviewed-by: Jan Kara <jack@suse.cz>
I've realized the patch slightly changed so that's likely why you've
dropped the Reviewed-by so I retract my comment :)
I've also realized one thing:
> > --- a/fs/ext4/inode.c
> > +++ b/fs/ext4/inode.c
> > @@ -1024,10 +1024,10 @@ int do_journal_get_write_access(handle_t *handle, struct inode *inode,
> > if (!buffer_mapped(bh) || buffer_freed(bh))
> > return 0;
> > /*
> > - * __block_write_begin() could have dirtied some buffers. Clean
> > + * ext4_block_write_begin() could have dirtied some buffers. Clean
> > * the dirty bit as jbd2_journal_get_write_access() could complain
> > * otherwise about fs integrity issues. Setting of the dirty bit
> > - * by __block_write_begin() isn't a real problem here as we clear
> > + * by ext4_block_write_begin() isn't a real problem here as we clear
> > * the bit before releasing a page lock and thus writeback cannot
> > * ever write the buffer.
> > */
This comment and the special buffer_dirty() handling in this function can
be removed after patch 3 of this series. Nice additional cleanup :).
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2024-08-29 9:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-29 8:54 [PATCH v5 0/3] Fix an error caused by improperly dirtied buffer zhangshida
2024-08-29 8:54 ` [PATCH 1/3] ext4: persist the new uptodate buffers in ext4_journalled_zero_new_buffers zhangshida
2024-08-29 9:11 ` Jan Kara
2024-08-29 8:54 ` [PATCH 2/3] ext4: hoist ext4_block_write_begin and replace the __block_write_begin zhangshida
2024-08-29 9:12 ` Jan Kara
2024-08-29 9:26 ` Jan Kara [this message]
2024-08-29 8:54 ` [PATCH 3/3] ext4: fix a potential assertion failure due to improperly dirtied buffer zhangshida
2024-08-29 9:30 ` Jan Kara
2024-08-30 2:03 ` Stephen Zhang
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=20240829092631.oa2fxpfs3ok6uzbw@quack3 \
--to=jack@suse.cz \
--cc=adilger.kernel@dilger.ca \
--cc=ebiggers@kernel.org \
--cc=jack@suse.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=starzhangzsd@gmail.com \
--cc=tytso@mit.edu \
--cc=zhangshida@kylinos.cn \
/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