public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Nikolay Borisov <n.borisov.lkml@gmail.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-xfs@vger.kernel.org
Subject: Re: Deadlock between block allocation and block truncation
Date: Wed, 12 Apr 2017 19:12:50 +0300	[thread overview]
Message-ID: <7459d8b3-81fe-875c-1b14-b30089365d8d@gmail.com> (raw)
In-Reply-To: <20170412161017.GA16590@infradead.org>



On 12.04.2017 19:10, Christoph Hellwig wrote:
> Hi Nikolay,
> 
> I guess the culprit is that truncate can free up to two extents in
> the same transaction and thus try to lock two different AGs without
> requiring them to be in increasing order.
> 
> Does the one liner below fix the problem for you?
> 
> diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
> index 7605d8396596..29f2cd5afb04 100644
> --- a/fs/xfs/xfs_inode.c
> +++ b/fs/xfs/xfs_inode.c
> @@ -58,7 +58,7 @@ kmem_zone_t *xfs_inode_zone;
>   * Used in xfs_itruncate_extents().  This is the maximum number of extents
>   * freed from a file in a single transaction.
>   */
> -#define	XFS_ITRUNC_MAX_EXTENTS	2
> +#define	XFS_ITRUNC_MAX_EXTENTS	1
>  
>  STATIC int xfs_iflush_int(struct xfs_inode *, struct xfs_buf *);
>  STATIC int xfs_iunlink(struct xfs_trans *, struct xfs_inode *);
> 


I will apply this to 3.12 and 4.4 and run tests since I can reproduce
fairly reliably on those. You don't expect any fallout on older kernel,
yes ?

  reply	other threads:[~2017-04-12 16:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-12 15:51 Deadlock between block allocation and block truncation Nikolay Borisov
2017-04-12 16:10 ` Christoph Hellwig
2017-04-12 16:12   ` Nikolay Borisov [this message]
2017-04-12 16:20     ` Christoph Hellwig
2017-04-12 17:44   ` Nikolay Borisov
2017-04-12 17:57     ` Christoph Hellwig
2017-04-13 13:52   ` Nikolay Borisov
2017-04-14  7:42     ` Christoph Hellwig
2017-04-25  7:36       ` 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=7459d8b3-81fe-875c-1b14-b30089365d8d@gmail.com \
    --to=n.borisov.lkml@gmail.com \
    --cc=hch@infradead.org \
    --cc=linux-xfs@vger.kernel.org \
    /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