All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joel Becker <jlbec@evilplan.org>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] ocfs2: fix ocfs2_page_mkwrite path
Date: Mon, 24 Jan 2011 15:28:31 -0800	[thread overview]
Message-ID: <20110124232830.GB24732@noexit> (raw)
In-Reply-To: <20110124231835.GJ9240@wotan.suse.de>

On Mon, Jan 24, 2011 at 03:18:35PM -0800, Mark Fasheh wrote:
> >  			if (mmap_page->mapping != mapping) {
> > +				WARN_ON(mmap_page->mapping);
> >  				unlock_page(mmap_page);
> > -				/*
> > -				 * Sanity check - the locking in
> > -				 * ocfs2_pagemkwrite() should ensure
> > -				 * that this code doesn't trigger.
> > -				 */
> > -				ret = -EINVAL;
> > -				mlog_errno(ret);
> > +				ret = 0;
> 
> We're returning zero here (success) when we haven't really met success. I
> see that in the next hunk, you test for this particular condition by looking
> at wc->w_target_page. There's no bug but this approach makes understanding
> the return code of ocfs2_grab_pages_for_write() harder.

	I told him to return 0.  I couldn't come up with a good signal.
We want the caller (__ocfs2_page_mkwrite()) to not error; this is a
valid case of retry.  The check for the locked_page is good for that.
	If we do come up with a logical !0 ret for
ocfs2_write_begin_nolock(), we have to make sure that the error paths do
all of their processing correctly but otherwise treat it as a good
state.  Obviously then __ocfs2_page_mkwrite() can trigger on that error
code (and BUG_ON(locked_page)).

Joel


-- 

"When choosing between two evils, I always like to try the one
 I've never tried before."
        - Mae West

			http://www.jlbec.org/
			jlbec at evilplan.org

  reply	other threads:[~2011-01-24 23:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-13 11:01 [Ocfs2-devel] [PATCH] ocfs2: fix ocfs2_page_mkwrite path Wengang Wang
2011-01-24 23:18 ` Mark Fasheh
2011-01-24 23:28   ` Joel Becker [this message]
2011-01-24 23:54     ` Mark Fasheh
2011-01-24 23:59       ` Joel Becker
2011-01-25  0:36         ` Mark Fasheh

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=20110124232830.GB24732@noexit \
    --to=jlbec@evilplan.org \
    --cc=ocfs2-devel@oss.oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.