Re: [PATCH] ext4: fix #11321: create /proc/ext4/*/stats et al more carefully

Alexey Dobriyan
2008-09-09T07:18:08Z

On Mon, Sep 08, 2008 at 10:39:51AM -0400, Theodore Tso wrote:
> --- a/fs/ext4/mballoc.c
> +++ b/fs/ext4/mballoc.c
> @@ -2785,14 +2785,19 @@ static int ext4_mb_init_per_dev_proc(struct super_block *sb)
> mode_t mode = S_IFREG | S_IRUGO | S_IWUSR;
> struct ext4_sb_info *sbi = EXT4_SB(sb);
> struct proc_dir_entry *proc;
> - char devname[64];
> + char devname[64], *p;
>
> if (proc_root_ext4 == NULL) {
> sbi->s_mb_proc = NULL;
> return -EINVAL;
> }
> bdevname(sb->s_bdev, devname);
> + while (p = strchr(p, '/'))
> + *p = '!';

This can't work because "p" is uninitialized. And gcc whines about one
more pair of ().