All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Goodwin <markgw@sgi.com>
To: lachlan@sgi.com
Cc: xfs-oss <xfs@oss.sgi.com>, xfs-dev <xfs-dev@sgi.com>
Subject: Re: [PATCH V2] Re-dirty pages on ENOSPC when converting delayed allocations
Date: Wed, 12 Nov 2008 17:48:15 +1100	[thread overview]
Message-ID: <491A7C2F.8020702@sgi.com> (raw)
In-Reply-To: <48EB1ABD.3020503@sgi.com>

Could we please reach consensus on this patch? - it's been more
than a month .. and we have customers hitting it. If nobody has any
objections, we're going to take it and push it for 2.6.28.

Thanks
-- Mark

Lachlan McIlroy wrote:
> If we get an error in xfs_page_state_convert() - and it's not EAGAIN - then
> we throw away the dirty page without converting the delayed allocation.  
> This
> leaves delayed allocations that can never be removed and confuses code that
> expects a flush of the file to clear them.  We need to re-dirty the page on
> error so we can try again later or report that the flush failed.
> 
> This change is needed to handle the condition where we are at ENOSPC and we
> exhaust the reserved block pool (because many transactions are executing
> concurrently) and calls to xfs_trans_reserve() start failing with ENOSPC
> errors.
> 
> Version 2 wont return EAGAIN from xfs_vm_writepage() and also converts an
> ENOSPC error to an EAGAIN for asynchronous writeback to avoid setting an
> error in the inode mapping when we don't need to.
> 
> --- a/fs/xfs/linux-2.6/xfs_aops.c    2008-10-07 17:02:04.000000000 +1000
> +++ b/fs/xfs/linux-2.6/xfs_aops.c    2008-10-07 17:58:04.000000000 +1000
> @@ -1147,16 +1147,6 @@ error:
>     if (iohead)
>         xfs_cancel_ioend(iohead);
> 
> -    /*
> -     * 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)
> -            block_invalidatepage(page, 0);
> -        ClearPageUptodate(page);
> -    }
>     return err;
> }
> 
> @@ -1185,7 +1175,7 @@ xfs_vm_writepage(
>     struct page        *page,
>     struct writeback_control *wbc)
> {
> -    int            error;
> +    int            error = 0;
>     int            need_trans;
>     int            delalloc, unmapped, unwritten;
>     struct inode        *inode = page->mapping->host;
> @@ -1231,19 +1221,16 @@ xfs_vm_writepage(
>      * to real space and flush out to disk.
>      */
>     error = xfs_page_state_convert(inode, page, wbc, 1, unmapped);
> -    if (error == -EAGAIN)
> -        goto out_fail;
>     if (unlikely(error < 0))
> -        goto out_unlock;
> +        goto out_fail;
> 
>     return 0;
> 
> out_fail:
>     redirty_page_for_writepage(wbc, page);
>     unlock_page(page);
> -    return 0;
> -out_unlock:
> -    unlock_page(page);
> +    if (error == -EAGAIN)
> +        error = 0;
>     return error;
> }
> 
> --- a/fs/xfs/xfs_iomap.c    2008-10-07 17:02:04.000000000 +1000
> +++ b/fs/xfs/xfs_iomap.c    2008-10-07 17:58:04.000000000 +1000
> @@ -269,6 +269,8 @@ xfs_iomap(
> 
>         error = xfs_iomap_write_allocate(ip, offset, count,
>                          &imap, &nimaps);
> +        if ((flags & BMAPI_TRYLOCK) && error == ENOSPC)
> +            error = EAGAIN;
>         break;
>     }
> 
> 
> 

-- 

  Mark Goodwin                                  markgw@sgi.com
  Engineering Manager for XFS and PCP    Phone: +61-3-99631937
  SGI Australian Software Group           Cell: +61-4-18969583
-------------------------------------------------------------

      parent reply	other threads:[~2008-11-12  6:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-07  8:15 [PATCH V2] Re-dirty pages on ENOSPC when converting delayed allocations Lachlan McIlroy
2008-10-09 12:27 ` Dave Chinner
2008-10-09 22:48   ` Dave Chinner
2008-10-10  7:45   ` Lachlan McIlroy
2008-11-12  6:48 ` Mark Goodwin [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=491A7C2F.8020702@sgi.com \
    --to=markgw@sgi.com \
    --cc=lachlan@sgi.com \
    --cc=xfs-dev@sgi.com \
    --cc=xfs@oss.sgi.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.