Merge tag 'mm-nonmm-stable-2025-12-11-11-47' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull misc updates from Andrew Morton:
"There are no significant series in this small merge. Please see the
individual changelogs for details"

[ Editor's note: it's mainly ocfs2 and a couple of random fixes ]

* tag 'mm-nonmm-stable-2025-12-11-11-47' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
mm: memfd_luo: add CONFIG_SHMEM dependency
mm: shmem: avoid build warning for CONFIG_SHMEM=n
ocfs2: fix memory leak in ocfs2_merge_rec_left()
ocfs2: invalidate inode if i_mode is zero after block read
ocfs2: avoid -Wflex-array-member-not-at-end warning
ocfs2: convert remaining read-only checks to ocfs2_emergency_state
ocfs2: add ocfs2_emergency_state helper and apply to setattr
checkpatch: add uninitialized pointer with __free attribute check
args: fix documentation to reflect the correct numbers
ocfs2: fix kernel BUG in ocfs2_find_victim_chain
liveupdate: luo_core: fix redundant bound check in luo_ioctl()
ocfs2: validate inline xattr size and entry count in ocfs2_xattr_ibody_list
fs/fat: remove unnecessary wrapper fat_max_cache()
ocfs2: replace deprecated strcpy with strscpy
ocfs2: check tl_used after reading it from trancate log inode
liveupdate: luo_file: don't use invalid list iterator

