public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Chinner <dgc@sgi.com>
To: Kevin Xu <cgxu.gg@gmail.com>
Cc: xfscn@googlegroups.com, xfs@oss.sgi.com
Subject: Re: [PATCH]fix fbno in  xfs_dir2_node_addname_int
Date: Tue, 25 Mar 2008 09:16:45 +1100	[thread overview]
Message-ID: <20080324221645.GD103491721@sgi.com> (raw)
In-Reply-To: <47E5A982.8010002@gmail.com>

On Sun, Mar 23, 2008 at 08:51:14AM +0800, Kevin Xu wrote:
> if we didn't find a freespace block for our new entry  in the current 
> freeindex block, 
> return to the first freeindex block and continue to check.

What is the test case that demonstrates this problem?

Looking at the impact of setting fbno = -1 if we don't find a
suitable free space, the next iteration of the loop will do:

   1454                 if (fbp == NULL) {
   1455                         /*
   1456                          * Happens the first time through unless lookup gave
   1457                          * us a freespace block to start with.
   1458                          */
   1459                         if (++fbno == 0)
   1460                                 fbno = XFS_DIR2_FREE_FIRSTDB(mp);

and

define XFS_DIR2_FREE_FIRSTDB(mp)       \
        xfs_dir2_byte_to_db(mp, XFS_DIR2_FREE_OFFSET)

Is a fixed offset into the directory. Hence resetting fbno = -1 will
force us to look up the same freespace block on every loop iteration.
That looks like it will livelock as soon as the first free space block
does not have enough space for the desired entry......

Cheers,

Dave.
-- 
Dave Chinner
Principal Engineer
SGI Australian Software Group

  reply	other threads:[~2008-03-24 22:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-23  0:51 [PATCH]fix fbno in xfs_dir2_node_addname_int Kevin Xu
2008-03-24 22:16 ` David Chinner [this message]
2009-04-13 21:48 ` Eric Sandeen

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=20080324221645.GD103491721@sgi.com \
    --to=dgc@sgi.com \
    --cc=cgxu.gg@gmail.com \
    --cc=xfs@oss.sgi.com \
    --cc=xfscn@googlegroups.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox