Merge tag 'erofs-for-6.10-rc7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs
Pull erofs fixes from Gao Xiang: "The most important one fixes possible infinite loops reported by a smartphone vendor OPPO recently due to some unexpected zero-sized compressed pcluster out of interrupted I/Os, storage failures, etc. Another patch fixes global buffer memory leak on unloading, and the remaining one switches to use super_set_uuid() to keep with the other filesystems. Summary: - Fix possible global buffer memory leak when unloading EROFS module - Fix FS_IOC_GETFSUUID ioctl by using super_set_uuid() - Reset m_llen to 0 so then it can retry if metadata is invalid" * tag 'erofs-for-6.10-rc7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs: erofs: ensure m_llen is reset to 0 if metadata is invalid erofs: convert to use super_set_uuid to support for FS_IOC_GETFSUUID erofs: fix possible memory leak in z_erofs_gbuf_exit()
This commit is contained in:
+1
-1
@@ -343,7 +343,7 @@ static int erofs_read_superblock(struct super_block *sb)
|
||||
sbi->build_time = le64_to_cpu(dsb->build_time);
|
||||
sbi->build_time_nsec = le32_to_cpu(dsb->build_time_nsec);
|
||||
|
||||
memcpy(&sb->s_uuid, dsb->uuid, sizeof(dsb->uuid));
|
||||
super_set_uuid(sb, (void *)dsb->uuid, sizeof(dsb->uuid));
|
||||
|
||||
ret = strscpy(sbi->volume_name, dsb->volume_name,
|
||||
sizeof(dsb->volume_name));
|
||||
|
||||
@@ -711,6 +711,8 @@ int z_erofs_map_blocks_iter(struct inode *inode, struct erofs_map_blocks *map,
|
||||
|
||||
err = z_erofs_do_map_blocks(inode, map, flags);
|
||||
out:
|
||||
if (err)
|
||||
map->m_llen = 0;
|
||||
trace_z_erofs_map_blocks_iter_exit(inode, map, flags, err);
|
||||
return err;
|
||||
}
|
||||
|
||||
+4
-4
@@ -148,7 +148,7 @@ int __init z_erofs_gbuf_init(void)
|
||||
|
||||
void z_erofs_gbuf_exit(void)
|
||||
{
|
||||
int i;
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < z_erofs_gbuf_count + (!!z_erofs_rsvbuf); ++i) {
|
||||
struct z_erofs_gbuf *gbuf = &z_erofs_gbufpool[i];
|
||||
@@ -161,9 +161,9 @@ void z_erofs_gbuf_exit(void)
|
||||
if (!gbuf->pages)
|
||||
continue;
|
||||
|
||||
for (i = 0; i < gbuf->nrpages; ++i)
|
||||
if (gbuf->pages[i])
|
||||
put_page(gbuf->pages[i]);
|
||||
for (j = 0; j < gbuf->nrpages; ++j)
|
||||
if (gbuf->pages[j])
|
||||
put_page(gbuf->pages[j]);
|
||||
kfree(gbuf->pages);
|
||||
gbuf->pages = NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user