Skip to content

Commit df3319a

Browse files
committed
Merge tag 'erofs-for-5.10-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs
Pull erofs fixes from Gao Xiang: "A week ago, Vladimir reported an issue that the kernel log would become polluted if the page allocation debug option is enabled. I also found this when I cleaned up magical page->mapping and originally planned to submit these all for 5.11 but it seems the impact can be noticed so submit the fix in advance. In addition, nl6720 also reported that atime is empty although EROFS has the only one on-disk timestamp as a practical consideration for now but it's better to derive it as what we did for the other timestamps. Summary: - fix setting up pcluster improperly for temporary pages - derive atime instead of leaving it empty" * tag 'erofs-for-5.10-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs: erofs: fix setting up pcluster for temporary pages erofs: derive atime instead of leaving it empty
2 parents f8394f2 + a30573b commit df3319a

2 files changed

Lines changed: 16 additions & 12 deletions

File tree

fs/erofs/inode.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,9 @@ static struct page *erofs_read_inode(struct inode *inode,
107107
i_gid_write(inode, le32_to_cpu(die->i_gid));
108108
set_nlink(inode, le32_to_cpu(die->i_nlink));
109109

110-
/* ns timestamp */
111-
inode->i_mtime.tv_sec = inode->i_ctime.tv_sec =
112-
le64_to_cpu(die->i_ctime);
113-
inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec =
114-
le32_to_cpu(die->i_ctime_nsec);
110+
/* extended inode has its own timestamp */
111+
inode->i_ctime.tv_sec = le64_to_cpu(die->i_ctime);
112+
inode->i_ctime.tv_nsec = le32_to_cpu(die->i_ctime_nsec);
115113

116114
inode->i_size = le64_to_cpu(die->i_size);
117115

@@ -149,11 +147,9 @@ static struct page *erofs_read_inode(struct inode *inode,
149147
i_gid_write(inode, le16_to_cpu(dic->i_gid));
150148
set_nlink(inode, le16_to_cpu(dic->i_nlink));
151149

152-
/* use build time to derive all file time */
153-
inode->i_mtime.tv_sec = inode->i_ctime.tv_sec =
154-
sbi->build_time;
155-
inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec =
156-
sbi->build_time_nsec;
150+
/* use build time for compact inodes */
151+
inode->i_ctime.tv_sec = sbi->build_time;
152+
inode->i_ctime.tv_nsec = sbi->build_time_nsec;
157153

158154
inode->i_size = le32_to_cpu(dic->i_size);
159155
if (erofs_inode_is_data_compressed(vi->datalayout))
@@ -167,6 +163,11 @@ static struct page *erofs_read_inode(struct inode *inode,
167163
goto err_out;
168164
}
169165

166+
inode->i_mtime.tv_sec = inode->i_ctime.tv_sec;
167+
inode->i_atime.tv_sec = inode->i_ctime.tv_sec;
168+
inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec;
169+
inode->i_atime.tv_nsec = inode->i_ctime.tv_nsec;
170+
170171
if (!nblks)
171172
/* measure inode.i_blocks as generic filesystems */
172173
inode->i_blocks = roundup(inode->i_size, EROFS_BLKSIZ) >> 9;

fs/erofs/zdata.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,8 +1078,11 @@ static struct page *pickup_page_for_submission(struct z_erofs_pcluster *pcl,
10781078
cond_resched();
10791079
goto repeat;
10801080
}
1081-
set_page_private(page, (unsigned long)pcl);
1082-
SetPagePrivate(page);
1081+
1082+
if (tocache) {
1083+
set_page_private(page, (unsigned long)pcl);
1084+
SetPagePrivate(page);
1085+
}
10831086
out: /* the only exit (for tracing and debugging) */
10841087
return page;
10851088
}

0 commit comments

Comments
 (0)