linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mateusz Guzik <mguzik@redhat.com>
To: "Dmitry V. Levin" <ldv@altlinux.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RESEND PATCH] vfs: show_vfsstat: do not ignore errors from show_devname method
Date: Wed, 18 Nov 2015 19:02:14 +0100	[thread overview]
Message-ID: <20151118180213.GA9688@mguzik> (raw)
In-Reply-To: <20151118174248.GA13411@altlinux.org>

On Wed, Nov 18, 2015 at 08:42:48PM +0300, Dmitry V. Levin wrote:
> Date: Thu, 19 Mar 2015 11:10:54 +0000
> 
> Explicitly check show_devname method return code and bail out in case
> of an error.  This fixes regression introduced by commit 9d4d65748a5c.
> 
> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
> ---
>  fs/proc_namespace.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/proc_namespace.c b/fs/proc_namespace.c
> index 8ebd9a3..876459559 100644
> --- a/fs/proc_namespace.c
> +++ b/fs/proc_namespace.c
> @@ -197,17 +197,19 @@ static int show_vfsstat(struct seq_file *m, struct vfsmount *mnt)
>  	if (sb->s_op->show_devname) {
>  		seq_puts(m, "device ");
>  		err = sb->s_op->show_devname(m, mnt_path.dentry);
> +		if (err)
> +			goto out;
>  	} else {
>  		if (r->mnt_devname) {
>  			seq_puts(m, "device ");
>  			mangle(m, r->mnt_devname);
>  		} else
>  			seq_puts(m, "no device");
>  	}
>  
>  	/* mount point */
>  	seq_puts(m, " mounted on ");
>  	/* mountpoints outside of chroot jail will give SEQ_SKIP on this */
>  	err = seq_path_root(m, &mnt_path, &p->root, " \t\n\\");
>  	if (err)
>  		goto out;
> 

I would suggest this should also remove now spurious initialization of
err to 0 and now always-true !err check prior to calling ->show_stats.

-- 
Mateusz Guzik

  reply	other threads:[~2015-11-18 18:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19 11:30 [PATCH] vfs: show_vfsstat: do not ignore errors from show_devname method Dmitry V. Levin
2015-11-18 17:42 ` [RESEND PATCH] " Dmitry V. Levin
2015-11-18 18:02   ` Mateusz Guzik [this message]
2015-11-18 21:57     ` [PATCH 1/3] vfs: show_vfsmnt: remove redundant initialization of error code Dmitry V. Levin
2016-01-11 15:36       ` [RESEND PATCH " Dmitry V. Levin
2015-11-18 21:58     ` [PATCH 2/3] vfs: show_mountinfo: cleanup error code checks Dmitry V. Levin
2016-01-11 15:37       ` [RESEND PATCH " Dmitry V. Levin
2015-11-18 21:58     ` [PATCH 3/3] vfs: show_vfsstat: remove redundant initialization and check of error code Dmitry V. Levin
2016-01-11 15:37       ` [RESEND PATCH " Dmitry V. Levin
2015-12-02 17:20     ` [RESEND v2 PATCH 1/4] vfs: show_vfsstat: do not ignore errors from show_devname method Dmitry V. Levin
2015-12-02 17:20     ` [RESEND PATCH 2/4] vfs: show_vfsmnt: remove redundant initialization of error code Dmitry V. Levin
2015-12-02 17:20     ` [RESEND PATCH 3/4] vfs: show_mountinfo: cleanup error code checks Dmitry V. Levin
2015-12-02 17:20     ` [RESEND PATCH 4/4] vfs: show_vfsstat: remove redundant initialization and check of error code Dmitry V. Levin
2016-01-11 15:36   ` [RESEND v2 PATCH] vfs: show_vfsstat: do not ignore errors from show_devname method Dmitry V. Levin
2016-02-19  1:56     ` [RESEND v3 " Dmitry V. Levin
2016-03-16 16:31       ` [RESEND v4 " Dmitry V. Levin
2016-03-16 16:49         ` Al Viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151118180213.GA9688@mguzik \
    --to=mguzik@redhat.com \
    --cc=ldv@altlinux.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).