Skip to content

Commit f6a2631

Browse files
committed
ocfs2: fix subdirectory registration with register_sysctl()
The kernel test robot reports that commit c42ff46 ("ocfs2: simplify subdirectory registration with register_sysctl()") is broken, and results in kernel warning messages like sysctl table check failed: fs/ocfs2/nm Not a file sysctl table check failed: fs/ocfs2/nm No proc_handler sysctl table check failed: fs/ocfs2/nm bogus .mode 0555 and in fact this was already reported back in linux-next, but nobody seems to have reacted to that report. Possibly that original report only ever made it to the lkp list. The problem seems to be that the simplification didn't actually go far enough, and should have converted the whole directory path to the final sysctl file, rather than just the two first components. So take that last step. Fixes: c42ff46 ("ocfs2: simplify subdirectory registration with register_sysctl()") Reported-by: kernel test robot <[email protected]> Link: https://lore.kernel.org/all/20220128065310.GF8421@xsang-OptiPlex-9020/ Link: https://lists.01.org/hyperkitty/list/[email protected]/thread/KQ2F6TPJWMDVEXJM4WTUC4DU3EH3YJVT/ Tested-by: Jan Kara <[email protected]> Reviewed-by: Jan Kara <[email protected]> Cc: Luis Chamberlain <[email protected]> Cc: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 4897e72 commit f6a2631

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

fs/ocfs2/stackglue.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -661,17 +661,6 @@ static struct ctl_table ocfs2_nm_table[] = {
661661
{ }
662662
};
663663

664-
static struct ctl_table ocfs2_mod_table[] = {
665-
{
666-
.procname = "nm",
667-
.data = NULL,
668-
.maxlen = 0,
669-
.mode = 0555,
670-
.child = ocfs2_nm_table
671-
},
672-
{ }
673-
};
674-
675664
static struct ctl_table_header *ocfs2_table_header;
676665

677666
/*
@@ -682,7 +671,7 @@ static int __init ocfs2_stack_glue_init(void)
682671
{
683672
strcpy(cluster_stack_name, OCFS2_STACK_PLUGIN_O2CB);
684673

685-
ocfs2_table_header = register_sysctl("fs/ocfs2", ocfs2_mod_table);
674+
ocfs2_table_header = register_sysctl("fs/ocfs2/nm", ocfs2_nm_table);
686675
if (!ocfs2_table_header) {
687676
printk(KERN_ERR
688677
"ocfs2 stack glue: unable to register sysctl\n");

0 commit comments

Comments
 (0)