diff options
Diffstat (limited to 'fs/proc_namespace.c')
-rw-r--r-- | fs/proc_namespace.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/fs/proc_namespace.c b/fs/proc_namespace.c index 8ebd9a334085..2256e7e23e67 100644 --- a/fs/proc_namespace.c +++ b/fs/proc_namespace.c | |||
@@ -95,9 +95,9 @@ static int show_vfsmnt(struct seq_file *m, struct vfsmount *mnt) | |||
95 | { | 95 | { |
96 | struct proc_mounts *p = m->private; | 96 | struct proc_mounts *p = m->private; |
97 | struct mount *r = real_mount(mnt); | 97 | struct mount *r = real_mount(mnt); |
98 | int err = 0; | ||
99 | struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt }; | 98 | struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt }; |
100 | struct super_block *sb = mnt_path.dentry->d_sb; | 99 | struct super_block *sb = mnt_path.dentry->d_sb; |
100 | int err; | ||
101 | 101 | ||
102 | if (sb->s_op->show_devname) { | 102 | if (sb->s_op->show_devname) { |
103 | err = sb->s_op->show_devname(m, mnt_path.dentry); | 103 | err = sb->s_op->show_devname(m, mnt_path.dentry); |
@@ -131,16 +131,17 @@ static int show_mountinfo(struct seq_file *m, struct vfsmount *mnt) | |||
131 | struct mount *r = real_mount(mnt); | 131 | struct mount *r = real_mount(mnt); |
132 | struct super_block *sb = mnt->mnt_sb; | 132 | struct super_block *sb = mnt->mnt_sb; |
133 | struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt }; | 133 | struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt }; |
134 | int err = 0; | 134 | int err; |
135 | 135 | ||
136 | seq_printf(m, "%i %i %u:%u ", r->mnt_id, r->mnt_parent->mnt_id, | 136 | seq_printf(m, "%i %i %u:%u ", r->mnt_id, r->mnt_parent->mnt_id, |
137 | MAJOR(sb->s_dev), MINOR(sb->s_dev)); | 137 | MAJOR(sb->s_dev), MINOR(sb->s_dev)); |
138 | if (sb->s_op->show_path) | 138 | if (sb->s_op->show_path) { |
139 | err = sb->s_op->show_path(m, mnt->mnt_root); | 139 | err = sb->s_op->show_path(m, mnt->mnt_root); |
140 | else | 140 | if (err) |
141 | goto out; | ||
142 | } else { | ||
141 | seq_dentry(m, mnt->mnt_root, " \t\n\\"); | 143 | seq_dentry(m, mnt->mnt_root, " \t\n\\"); |
142 | if (err) | 144 | } |
143 | goto out; | ||
144 | seq_putc(m, ' '); | 145 | seq_putc(m, ' '); |
145 | 146 | ||
146 | /* mountpoints outside of chroot jail will give SEQ_SKIP on this */ | 147 | /* mountpoints outside of chroot jail will give SEQ_SKIP on this */ |
@@ -168,12 +169,13 @@ static int show_mountinfo(struct seq_file *m, struct vfsmount *mnt) | |||
168 | seq_puts(m, " - "); | 169 | seq_puts(m, " - "); |
169 | show_type(m, sb); | 170 | show_type(m, sb); |
170 | seq_putc(m, ' '); | 171 | seq_putc(m, ' '); |
171 | if (sb->s_op->show_devname) | 172 | if (sb->s_op->show_devname) { |
172 | err = sb->s_op->show_devname(m, mnt->mnt_root); | 173 | err = sb->s_op->show_devname(m, mnt->mnt_root); |
173 | else | 174 | if (err) |
175 | goto out; | ||
176 | } else { | ||
174 | mangle(m, r->mnt_devname ? r->mnt_devname : "none"); | 177 | mangle(m, r->mnt_devname ? r->mnt_devname : "none"); |
175 | if (err) | 178 | } |
176 | goto out; | ||
177 | seq_puts(m, sb->s_flags & MS_RDONLY ? " ro" : " rw"); | 179 | seq_puts(m, sb->s_flags & MS_RDONLY ? " ro" : " rw"); |
178 | err = show_sb_opts(m, sb); | 180 | err = show_sb_opts(m, sb); |
179 | if (err) | 181 | if (err) |
@@ -191,7 +193,7 @@ static int show_vfsstat(struct seq_file *m, struct vfsmount *mnt) | |||
191 | struct mount *r = real_mount(mnt); | 193 | struct mount *r = real_mount(mnt); |
192 | struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt }; | 194 | struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt }; |
193 | struct super_block *sb = mnt_path.dentry->d_sb; | 195 | struct super_block *sb = mnt_path.dentry->d_sb; |
194 | int err = 0; | 196 | int err; |
195 | 197 | ||
196 | /* device */ | 198 | /* device */ |
197 | if (sb->s_op->show_devname) { | 199 | if (sb->s_op->show_devname) { |
@@ -220,8 +222,7 @@ static int show_vfsstat(struct seq_file *m, struct vfsmount *mnt) | |||
220 | /* optional statistics */ | 222 | /* optional statistics */ |
221 | if (sb->s_op->show_stats) { | 223 | if (sb->s_op->show_stats) { |
222 | seq_putc(m, ' '); | 224 | seq_putc(m, ' '); |
223 | if (!err) | 225 | err = sb->s_op->show_stats(m, mnt_path.dentry); |
224 | err = sb->s_op->show_stats(m, mnt_path.dentry); | ||
225 | } | 226 | } |
226 | 227 | ||
227 | seq_putc(m, '\n'); | 228 | seq_putc(m, '\n'); |