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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'jffs2-for-linus-6.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs

Pull jffs2 updates from Richard Weinberger:

- Fix illegal memory access in jffs2_free_inode()

- Kernel-doc fixes

- print symbolic error names

* tag 'jffs2-for-linus-6.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs:
jffs2: Fix potential illegal address access in jffs2_free_inode
jffs2: Simplify the allocation of slab caches
jffs2: nodemgmt: fix kernel-doc comments
jffs2: print symbolic error name instead of error code

+26 -35
+2 -2
fs/jffs2/background.c
··· 44 44 45 45 tsk = kthread_run(jffs2_garbage_collect_thread, c, "jffs2_gcd_mtd%d", c->mtd->index); 46 46 if (IS_ERR(tsk)) { 47 - pr_warn("fork failed for JFFS2 garbage collect thread: %ld\n", 48 - -PTR_ERR(tsk)); 47 + pr_warn("fork failed for JFFS2 garbage collect thread: %pe\n", 48 + tsk); 49 49 complete(&c->gc_thread_exit); 50 50 ret = PTR_ERR(tsk); 51 51 } else {
+8 -24
fs/jffs2/malloc.c
··· 33 33 34 34 int __init jffs2_create_slab_caches(void) 35 35 { 36 - full_dnode_slab = kmem_cache_create("jffs2_full_dnode", 37 - sizeof(struct jffs2_full_dnode), 38 - 0, 0, NULL); 36 + full_dnode_slab = KMEM_CACHE(jffs2_full_dnode, 0); 39 37 if (!full_dnode_slab) 40 38 goto err; 41 39 42 - raw_dirent_slab = kmem_cache_create("jffs2_raw_dirent", 43 - sizeof(struct jffs2_raw_dirent), 44 - 0, SLAB_HWCACHE_ALIGN, NULL); 40 + raw_dirent_slab = KMEM_CACHE(jffs2_raw_dirent, SLAB_HWCACHE_ALIGN); 45 41 if (!raw_dirent_slab) 46 42 goto err; 47 43 48 - raw_inode_slab = kmem_cache_create("jffs2_raw_inode", 49 - sizeof(struct jffs2_raw_inode), 50 - 0, SLAB_HWCACHE_ALIGN, NULL); 44 + raw_inode_slab = KMEM_CACHE(jffs2_raw_inode, SLAB_HWCACHE_ALIGN); 51 45 if (!raw_inode_slab) 52 46 goto err; 53 47 54 - tmp_dnode_info_slab = kmem_cache_create("jffs2_tmp_dnode", 55 - sizeof(struct jffs2_tmp_dnode_info), 56 - 0, 0, NULL); 48 + tmp_dnode_info_slab = KMEM_CACHE(jffs2_tmp_dnode_info, 0); 57 49 if (!tmp_dnode_info_slab) 58 50 goto err; 59 51 ··· 55 63 if (!raw_node_ref_slab) 56 64 goto err; 57 65 58 - node_frag_slab = kmem_cache_create("jffs2_node_frag", 59 - sizeof(struct jffs2_node_frag), 60 - 0, 0, NULL); 66 + node_frag_slab = KMEM_CACHE(jffs2_node_frag, 0); 61 67 if (!node_frag_slab) 62 68 goto err; 63 69 64 - inode_cache_slab = kmem_cache_create("jffs2_inode_cache", 65 - sizeof(struct jffs2_inode_cache), 66 - 0, 0, NULL); 70 + inode_cache_slab = KMEM_CACHE(jffs2_inode_cache, 0); 67 71 if (!inode_cache_slab) 68 72 goto err; 69 73 70 74 #ifdef CONFIG_JFFS2_FS_XATTR 71 - xattr_datum_cache = kmem_cache_create("jffs2_xattr_datum", 72 - sizeof(struct jffs2_xattr_datum), 73 - 0, 0, NULL); 75 + xattr_datum_cache = KMEM_CACHE(jffs2_xattr_datum, 0); 74 76 if (!xattr_datum_cache) 75 77 goto err; 76 78 77 - xattr_ref_cache = kmem_cache_create("jffs2_xattr_ref", 78 - sizeof(struct jffs2_xattr_ref), 79 - 0, 0, NULL); 79 + xattr_ref_cache = KMEM_CACHE(jffs2_xattr_ref, 0); 80 80 if (!xattr_ref_cache) 81 81 goto err; 82 82 #endif
+15 -9
fs/jffs2/nodemgmt.c
··· 49 49 return 0; 50 50 } 51 51 52 + static int jffs2_do_reserve_space(struct jffs2_sb_info *c, uint32_t minsize, 53 + uint32_t *len, uint32_t sumsize); 54 + 52 55 /** 53 56 * jffs2_reserve_space - request physical space to write nodes to flash 54 57 * @c: superblock info 55 58 * @minsize: Minimum acceptable size of allocation 56 59 * @len: Returned value of allocation length 57 60 * @prio: Allocation type - ALLOC_{NORMAL,DELETION} 61 + * @sumsize: summary size requested or JFFS2_SUMMARY_NOSUM_SIZE for no summary 58 62 * 59 - * Requests a block of physical space on the flash. Returns zero for success 60 - * and puts 'len' into the appropriate place, or returns -ENOSPC or other 61 - * error if appropriate. Doesn't return len since that's 63 + * Requests a block of physical space on the flash. 62 64 * 63 - * If it returns zero, jffs2_reserve_space() also downs the per-filesystem 65 + * Returns: %0 for success and puts 'len' into the appropriate place, 66 + * or returns -ENOSPC or other error if appropriate. 67 + * Doesn't return len since that's already returned in @len. 68 + * 69 + * If it returns %0, jffs2_reserve_space() also downs the per-filesystem 64 70 * allocation semaphore, to prevent more than one allocation from being 65 - * active at any time. The semaphore is later released by jffs2_commit_allocation() 71 + * active at any time. The semaphore is later released by jffs2_commit_allocation(). 66 72 * 67 73 * jffs2_reserve_space() may trigger garbage collection in order to make room 68 74 * for the requested allocation. 69 75 */ 70 - 71 - static int jffs2_do_reserve_space(struct jffs2_sb_info *c, uint32_t minsize, 72 - uint32_t *len, uint32_t sumsize); 73 76 74 77 int jffs2_reserve_space(struct jffs2_sb_info *c, uint32_t minsize, 75 78 uint32_t *len, int prio, uint32_t sumsize) ··· 491 488 /** 492 489 * jffs2_add_physical_node_ref - add a physical node reference to the list 493 490 * @c: superblock info 494 - * @new: new node reference to add 491 + * @ofs: offset in the block 495 492 * @len: length of this physical node 493 + * @ic: inode cache pointer 496 494 * 497 495 * Should only be used to report nodes for which space has been allocated 498 496 * by jffs2_reserve_space. 499 497 * 500 498 * Must be called with the alloc_sem held. 499 + * 500 + * Returns: pointer to new node on success or -errno code on error 501 501 */ 502 502 503 503 struct jffs2_raw_node_ref *jffs2_add_physical_node_ref(struct jffs2_sb_info *c,
+1
fs/jffs2/super.c
··· 58 58 struct jffs2_inode_info *f = foo; 59 59 60 60 mutex_init(&f->sem); 61 + f->target = NULL; 61 62 inode_init_once(&f->vfs_inode); 62 63 } 63 64