From: Michael Nishimoto <miken@agami.com>
To: David Chinner <dgc@sgi.com>
Cc: xfs@oss.sgi.com
Subject: Re: question about xfs_alloc_fix_freelist()
Date: Tue, 06 May 2008 14:21:57 -0700 [thread overview]
Message-ID: <4820CBF5.8090206@agami.com> (raw)
In-Reply-To: <20080504235048.GC155679365@sgi.com>
David Chinner wrote:
> On Fri, May 02, 2008 at 02:01:47PM -0700, Michael Nishimoto wrote:
> >
> > The following code can be found near the end of xfs_alloc_fix_freelist:
> >
> > if (targs.agbno == NULLAGBLOCK) {
> > if (flags & XFS_ALLOC_FLAG_FREEING)
> > break;
> > xfs_trans_brelse(tp, agflbp);
> > args->agbp = NULL;
> > return 0;
> > }
> >
> > Don't we need to release agbp too by calling xfs_trans_brelse(tp, agbp)?
>
> I don't think so. AFAICT, The agbp (agf block) is linked into the
> transaction and by this point we may have modified the AGF (think
> multiple iterations of the loop to fill the free list). Given that
> it may be modified, we shouldn't release it here but instead allow
> the transaction commit/abort to do that for us at the appropriate
> time.
>
> Cheers,
>
> Dave.
> --
> Dave Chinner
> Principal Engineer
> SGI Australian Software Group
I understood that the transaction abort code will free resources/locks
when passing back an error. However, by returning args->agbp = NULL,
aren't we telling the calling code that we have not satisfied the request
in the current AG?
I do see the part of about the AGF possibly getting modified.
It would help to have a clear comment description of possible inputs vs.
expected outputs for this function. :-)
thanks,
Michael
next prev parent reply other threads:[~2008-05-06 21:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-02 21:01 question about xfs_alloc_fix_freelist() Michael Nishimoto
2008-05-04 23:50 ` David Chinner
2008-05-06 21:21 ` Michael Nishimoto [this message]
2008-05-07 5:31 ` David Chinner
2008-05-07 7:16 ` Michael Nishimoto
2008-05-07 8:44 ` David 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=4820CBF5.8090206@agami.com \
--to=miken@agami.com \
--cc=dgc@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.