All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Lightsey <john@nixnuts.net>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH v2] ocfs2: try to reuse extent block in dealloc without meta_alloc
Date: Fri, 29 Dec 2017 15:15:59 -0600	[thread overview]
Message-ID: <1514582159.2812.5.camel@nixnuts.net> (raw)
In-Reply-To: <63ADC13FD55D6546B7DECE290D39E373F2909D75@H3CMLB12-EX.srv.huawei-3com.com>

On Thu, 2017-12-28 at 06:38 +0000, Changwei Ge wrote:
> Hi Alex,
> 
> On 2017/12/28 14:22, alex chen wrote:
> > We has doubled extent number in ocfs2_populate_write_desc(), so
> > here we don't need to double again.
> 
> I think your comment here makes sense.
> I will remove the multiplier 2 in my next version of this patch.
> 

This may have made it function in testing where it should have failed.

I backported this patch to Debian's 4.9.65 kernel today, removed the *2
multiplier, and hit a related assertion failure in this codepath:

ocfs2_mark_extent_written
 ocfs2_change_extent_flag
   ocfs2_split_extent
    ocfs2_split_and_insert
     ocfs2_grow_tree
      ocfs2_add_branch
       ocfs2_create_new_meta_bhs
        ocfs2_claim_metadata

The assertion failure in ocfs2_claim_metadata() was

BUG_ON(ac->ac_bits_wanted < (ac->ac_bits_given + bits_wanted));

My guess is that meta_ac was allocated at the beginning of the write,
then the tree was truncated during the write, so the actual allocation
is requesting more than was originally reserved.

It seems like the codepaths where meta_ac != NULL also need to know
about the list of extents available in et_dealloc.

The Perl code I used to hit this bug is attached.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: directio.pl
Type: application/x-perl
Size: 2145 bytes
Desc: not available
Url : http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20171229/396d8318/attachment.bin 

  reply	other threads:[~2017-12-29 21:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-26  7:55 [Ocfs2-devel] [PATCH v2] ocfs2: try to reuse extent block in dealloc without meta_alloc Changwei Ge
2017-12-27  8:47 ` piaojun
2017-12-28  6:30   ` Changwei Ge
2017-12-27 10:01 ` Junxiao Bi
2017-12-27 12:21   ` Changwei Ge
2018-01-02  8:17     ` Junxiao Bi
2018-01-03  2:27       ` Changwei Ge
2017-12-28  6:21 ` alex chen
2017-12-28  6:38   ` Changwei Ge
2017-12-29 21:15     ` John Lightsey [this message]
2017-12-29 22:36       ` Ge Changwei
2018-01-07 21:07         ` John Lightsey
2018-01-08  0:29           ` Changwei Ge

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=1514582159.2812.5.camel@nixnuts.net \
    --to=john@nixnuts.net \
    --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.