Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'erofs-for-5.15-rc3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs

Pull erofs fixes from Gao Xiang:
"Two bugfixes to fix the 4KiB blockmap chunk format availability and a
dangling pointer usage. There is also a trivial cleanup to clarify
compacted_2b if compacted_4b_initial > totalidx.

Summary:

- fix the dangling pointer use in erofs_lookup tracepoint

- fix unsupported chunk format check

- zero out compacted_2b if compacted_4b_initial > totalidx"

* tag 'erofs-for-5.15-rc3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs:
erofs: clear compacted_2b if compacted_4b_initial > totalidx
erofs: fix misbehavior of unsupported chunk format check
erofs: fix up erofs_lookup tracepoint

+6 -5
+1 -1
fs/erofs/inode.c
··· 176 176 } 177 177 178 178 if (vi->datalayout == EROFS_INODE_CHUNK_BASED) { 179 - if (!(vi->chunkformat & EROFS_CHUNK_FORMAT_ALL)) { 179 + if (vi->chunkformat & ~EROFS_CHUNK_FORMAT_ALL) { 180 180 erofs_err(inode->i_sb, 181 181 "unsupported chunk format %x of nid %llu", 182 182 vi->chunkformat, vi->nid);
+2 -1
fs/erofs/zmap.c
··· 369 369 if (compacted_4b_initial == 32 / 4) 370 370 compacted_4b_initial = 0; 371 371 372 - if (vi->z_advise & Z_EROFS_ADVISE_COMPACTED_2B) 372 + if ((vi->z_advise & Z_EROFS_ADVISE_COMPACTED_2B) && 373 + compacted_4b_initial < totalidx) 373 374 compacted_2b = rounddown(totalidx - compacted_4b_initial, 16); 374 375 else 375 376 compacted_2b = 0;
+3 -3
include/trace/events/erofs.h
··· 35 35 TP_STRUCT__entry( 36 36 __field(dev_t, dev ) 37 37 __field(erofs_nid_t, nid ) 38 - __field(const char *, name ) 38 + __string(name, dentry->d_name.name ) 39 39 __field(unsigned int, flags ) 40 40 ), 41 41 42 42 TP_fast_assign( 43 43 __entry->dev = dir->i_sb->s_dev; 44 44 __entry->nid = EROFS_I(dir)->nid; 45 - __entry->name = dentry->d_name.name; 45 + __assign_str(name, dentry->d_name.name); 46 46 __entry->flags = flags; 47 47 ), 48 48 49 49 TP_printk("dev = (%d,%d), pnid = %llu, name:%s, flags:%x", 50 50 show_dev_nid(__entry), 51 - __entry->name, 51 + __get_str(name), 52 52 __entry->flags) 53 53 ); 54 54