aboutsummaryrefslogtreecommitdiffstats
path: root/fs/devpts/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/devpts/inode.c')
-rw-r--r--fs/devpts/inode.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c
index a726b9f29cb7..cfe8466f7fef 100644
--- a/fs/devpts/inode.c
+++ b/fs/devpts/inode.c
@@ -10,6 +10,8 @@
10 * 10 *
11 * ------------------------------------------------------------------------- */ 11 * ------------------------------------------------------------------------- */
12 12
13#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
14
13#include <linux/module.h> 15#include <linux/module.h>
14#include <linux/init.h> 16#include <linux/init.h>
15#include <linux/fs.h> 17#include <linux/fs.h>
@@ -148,10 +150,10 @@ static inline struct super_block *pts_sb_from_inode(struct inode *inode)
148 150
149/* 151/*
150 * parse_mount_options(): 152 * parse_mount_options():
151 * Set @opts to mount options specified in @data. If an option is not 153 * Set @opts to mount options specified in @data. If an option is not
152 * specified in @data, set it to its default value. The exception is 154 * specified in @data, set it to its default value. The exception is
153 * 'newinstance' option which can only be set/cleared on a mount (i.e. 155 * 'newinstance' option which can only be set/cleared on a mount (i.e.
154 * cannot be changed during remount). 156 * cannot be changed during remount).
155 * 157 *
156 * Note: @data may be NULL (in which case all options are set to default). 158 * Note: @data may be NULL (in which case all options are set to default).
157 */ 159 */
@@ -225,7 +227,7 @@ static int parse_mount_options(char *data, int op, struct pts_mount_opts *opts)
225 break; 227 break;
226#endif 228#endif
227 default: 229 default:
228 printk(KERN_ERR "devpts: called with bogus options\n"); 230 pr_err("called with bogus options\n");
229 return -EINVAL; 231 return -EINVAL;
230 } 232 }
231 } 233 }
@@ -261,7 +263,7 @@ static int mknod_ptmx(struct super_block *sb)
261 263
262 dentry = d_alloc_name(root, "ptmx"); 264 dentry = d_alloc_name(root, "ptmx");
263 if (!dentry) { 265 if (!dentry) {
264 printk(KERN_NOTICE "Unable to alloc dentry for ptmx node\n"); 266 pr_err("Unable to alloc dentry for ptmx node\n");
265 goto out; 267 goto out;
266 } 268 }
267 269
@@ -270,7 +272,7 @@ static int mknod_ptmx(struct super_block *sb)
270 */ 272 */
271 inode = new_inode(sb); 273 inode = new_inode(sb);
272 if (!inode) { 274 if (!inode) {
273 printk(KERN_ERR "Unable to alloc inode for ptmx node\n"); 275 pr_err("Unable to alloc inode for ptmx node\n");
274 dput(dentry); 276 dput(dentry);
275 goto out; 277 goto out;
276 } 278 }
@@ -303,7 +305,7 @@ static void update_ptmx_mode(struct pts_fs_info *fsi)
303#else 305#else
304static inline void update_ptmx_mode(struct pts_fs_info *fsi) 306static inline void update_ptmx_mode(struct pts_fs_info *fsi)
305{ 307{
306 return; 308 return;
307} 309}
308#endif 310#endif
309 311
@@ -313,6 +315,7 @@ static int devpts_remount(struct super_block *sb, int *flags, char *data)
313 struct pts_fs_info *fsi = DEVPTS_SB(sb); 315 struct pts_fs_info *fsi = DEVPTS_SB(sb);
314 struct pts_mount_opts *opts = &fsi->mount_opts; 316 struct pts_mount_opts *opts = &fsi->mount_opts;
315 317
318 sync_filesystem(sb);
316 err = parse_mount_options(data, PARSE_REMOUNT, opts); 319 err = parse_mount_options(data, PARSE_REMOUNT, opts);
317 320
318 /* 321 /*
@@ -332,9 +335,11 @@ static int devpts_show_options(struct seq_file *seq, struct dentry *root)
332 struct pts_mount_opts *opts = &fsi->mount_opts; 335 struct pts_mount_opts *opts = &fsi->mount_opts;
333 336
334 if (opts->setuid) 337 if (opts->setuid)
335 seq_printf(seq, ",uid=%u", from_kuid_munged(&init_user_ns, opts->uid)); 338 seq_printf(seq, ",uid=%u",
339 from_kuid_munged(&init_user_ns, opts->uid));
336 if (opts->setgid) 340 if (opts->setgid)
337 seq_printf(seq, ",gid=%u", from_kgid_munged(&init_user_ns, opts->gid)); 341 seq_printf(seq, ",gid=%u",
342 from_kgid_munged(&init_user_ns, opts->gid));
338 seq_printf(seq, ",mode=%03o", opts->mode); 343 seq_printf(seq, ",mode=%03o", opts->mode);
339#ifdef CONFIG_DEVPTS_MULTIPLE_INSTANCES 344#ifdef CONFIG_DEVPTS_MULTIPLE_INSTANCES
340 seq_printf(seq, ",ptmxmode=%03o", opts->ptmxmode); 345 seq_printf(seq, ",ptmxmode=%03o", opts->ptmxmode);
@@ -395,7 +400,7 @@ devpts_fill_super(struct super_block *s, void *data, int silent)
395 if (s->s_root) 400 if (s->s_root)
396 return 0; 401 return 0;
397 402
398 printk(KERN_ERR "devpts: get root dentry failed\n"); 403 pr_err("get root dentry failed\n");
399 404
400fail: 405fail:
401 return -ENOMEM; 406 return -ENOMEM;