From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 4/5] [PATCH] xfs: simplify buffer to transaction matching
Date: Mon, 3 May 2010 14:23:43 +1000 [thread overview]
Message-ID: <20100503042343.GD2591@dastard> (raw)
In-Reply-To: <20100501125839.GA26342@infradead.org>
On Sat, May 01, 2010 at 08:58:39AM -0400, Christoph Hellwig wrote:
> On Tue, Apr 20, 2010 at 04:41:55PM +1000, Dave Chinner wrote:
> > Good start, but I think that it should use xfs_trans_first_item()
> > and xfs_trans_next_item() rather than walking the descriptor
> > table directly.
>
> I tried implementing it, but it doesn't work. We can call the buffer
> matching routines on transactions that don't have any item linked to
> it, which will cause xfs_trans_first_item to panic. Compare this code
> in xfs_trans_buf_item_match:
>
> for (licp = &tp->t_items; licp != NULL; licp = licp->lic_next) {
> if (xfs_lic_are_all_free(licp)) {
> ASSERT(licp == &tp->t_items);
> ASSERT(licp->lic_next == NULL);
> return NULL;
> }
>
> ...
> }
>
> to this in xfs_trans_first_item:
>
> licp = &tp->t_items;
> /*
> * If it's not in the first chunk, skip to the second.
> */
> if (xfs_lic_are_all_free(licp)) {
> licp = licp->lic_next;
> }
>
> /*
> * Return the first non-free descriptor in the chunk.
> */
> ASSERT(!xfs_lic_are_all_free(licp));
Is there any reason why xfs_trans_first_item() should panic if it
doesn't find a log item? I can't think of one that can't be handled
by returning NULL and the caller doing ASSERT(lidp)? The callers:
xfs_trans_count_vecs - has assert, triggers shutdown
xfs_trans_fill_vecs - has assert, handles null return
xfs_trans_committed - handles null return
xfs_trans_uncommit - handles null return
So it seems like we could make xfs_trans_first_item() not assert
fail on debug kernels.
The other thing that concerns me is that we have two different
definitions of "empty transactions" in these two functions. It seems
to me that xfs_trans_first_item() is the correct one - if we remove
items from the transaction there is no guarantee that the embedded
chunk in the transaction contains any active descriptors. Hence I
think the code in xfs_trans_buf_item_match[_all]() is actually
buggy...
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2010-05-03 4:21 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-18 0:10 [PATCH 0/5] various cleanups for 2.6.35 Christoph Hellwig
2010-04-18 0:10 ` [PATCH 1/5] xfs: access quotainfo structure directly Christoph Hellwig
2010-04-20 6:28 ` Dave Chinner
2010-04-18 0:10 ` [PATCH 2/5] xfs: remove a few macro indirections in the quota code Christoph Hellwig
2010-04-20 6:31 ` Dave Chinner
2010-04-18 0:10 ` [PATCH 3/5] xfs: removed unused XFS_QMOPT_ flags Christoph Hellwig
2010-04-20 6:33 ` Dave Chinner
2010-04-22 11:49 ` Christoph Hellwig
2010-04-18 0:10 ` [PATCH 4/5] [PATCH] xfs: simplify buffer to transaction matching Christoph Hellwig
2010-04-20 6:41 ` Dave Chinner
2010-05-01 12:58 ` Christoph Hellwig
2010-05-03 4:23 ` Dave Chinner [this message]
2010-04-27 14:16 ` Christoph Hellwig
2010-04-29 13:35 ` Alex Elder
2010-04-29 13:38 ` Christoph Hellwig
2010-04-18 0:10 ` [PATCH 5/5] xfs: remove dead XFS_LOUD_RECOVERY code Christoph Hellwig
2010-04-20 6:44 ` Dave Chinner
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=20100503042343.GD2591@dastard \
--to=david@fromorbit.com \
--cc=hch@infradead.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox