public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Chandra Seetharaman <sekharan@us.ibm.com>
Cc: Alex Elder <aelder@sgi.com>, XFS Mailing List <xfs@oss.sgi.com>
Subject: Re: [PATCH v2] xfs: Check the return value of xfs_trans_get_buf()
Date: Tue, 20 Sep 2011 11:00:29 -0400	[thread overview]
Message-ID: <20110920150029.GA5239@infradead.org> (raw)
In-Reply-To: <1316527015.9298.60.camel@chandra-lucid.austin.ibm.com>

On Tue, Sep 20, 2011 at 08:56:55AM -0500, Chandra Seetharaman wrote:
> --- a/fs/xfs/xfs_attr_leaf.c
> +++ b/fs/xfs/xfs_attr_leaf.c
> @@ -2948,6 +2948,8 @@ xfs_attr_leaf_freextent(xfs_trans_t **trans, xfs_inode_t *dp,
>  			bp = xfs_trans_get_buf(*trans,
>  					dp->i_mount->m_ddev_targp,
>  					dblkno, dblkcnt, XBF_LOCK);
> +			if (!bp)
> +				return ENOMEM;
>  			xfs_trans_binval(*trans, bp);

xfs_trans_binval only really does anything if the buffer was in memory.

We have a few callers using that patterm, and I think they should simply
switch to not reading the buffer in if it's not there yet, e.g.
using something like an xfs_trans_incore.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2011-09-20 15:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-20 13:56 [PATCH v2] xfs: Check the return value of xfs_trans_get_buf() Chandra Seetharaman
2011-09-20 15:00 ` Christoph Hellwig [this message]
2011-09-20 18:05   ` Chandra Seetharaman
2011-09-20 18:09     ` Christoph Hellwig
2011-09-20 15:37 ` Alex Elder
2011-09-21  0:56 ` Dave Chinner
2011-09-21 14:28   ` Chandra Seetharaman
2011-09-21 22:28     ` Dave Chinner
2011-09-21 20:38   ` Alex Elder
2011-09-21 22:43     ` 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=20110920150029.GA5239@infradead.org \
    --to=hch@infradead.org \
    --cc=aelder@sgi.com \
    --cc=sekharan@us.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox