From c59f415a7cb6e1e1e1cdbd6ee370b050e95f6b21 Mon Sep 17 00:00:00 2001 From: Alexey Gladkov Date: Thu, 23 Apr 2020 22:03:10 +0200 Subject: Use proc_pid_ns() to get pid_namespace from the proc superblock To get pid_namespace from the procfs superblock should be used a special helper. This will avoid errors when s_fs_info will change the type. Link: https://lore.kernel.org/lkml/20200423200316.164518-3-gladkov.alexey@gmail.com/ Link: https://lore.kernel.org/lkml/20200423112858.95820-1-gladkov.alexey@gmail.com/ Link: https://lore.kernel.org/lkml/06B50A1C-406F-4057-BFA8-3A7729EA7469@lca.pw/ Signed-off-by: Alexey Gladkov Signed-off-by: Eric W. Biederman --- fs/locks.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fs/locks.c') diff --git a/fs/locks.c b/fs/locks.c index b8a31c1c4fff..399c5dbb72c4 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -2823,7 +2823,7 @@ static void lock_get_status(struct seq_file *f, struct file_lock *fl, { struct inode *inode = NULL; unsigned int fl_pid; - struct pid_namespace *proc_pidns = file_inode(f->file)->i_sb->s_fs_info; + struct pid_namespace *proc_pidns = proc_pid_ns(file_inode(f->file)); fl_pid = locks_translate_pid(fl, proc_pidns); /* @@ -2901,7 +2901,7 @@ static int locks_show(struct seq_file *f, void *v) { struct locks_iterator *iter = f->private; struct file_lock *fl, *bfl; - struct pid_namespace *proc_pidns = file_inode(f->file)->i_sb->s_fs_info; + struct pid_namespace *proc_pidns = proc_pid_ns(file_inode(f->file)); fl = hlist_entry(v, struct file_lock, fl_link); -- cgit v1.2.3-59-g8ed1b