+154 -44
+23
Documentation/dev-tools/checkpatch.rst
··· 1002 1002 1003 1003 return bar; 1004 1004 1005 + **UNINITIALIZED_PTR_WITH_FREE** 1006 + Pointers with __free attribute should be declared at the place of use 1007 + and initialized (see include/linux/cleanup.h). In this case 1008 + declarations at the top of the function rule can be relaxed. Not doing 1009 + so may lead to undefined behavior as the memory assigned (garbage, 1010 + in case not initialized) to the pointer is freed automatically when 1011 + the pointer goes out of scope. 1012 + 1013 + Also see: https://lore.kernel.org/lkml/58fd478f408a34b578ee8d949c5c4b4da4d4f41d.camel@HansenPartnership.com/ 1014 + 1015 + Example:: 1016 + 1017 + type var __free(free_func); 1018 + ... // var not used, but, in future someone might add a return here 1019 + var = malloc(var_size); 1020 + ... 1021 + 1022 + should be initialized as:: 1023 + 1024 + ... 1025 + type var __free(free_func) = malloc(var_size); 1026 + ... 1027 + 1005 1028 1006 1029 Permissions 1007 1030 -----------
+1 -6
fs/fat/cache.c
··· 29 29 int dcluster; 30 30 }; 31 31 32 - static inline int fat_max_cache(struct inode *inode) 33 - { 34 - return FAT_MAX_CACHE; 35 - } 36 - 37 32 static struct kmem_cache *fat_cache_cachep; 38 33 39 34 static void init_once(void *foo) ··· 140 145 141 146 cache = fat_cache_merge(inode, new); 142 147 if (cache == NULL) { 143 - if (MSDOS_I(inode)->nr_caches < fat_max_cache(inode)) { 148 + if (MSDOS_I(inode)->nr_caches < FAT_MAX_CACHE) { 144 149 MSDOS_I(inode)->nr_caches++; 145 150 spin_unlock(&MSDOS_I(inode)->cache_lru_lock); 146 151
+7 -5
fs/ocfs2/alloc.c
··· 10 10 #include <linux/fs.h> 11 11 #include <linux/types.h> 12 12 #include <linux/slab.h> 13 + #include <linux/string.h> 13 14 #include <linux/highmem.h> 14 15 #include <linux/swap.h> 15 16 #include <linux/quotaops.h> ··· 1038 1037 memset(bhs[i]->b_data, 0, osb->sb->s_blocksize); 1039 1038 eb = (struct ocfs2_extent_block *) bhs[i]->b_data; 1040 1039 /* Ok, setup the minimal stuff here. */ 1041 - strcpy(eb->h_signature, OCFS2_EXTENT_BLOCK_SIGNATURE); 1040 + strscpy(eb->h_signature, OCFS2_EXTENT_BLOCK_SIGNATURE); 1042 1041 eb->h_blkno = cpu_to_le64(first_blkno); 1043 1042 eb->h_fs_generation = cpu_to_le32(osb->fs_generation); 1044 1043 eb->h_suballoc_slot = ··· 3655 3654 * So we use the new rightmost path. 3656 3655 */ 3657 3656 ocfs2_mv_path(right_path, left_path); 3658 - left_path = NULL; 3659 3657 } else 3660 3658 ocfs2_complete_edge_insert(handle, left_path, 3661 3659 right_path, subtree_index); ··· 6164 6164 struct buffer_head *bh = NULL; 6165 6165 struct ocfs2_dinode *di; 6166 6166 struct ocfs2_truncate_log *tl; 6167 - unsigned int tl_count; 6167 + unsigned int tl_count, tl_used; 6168 6168 6169 6169 inode = ocfs2_get_system_file_inode(osb, 6170 6170 TRUNCATE_LOG_SYSTEM_INODE, ··· 6185 6185 di = (struct ocfs2_dinode *)bh->b_data; 6186 6186 tl = &di->id2.i_dealloc; 6187 6187 tl_count = le16_to_cpu(tl->tl_count); 6188 + tl_used = le16_to_cpu(tl->tl_used); 6188 6189 if (unlikely(tl_count > ocfs2_truncate_recs_per_inode(osb->sb) || 6189 - tl_count == 0)) { 6190 + tl_count == 0 || 6191 + tl_used > tl_count)) { 6190 6192 status = -EFSCORRUPTED; 6191 6193 iput(inode); 6192 6194 brelse(bh); ··· 6746 6744 /* We can't guarantee that buffer head is still cached, so 6747 6745 * polutlate the extent block again. 6748 6746 */ 6749 - strcpy(eb->h_signature, OCFS2_EXTENT_BLOCK_SIGNATURE); 6747 + strscpy(eb->h_signature, OCFS2_EXTENT_BLOCK_SIGNATURE); 6750 6748 eb->h_blkno = cpu_to_le64(bf->free_blk); 6751 6749 eb->h_fs_generation = cpu_to_le32(osb->fs_generation); 6752 6750 eb->h_suballoc_slot = cpu_to_le16(real_slot);
+1 -1
fs/ocfs2/buffer_head_io.c
··· 434 434 BUG_ON(buffer_jbd(bh)); 435 435 ocfs2_check_super_or_backup(osb->sb, bh->b_blocknr); 436 436 437 - if (ocfs2_is_hard_readonly(osb) || ocfs2_is_soft_readonly(osb)) { 437 + if (unlikely(ocfs2_emergency_state(osb))) { 438 438 ret = -EROFS; 439 439 mlog_errno(ret); 440 440 goto out;
+2 -1
fs/ocfs2/cluster/nodemanager.c
··· 4 4 */ 5 5 6 6 #include <linux/slab.h> 7 + #include <linux/string.h> 7 8 #include <linux/kernel.h> 8 9 #include <linux/module.h> 9 10 #include <linux/configfs.h> ··· 591 590 if (node == NULL) 592 591 return ERR_PTR(-ENOMEM); 593 592 594 - strcpy(node->nd_name, name); /* use item.ci_namebuf instead? */ 593 + strscpy(node->nd_name, name); /* use item.ci_namebuf instead? */ 595 594 config_item_init_type_name(&node->nd_item, name, &o2nm_node_type); 596 595 spin_lock_init(&node->nd_lock); 597 596
+5 -5
fs/ocfs2/dir.c
··· 136 136 struct ocfs2_dir_block_trailer *trailer; 137 137 138 138 trailer = ocfs2_trailer_from_bh(bh, inode->i_sb); 139 - strcpy(trailer->db_signature, OCFS2_DIR_TRAILER_SIGNATURE); 139 + strscpy(trailer->db_signature, OCFS2_DIR_TRAILER_SIGNATURE); 140 140 trailer->db_compat_rec_len = 141 141 cpu_to_le16(sizeof(struct ocfs2_dir_block_trailer)); 142 142 trailer->db_parent_dinode = cpu_to_le64(OCFS2_I(inode)->ip_blkno); ··· 2213 2213 de->name_len = 1; 2214 2214 de->rec_len = 2215 2215 cpu_to_le16(OCFS2_DIR_REC_LEN(de->name_len)); 2216 - strcpy(de->name, "."); 2216 + strscpy(de->name, "."); 2217 2217 ocfs2_set_de_type(de, S_IFDIR); 2218 2218 2219 2219 de = (struct ocfs2_dir_entry *) ((char *)de + le16_to_cpu(de->rec_len)); 2220 2220 de->inode = cpu_to_le64(OCFS2_I(parent)->ip_blkno); 2221 2221 de->rec_len = cpu_to_le16(size - OCFS2_DIR_REC_LEN(1)); 2222 2222 de->name_len = 2; 2223 - strcpy(de->name, ".."); 2223 + strscpy(de->name, ".."); 2224 2224 ocfs2_set_de_type(de, S_IFDIR); 2225 2225 2226 2226 return de; ··· 2378 2378 2379 2379 dx_root = (struct ocfs2_dx_root_block *)dx_root_bh->b_data; 2380 2380 memset(dx_root, 0, osb->sb->s_blocksize); 2381 - strcpy(dx_root->dr_signature, OCFS2_DX_ROOT_SIGNATURE); 2381 + strscpy(dx_root->dr_signature, OCFS2_DX_ROOT_SIGNATURE); 2382 2382 dx_root->dr_suballoc_slot = cpu_to_le16(meta_ac->ac_alloc_slot); 2383 2383 dx_root->dr_suballoc_loc = cpu_to_le64(suballoc_loc); 2384 2384 dx_root->dr_suballoc_bit = cpu_to_le16(dr_suballoc_bit); ··· 2454 2454 dx_leaf = (struct ocfs2_dx_leaf *) bh->b_data; 2455 2455 2456 2456 memset(dx_leaf, 0, osb->sb->s_blocksize); 2457 - strcpy(dx_leaf->dl_signature, OCFS2_DX_LEAF_SIGNATURE); 2457 + strscpy(dx_leaf->dl_signature, OCFS2_DX_LEAF_SIGNATURE); 2458 2458 dx_leaf->dl_fs_generation = cpu_to_le32(osb->fs_generation); 2459 2459 dx_leaf->dl_blkno = cpu_to_le64(bh->b_blocknr); 2460 2460 dx_leaf->dl_list.de_count =
+10 -4
fs/ocfs2/file.c
··· 179 179 file->f_path.dentry->d_name.name, 180 180 (unsigned long long)datasync); 181 181 182 - if (ocfs2_is_hard_readonly(osb) || ocfs2_is_soft_readonly(osb)) 182 + if (unlikely(ocfs2_emergency_state(osb))) 183 183 return -EROFS; 184 184 185 185 err = file_write_and_wait_range(file, start, end); ··· 209 209 struct timespec64 now; 210 210 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); 211 211 212 - if (ocfs2_is_hard_readonly(osb) || ocfs2_is_soft_readonly(osb)) 212 + if (unlikely(ocfs2_emergency_state(osb))) 213 213 return 0; 214 214 215 215 if ((inode->i_flags & S_NOATIME) || ··· 1136 1136 attr->ia_valid & ATTR_GID ? 1137 1137 from_kgid(&init_user_ns, attr->ia_gid) : 0); 1138 1138 1139 + status = ocfs2_emergency_state(osb); 1140 + if (unlikely(status)) { 1141 + mlog_errno(status); 1142 + goto bail; 1143 + } 1144 + 1139 1145 /* ensuring we don't even attempt to truncate a symlink */ 1140 1146 if (S_ISLNK(inode->i_mode)) 1141 1147 attr->ia_valid &= ~ATTR_SIZE; ··· 1949 1943 handle_t *handle; 1950 1944 unsigned long long max_off = inode->i_sb->s_maxbytes; 1951 1945 1952 - if (ocfs2_is_hard_readonly(osb) || ocfs2_is_soft_readonly(osb)) 1946 + if (unlikely(ocfs2_emergency_state(osb))) 1953 1947 return -EROFS; 1954 1948 1955 1949 inode_lock(inode); ··· 2713 2707 return -EINVAL; 2714 2708 if (!ocfs2_refcount_tree(osb)) 2715 2709 return -EOPNOTSUPP; 2716 - if (ocfs2_is_hard_readonly(osb) || ocfs2_is_soft_readonly(osb)) 2710 + if (unlikely(ocfs2_emergency_state(osb))) 2717 2711 return -EROFS; 2718 2712 2719 2713 /* Lock both files against IO */
+9 -2
fs/ocfs2/inode.c
··· 1442 1442 goto bail; 1443 1443 } 1444 1444 1445 + if ((!di->i_links_count && !di->i_links_count_hi) || !di->i_mode) { 1446 + mlog(ML_ERROR, "Invalid dinode #%llu: " 1447 + "Corrupt state (nlink = %u or mode = %u) detected!\n", 1448 + (unsigned long long)bh->b_blocknr, 1449 + ocfs2_read_links_count(di), le16_to_cpu(di->i_mode)); 1450 + rc = -EFSCORRUPTED; 1451 + goto bail; 1452 + } 1445 1453 /* 1446 1454 * Errors after here are fatal. 1447 1455 */ ··· 1612 1604 trace_ocfs2_filecheck_repair_inode_block( 1613 1605 (unsigned long long)bh->b_blocknr); 1614 1606 1615 - if (ocfs2_is_hard_readonly(OCFS2_SB(sb)) || 1616 - ocfs2_is_soft_readonly(OCFS2_SB(sb))) { 1607 + if (unlikely(ocfs2_emergency_state(OCFS2_SB(sb)))) { 1617 1608 mlog(ML_ERROR, 1618 1609 "Filecheck: cannot repair dinode #%llu " 1619 1610 "on readonly filesystem\n",
+1 -1
fs/ocfs2/move_extents.c
··· 909 909 struct buffer_head *di_bh = NULL; 910 910 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); 911 911 912 - if (ocfs2_is_hard_readonly(osb) || ocfs2_is_soft_readonly(osb)) 912 + if (unlikely(ocfs2_emergency_state(osb))) 913 913 return -EROFS; 914 914 915 915 inode_lock(inode);
+2 -1
fs/ocfs2/namei.c
··· 23 23 #include <linux/fs.h> 24 24 #include <linux/types.h> 25 25 #include <linux/slab.h> 26 + #include <linux/string.h> 26 27 #include <linux/highmem.h> 27 28 #include <linux/quotaops.h> 28 29 #include <linux/iversion.h> ··· 569 568 ocfs2_set_links_count(fe, inode->i_nlink); 570 569 571 570 fe->i_last_eb_blk = 0; 572 - strcpy(fe->i_signature, OCFS2_INODE_SIGNATURE); 571 + strscpy(fe->i_signature, OCFS2_INODE_SIGNATURE); 573 572 fe->i_flags |= cpu_to_le32(OCFS2_VALID_FL); 574 573 ktime_get_coarse_real_ts64(&ts); 575 574 fe->i_atime = fe->i_ctime = fe->i_mtime =
+18
fs/ocfs2/ocfs2.h
··· 680 680 return ret; 681 681 } 682 682 683 + static inline int ocfs2_is_readonly(struct ocfs2_super *osb) 684 + { 685 + int ret; 686 + spin_lock(&osb->osb_lock); 687 + ret = osb->osb_flags & (OCFS2_OSB_SOFT_RO | OCFS2_OSB_HARD_RO); 688 + spin_unlock(&osb->osb_lock); 689 + 690 + return ret; 691 + } 692 + 693 + static inline int ocfs2_emergency_state(struct ocfs2_super *osb) 694 + { 695 + if (ocfs2_is_readonly(osb)) 696 + return -EROFS; 697 + 698 + return 0; 699 + } 700 + 683 701 static inline int ocfs2_clusterinfo_valid(struct ocfs2_super *osb) 684 702 { 685 703 return (osb->s_feature_incompat &
+2 -2
fs/ocfs2/resize.c
··· 276 276 u32 first_new_cluster; 277 277 u64 lgd_blkno; 278 278 279 - if (ocfs2_is_hard_readonly(osb) || ocfs2_is_soft_readonly(osb)) 279 + if (unlikely(ocfs2_emergency_state(osb))) 280 280 return -EROFS; 281 281 282 282 if (new_clusters < 0) ··· 466 466 u16 cl_bpc; 467 467 u64 bg_ptr; 468 468 469 - if (ocfs2_is_hard_readonly(osb) || ocfs2_is_soft_readonly(osb)) 469 + if (unlikely(ocfs2_emergency_state(osb))) 470 470 return -EROFS; 471 471 472 472 main_bm_inode = ocfs2_get_system_file_inode(osb,
+2 -1
fs/ocfs2/stackglue.c
··· 10 10 11 11 #include <linux/list.h> 12 12 #include <linux/spinlock.h> 13 + #include <linux/string.h> 13 14 #include <linux/module.h> 14 15 #include <linux/slab.h> 15 16 #include <linux/kmod.h> ··· 671 670 { 672 671 int ret; 673 672 674 - strcpy(cluster_stack_name, OCFS2_STACK_PLUGIN_O2CB); 673 + strscpy(cluster_stack_name, OCFS2_STACK_PLUGIN_O2CB); 675 674 676 675 ocfs2_table_header = register_sysctl("fs/ocfs2/nm", ocfs2_nm_table); 677 676 if (!ocfs2_table_header) {
+12 -1
fs/ocfs2/suballoc.c
··· 11 11 #include <linux/fs.h> 12 12 #include <linux/types.h> 13 13 #include <linux/slab.h> 14 + #include <linux/string.h> 14 15 #include <linux/highmem.h> 15 16 16 17 #include <cluster/masklog.h> ··· 373 372 } 374 373 375 374 memset(bg, 0, sb->s_blocksize); 376 - strcpy(bg->bg_signature, OCFS2_GROUP_DESC_SIGNATURE); 375 + strscpy(bg->bg_signature, OCFS2_GROUP_DESC_SIGNATURE); 377 376 bg->bg_generation = cpu_to_le32(osb->fs_generation); 378 377 bg->bg_size = cpu_to_le16(ocfs2_group_bitmap_size(sb, 1, 379 378 osb->s_feature_incompat)); ··· 1993 1992 } 1994 1993 1995 1994 cl = (struct ocfs2_chain_list *) &fe->id2.i_chain; 1995 + if (!le16_to_cpu(cl->cl_next_free_rec) || 1996 + le16_to_cpu(cl->cl_next_free_rec) > le16_to_cpu(cl->cl_count)) { 1997 + status = ocfs2_error(ac->ac_inode->i_sb, 1998 + "Chain allocator dinode %llu has invalid next " 1999 + "free chain record %u, but only %u total\n", 2000 + (unsigned long long)le64_to_cpu(fe->i_blkno), 2001 + le16_to_cpu(cl->cl_next_free_rec), 2002 + le16_to_cpu(cl->cl_count)); 2003 + goto bail; 2004 + } 1996 2005 1997 2006 victim = ocfs2_find_victim_chain(cl); 1998 2007 ac->ac_chain = victim;
+1 -1
fs/ocfs2/super.c
··· 2487 2487 rv = -EIO; 2488 2488 } else { /* default option */ 2489 2489 rv = -EROFS; 2490 - if (sb_rdonly(sb) && (ocfs2_is_soft_readonly(osb) || ocfs2_is_hard_readonly(osb))) 2490 + if (sb_rdonly(sb) && ocfs2_emergency_state(osb)) 2491 2491 return rv; 2492 2492 2493 2493 pr_crit("OCFS2: File system is now read-only.\n");
+34 -4
fs/ocfs2/xattr.c
··· 49 49 #include "ocfs2_trace.h" 50 50 51 51 struct ocfs2_xattr_def_value_root { 52 - struct ocfs2_xattr_value_root xv; 53 - struct ocfs2_extent_rec er; 52 + /* Must be last as it ends in a flexible-array member. */ 53 + TRAILING_OVERLAP(struct ocfs2_xattr_value_root, xv, xr_list.l_recs, 54 + struct ocfs2_extent_rec er; 55 + ); 54 56 }; 57 + static_assert(offsetof(struct ocfs2_xattr_def_value_root, xv.xr_list.l_recs) == 58 + offsetof(struct ocfs2_xattr_def_value_root, er)); 55 59 56 60 struct ocfs2_xattr_bucket { 57 61 /* The inode these xattrs are associated with */ ··· 975 971 struct ocfs2_xattr_header *header = NULL; 976 972 struct ocfs2_inode_info *oi = OCFS2_I(inode); 977 973 int ret = 0; 974 + u16 xattr_count; 975 + size_t max_entries; 976 + u16 inline_size; 978 977 979 978 if (!(oi->ip_dyn_features & OCFS2_INLINE_XATTR_FL)) 980 979 return ret; 981 980 981 + inline_size = le16_to_cpu(di->i_xattr_inline_size); 982 + 983 + /* Validate inline size is reasonable */ 984 + if (inline_size > inode->i_sb->s_blocksize || 985 + inline_size < sizeof(struct ocfs2_xattr_header)) { 986 + ocfs2_error(inode->i_sb, 987 + "Invalid xattr inline size %u in inode %llu\n", 988 + inline_size, 989 + (unsigned long long)OCFS2_I(inode)->ip_blkno); 990 + return -EFSCORRUPTED; 991 + } 992 + 982 993 header = (struct ocfs2_xattr_header *) 983 - ((void *)di + inode->i_sb->s_blocksize - 984 - le16_to_cpu(di->i_xattr_inline_size)); 994 + ((void *)di + inode->i_sb->s_blocksize - inline_size); 995 + 996 + xattr_count = le16_to_cpu(header->xh_count); 997 + max_entries = (inline_size - sizeof(struct ocfs2_xattr_header)) / 998 + sizeof(struct ocfs2_xattr_entry); 999 + 1000 + if (xattr_count > max_entries) { 1001 + ocfs2_error(inode->i_sb, 1002 + "xattr entry count %u exceeds maximum %zu in inode %llu\n", 1003 + xattr_count, max_entries, 1004 + (unsigned long long)OCFS2_I(inode)->ip_blkno); 1005 + return -EFSCORRUPTED; 1006 + } 985 1007 986 1008 ret = ocfs2_xattr_list_entries(inode, header, buffer, buffer_size); 987 1009
+2 -2
include/linux/args.h
··· 6 6 /* 7 7 * How do these macros work? 8 8 * 9 - * In __COUNT_ARGS() _0 to _12 are just placeholders from the start 9 + * In __COUNT_ARGS() _0 to _15 are just placeholders from the start 10 10 * in order to make sure _n is positioned over the correct number 11 - * from 12 to 0 (depending on X, which is a variadic argument list). 11 + * from 15 to 0 (depending on X, which is a variadic argument list). 12 12 * They serve no purpose other than occupying a position. Since each 13 13 * macro parameter must have a distinct identifier, those identifiers 14 14 * are as good as any.
+1
kernel/liveupdate/Kconfig
··· 54 54 config LIVEUPDATE 55 55 bool "Live Update Orchestrator" 56 56 depends on KEXEC_HANDOVER 57 + depends on SHMEM 57 58 help 58 59 Enable the Live Update Orchestrator. Live Update is a mechanism, 59 60 typically based on kexec, that allows the kernel to be updated
+1 -3
kernel/liveupdate/luo_core.c
··· 399 399 int err; 400 400 401 401 nr = _IOC_NR(cmd); 402 - if (nr < LIVEUPDATE_CMD_BASE || 403 - (nr - LIVEUPDATE_CMD_BASE) >= ARRAY_SIZE(luo_ioctl_ops)) { 402 + if (nr - LIVEUPDATE_CMD_BASE >= ARRAY_SIZE(luo_ioctl_ops)) 404 403 return -EINVAL; 405 - } 406 404 407 405 ucmd.ubuffer = (void __user *)arg; 408 406 err = get_user(ucmd.user_size, (u32 __user *)ucmd.ubuffer);
+5 -2
kernel/liveupdate/luo_file.c
··· 554 554 { 555 555 struct liveupdate_file_op_args args = {0}; 556 556 struct luo_file *luo_file; 557 + bool found = false; 557 558 int err; 558 559 559 560 if (list_empty(&file_set->files_list)) 560 561 return -ENOENT; 561 562 562 563 list_for_each_entry(luo_file, &file_set->files_list, list) { 563 - if (luo_file->token == token) 564 + if (luo_file->token == token) { 565 + found = true; 564 566 break; 567 + } 565 568 } 566 569 567 - if (luo_file->token != token) 570 + if (!found) 568 571 return -ENOENT; 569 572 570 573 guard(mutex)(&luo_file->mutex);
+9 -2
mm/shmem.c
··· 5794 5794 #define shmem_vm_ops generic_file_vm_ops 5795 5795 #define shmem_anon_vm_ops generic_file_vm_ops 5796 5796 #define shmem_file_operations ramfs_file_operations 5797 - #define shmem_acct_size(flags, size) 0 5798 - #define shmem_unacct_size(flags, size) do {} while (0) 5797 + 5798 + static inline int shmem_acct_size(unsigned long flags, loff_t size) 5799 + { 5800 + return 0; 5801 + } 5802 + 5803 + static inline void shmem_unacct_size(unsigned long flags, loff_t size) 5804 + { 5805 + } 5799 5806 5800 5807 static inline struct inode *shmem_get_inode(struct mnt_idmap *idmap, 5801 5808 struct super_block *sb, struct inode *dir,
+6
scripts/checkpatch.pl
··· 7732 7732 ERROR("MISSING_SENTINEL", "missing sentinel in ID array\n" . "$here\n$stat\n"); 7733 7733 } 7734 7734 } 7735 + 7736 + # check for uninitialized pointers with __free attribute 7737 + while ($line =~ /\*\s*($Ident)\s+__free\s*\(\s*$Ident\s*\)\s*[,;]/g) { 7738 + ERROR("UNINITIALIZED_PTR_WITH_FREE", 7739 + "pointer '$1' with __free attribute should be initialized\n" . $herecurr); 7740 + } 7735 7741 } 7736 7742 7737 7743 # If we have no input at all, then there is nothing to report on