linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Hugh Dickins <hughd@google.com>
Cc: Axel Rasmussen <axelrasmussen@google.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Lokesh Gidra <lokeshgidra@google.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] userfaultfd: release page in error path to avoid BUG_ON
Date: Wed, 28 Apr 2021 17:24:30 -0400	[thread overview]
Message-ID: <20210428212430.GA6462@xz-x1> (raw)
In-Reply-To: <alpine.LSU.2.11.2104281338380.9009@eggly.anvils>

On Wed, Apr 28, 2021 at 02:03:05PM -0700, Hugh Dickins wrote:

[...]

> > > +			put_page(*pagep);
> > > +			*pagep = NULL;
> > > +		}
> > >  		goto out;
> > 
> > All "goto out" in this functions looks weird as it returns directly... so if
> > you're touching this after all, I suggest we do "return -ENOMEM" directly and
> > drop the "ret = -ENOMEM".
> 
> No strong feeling either way from me on that: whichever looks best
> to you.  But I suspect the "ret = -ENOMEM" cannot be dropped,
> because it's relied on further down too?

Ah sorry I just noticed Axel didn't really touch that line.. :) So yeah please
also feel free to keep it as is.

If to drop it, "ret = -ENOMEM" can go as well, I think.. since all later errors
should always reset variable "ret".

Thanks,

-- 
Peter Xu



  reply	other threads:[~2021-04-28 21:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-28 18:01 [PATCH] userfaultfd: release page in error path to avoid BUG_ON Axel Rasmussen
2021-04-28 18:39 ` Peter Xu
2021-04-28 21:03   ` Hugh Dickins
2021-04-28 21:24     ` Peter Xu [this message]
2021-04-28 21:26       ` Axel Rasmussen
2021-04-28 23:08 ` [PATCH v2] " Axel Rasmussen
2021-04-28 23:56   ` Hugh Dickins
2021-04-29  0:08   ` Peter Xu
2021-05-05 22:13   ` Axel Rasmussen

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=20210428212430.GA6462@xz-x1 \
    --to=peterx@redhat.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=axelrasmussen@google.com \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lokeshgidra@google.com \
    /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).