[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z-Lunpbeh176mwRu@li-dc0c254c-257c-11b2-a85c-98b6c1322444.ibm.com>
Date: Tue, 25 Mar 2025 23:27:50 +0530
From: Ojaswin Mujoo <ojaswin@...ux.ibm.com>
To: "Theodore Ts'o" <tytso@....edu>
Cc: linux-ext4@...r.kernel.org, Jan Kara <jack@...e.cz>,
Baokun Li <libaokun1@...wei.com>,
Ritesh Harjani <ritesh.list@...il.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ext4: cache es->s_journal_inum in ext4_sb_info
On Tue, Mar 18, 2025 at 10:31:29PM -0400, Theodore Ts'o wrote:
> On Tue, Mar 18, 2025 at 01:42:31PM +0530, Ojaswin Mujoo wrote:
> > > So this is something we need to do if the journal is actived, and if
> > > it's active, then sbi->s_journal will be non-NULL, and so we can just
> > > check to see if inode == sbi->s_journal instead. This will simplify
> >
> > I believe you mean inode == sbi->s_journal->j_inode here right?
>
> Yes, that's what I meant; sorry for the not catching this before I
> sent my reply.
>
> Cheers,
>
> - Ted
Hi Ted, Baokun,
I got some time to revisit this. Seems like checking against
s_journal->j_inode is not enough. This is because both
ext4_check_blockref() and check_block_validity() can be called even
before journal->j_inode is set:
ext4_open_inode_journal
ext4_get_journal_inode
__ext4_iget
ext4_ind_check_inode
ext4_check_blockref /* j_inode not set */
journal = jbd2_journal_init_inode
bmap
ext4_bmap
iomap_bmap
ext4_iomap_begin
ext4_map_blocks
check_block_validity
journal->j_inode = inode
Now, I think in this case the best solution might be to use the extra
field like we do in this patch but set EXT4_SB(sb)->s_journal_ino
sufficiently early.
Thoughts?
Powered by blists - more mailing lists