All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] ocfs2: fix sparse file & data ordering issue in direct io
Date: Wed, 16 Nov 2016 13:45:39 +0300	[thread overview]
Message-ID: <20161116104539.GO28558@mwanda> (raw)
In-Reply-To: <777b2218-d12e-ea96-7e1c-6852c14b71ec@suse.com>

On Wed, Nov 16, 2016 at 10:33:49AM +0800, Eric Ren wrote:
> >>>fs/ocfs2/aops.c
> >>>   2235
> >>>   2236          ret = ocfs2_write_begin_nolock(inode->i_mapping, pos, len,
> >>>   2237                                         OCFS2_WRITE_DIRECT, NULL,
> >>>   2238                                         (void **)&wc, di_bh, NULL);
> >>>                                                ^^^^^^^^^^^^
> How do you perform the static checker? Please tech me;-)
> 

It's Smatch things that's not public yet.  Soon.

> Regarding this warning, please try to make this line
> (https://github.com/torvalds/linux/blob/master/fs/ocfs2/aops.c#L2128)
> into:
> 
> struct ocfs2_write_ctxt *wc = NULL;
> 
> It should work, and haven't any side effect.

That silences the warning, of course, but I feel like the code is buggy.
How do we know that we don't hit that exit path?

fs/ocfs2/aops.c
  1808          /*
  1809           * ocfs2_grab_pages_for_write() returns -EAGAIN if it could not lock
  1810           * the target page. In this case, we exit with no error and no target
  1811           * page. This will trigger the caller, page_mkwrite(), to re-try
  1812           * the operation.
  1813           */
  1814          if (ret == -EAGAIN) {
  1815                  BUG_ON(wc->w_target_page);
  1816                  ret = 0;
  1817                  goto out_quota;
  1818          }

regards,
dan carpenter

  reply	other threads:[~2016-11-16 10:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-09 10:25 [Ocfs2-devel] ocfs2: fix sparse file & data ordering issue in direct io Dan Carpenter
2016-11-15 10:33 ` Dan Carpenter
2016-11-15 10:36   ` Dan Carpenter
2016-11-16  2:33     ` Eric Ren
2016-11-16 10:45       ` Dan Carpenter [this message]
2016-11-17  3:08         ` Eric Ren
2016-11-17 10:03           ` Dan Carpenter
2016-11-22  2:29             ` Junxiao Bi
2016-11-24 14:21               ` Dan Carpenter
2016-11-17 11:58 ` piaojun
2016-11-19  3:49   ` piaojun

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=20161116104539.GO28558@mwanda \
    --to=dan.carpenter@oracle.com \
    --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.