Skip to content

Commit e610e85

Browse files
Darrick J. WongChandan Babu R
authored andcommitted
xfs: fix scrub stats file permissions
When the kernel is in lockdown mode, debugfs will only show files that are world-readable and cannot be written, mmaped, or used with ioctl. That more or less describes the scrub stats file, except that the permissions are wrong -- they should be 0444, not 0644. You can't write the stats file, so the 0200 makes no sense. Meanwhile, the clear_stats file is only writable, but it got mode 0400 instead of 0200, which would make more sense. Fix both files so that they make sense. Fixes: d7a74ca ("xfs: track usage statistics of online fsck") Signed-off-by: "Darrick J. Wong" <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
1 parent 1e5efd7 commit e610e85

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/xfs/scrub/stats.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,9 @@ xchk_stats_register(
331331
if (!cs->cs_debugfs)
332332
return;
333333

334-
debugfs_create_file("stats", 0644, cs->cs_debugfs, cs,
334+
debugfs_create_file("stats", 0444, cs->cs_debugfs, cs,
335335
&scrub_stats_fops);
336-
debugfs_create_file("clear_stats", 0400, cs->cs_debugfs, cs,
336+
debugfs_create_file("clear_stats", 0200, cs->cs_debugfs, cs,
337337
&clear_scrub_stats_fops);
338338
}
339339

0 commit comments

Comments
 (0)