public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Ivan Delalande <colona@arista.com>
Cc: Luis Chamberlain <mcgrof@kernel.org>,
	Kees Cook <keescook@chromium.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v2] proc/sysctl: don't return ENOMEM on lookup when a table is unregistering
Date: Fri, 14 Dec 2018 01:45:40 +0000	[thread overview]
Message-ID: <20181214014539.GO2217@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20181213232052.GA1513@visor>

On Thu, Dec 13, 2018 at 03:20:52PM -0800, Ivan Delalande wrote:

> @@ -474,7 +474,7 @@ static struct inode *proc_sys_make_inode(struct super_block *sb,
>  	if (unlikely(head->unregistering)) {
>  		spin_unlock(&sysctl_lock);
>  		iput(inode);
> -		inode = NULL;
> +		inode = ERR_PTR(-ENOENT);
>  		goto out;
>  	}

Applied, with one modification: if you look at the target of that goto,
you'll see
out:
        return inode;
so this place should be simply
 		spin_unlock(&sysctl_lock);
 		iput(inode);
		return ERR_PTR(-ENOENT);
	}

That way the label becomes unused and goes away.

      reply	other threads:[~2018-12-14  1:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-13  1:57 [PATCH] proc/sysctl: don't return ENOMEM on lookup when a table is unregistering Ivan Delalande
2018-12-13  6:58 ` Al Viro
2018-12-13 23:20   ` [PATCH v2] " Ivan Delalande
2018-12-14  1:45     ` Al Viro [this message]

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=20181214014539.GO2217@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=colona@arista.com \
    --cc=ebiederm@xmission.com \
    --cc=keescook@chromium.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    /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