Skip to content

Commit 2d91b37

Browse files
Lizhi Xukleikamp
authored andcommitted
jfs: truncate good inode pages when hard link is 0
The fileset value of the inode copy from the disk by the reproducer is AGGR_RESERVED_I. When executing evict, its hard link number is 0, so its inode pages are not truncated. This causes the bugon to be triggered when executing clear_inode() because nrpages is greater than 0. Reported-by: [email protected] Closes: https://syzkaller.appspot.com/bug?extid=6e516bb515d93230bc7b Signed-off-by: Lizhi Xu <[email protected]> Signed-off-by: Dave Kleikamp <[email protected]>
1 parent 1014354 commit 2d91b37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/jfs/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ void jfs_evict_inode(struct inode *inode)
145145
if (!inode->i_nlink && !is_bad_inode(inode)) {
146146
dquot_initialize(inode);
147147

148+
truncate_inode_pages_final(&inode->i_data);
148149
if (JFS_IP(inode)->fileset == FILESYSTEM_I) {
149150
struct inode *ipimap = JFS_SBI(inode->i_sb)->ipimap;
150-
truncate_inode_pages_final(&inode->i_data);
151151

152152
if (test_cflag(COMMIT_Freewmap, inode))
153153
jfs_free_zero_link(inode);

0 commit comments

Comments
 (0)