All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Mike Gao <ygao.linux@gmail.com>
Cc: hch@lst.de, xfs@oss.sgi.com
Subject: Re: page discard on page error
Date: Thu, 19 Aug 2010 01:50:43 +1000	[thread overview]
Message-ID: <20100818155043.GL7362@dastard> (raw)
In-Reply-To: <AANLkTimHBE_9pD1wWOkryOnqBgL2bJQTKoe52wYjfNw3@mail.gmail.com>

On Wed, Aug 18, 2010 at 09:27:55AM -0500, Mike Gao wrote:
> Hi, all,
> 
> I sync latest XFS last month and build into our embedded system. When I
> test, I found below issue.
> It seems that the xfs_iomap failed when it did allocat with
> xfs_ilock_nowait().
> I debug this and found that ip->i_lock is locked and there are sometime no
> unlock coming between two lock trying.
> This issue will give wrong data in file on disk exactly on that offset.

Ah, it looks like we dropped the EAGAIN error from xfs_map_blocks()
on the floor.

Christoph, the 2.6.34 code did this:

error:
......
        /*
         * If it's delalloc and we have nowhere to put it,
         * throw it away, unless the lower layers told
         * us to try again.
         */
        if (err != -EAGAIN) {
                if (!unmapped)
                        xfs_aops_discard_page(page);
                ClearPageUptodate(page);
        }

and the caller redirtied the page on EAGAIN. The EAGAIN comes from
the BMAPI_TRYLOCK case, so it is a valid return indicating that we
would have blocked on a non-blocking IO.

The current code does not handle EAGAIN at all, just discards the
page. This looks incorrect - I think that EAGAIN should still cause
the page to be redirtied, not discarded. I'm not sure if I missed
something else, though - can you remember why you removed the EAGAIN
case?

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2010-08-18 15:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-18 14:27 page discard on page error Mike Gao
2010-08-18 15:50 ` Dave Chinner [this message]
2010-08-18 16:17   ` Christoph Hellwig
     [not found]     ` <AANLkTimsDB=Za=fF3Rk-oMFf7=pKSGR7Pg6uSKSC-4Q1@mail.gmail.com>
2010-08-19  9:42       ` Christoph Hellwig

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=20100818155043.GL7362@dastard \
    --to=david@fromorbit.com \
    --cc=hch@lst.de \
    --cc=xfs@oss.sgi.com \
    --cc=ygao.linux@gmail.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.