All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Elder <aelder@sgi.com>
To: Chandra Seetharaman <sekharan@us.ibm.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 03/12] xfs: Remove the macro XFS_BUF_ERROR and family
Date: Fri, 22 Jul 2011 14:38:10 -0500	[thread overview]
Message-ID: <1311363490.2771.98.camel@doink> (raw)
In-Reply-To: <20110722003254.21069.27101.sendpatchset@chandra-lucid.beaverton.ibm.com>

On Thu, 2011-07-21 at 17:32 -0700, Chandra Seetharaman wrote:
> Remove the definitions and usage of the macros XFS_BUF_ERROR,
> XFS_BUF_GETERROR and XFS_BUF_ISERROR.
> 
> Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>

Nice work on this.  It is clear it was thoughtfully
done.

I have two things that need to be fixed.  If you do that
you can consider this signed off by me.

Reviewed-by: Alex Elder <aelder@sgi.com>

. . .

> diff --git a/fs/xfs/quota/xfs_dquot.c b/fs/xfs/quota/xfs_dquot.c
> index 837f311..e7e35fb 100644
> --- a/fs/xfs/quota/xfs_dquot.c
> +++ b/fs/xfs/quota/xfs_dquot.c
> @@ -403,7 +403,8 @@ xfs_qm_dqalloc(
>  			       dqp->q_blkno,
>  			       mp->m_quotainfo->qi_dqchunklen,
>  			       0);
> -	if (!bp || (error = XFS_BUF_GETERROR(bp)))
> +	error = xfs_buf_geterror(bp);
> +	if (error)
>  		goto error1;
>  	/*
>  	 * Make a chunk of dquots out of this buffer and log

This results in behavior that differs from before.
Previously, error would have value 0 following
the call to xfs_trans_get_buf() here, meaning that
(at error1:) xfs_qm_dqalloc() would return 0 in
this case.  Now it will return ENOMEM.

I think what you have done may be correct, but
since the change does more than the simple
macro transformation you intend, this change
should be done in a separate commit.

So either:
- post a new patch (preferably before this
  whole series) that makes this code return
  ENOMEM if xfs_trans_get_buf() returns a
  null pointer, then update this patch accordingly;
- or just change this patch to return 0 instead
  of  ENOMEM if xfs_trans_get_buf() returns a
  null pointer.

. . .

> diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
> index 88d1214..97daa35 100644
> --- a/fs/xfs/xfs_vnodeops.c
> +++ b/fs/xfs/xfs_vnodeops.c
> @@ -83,7 +83,7 @@ xfs_readlink_bmap(
>  
>  		bp = xfs_buf_read(mp->m_ddev_targp, d, BTOBB(byte_cnt),
>  				  XBF_LOCK | XBF_MAPPED | XBF_DONT_BLOCK);

xfs_buf_read() can return NULL here, so to match
the existing behavior you should call xfs_buf_geterror()
here.

> -		error = XFS_BUF_GETERROR(bp);
> +		error = bp->b_error;
>  		if (error) {
>  			xfs_ioerror_alert("xfs_readlink",
>  				  ip->i_mount, bp, XFS_BUF_ADDR(bp));


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

  reply	other threads:[~2011-07-22 19:38 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-22  0:32 [PATCH 00/12] Remove number of macros from xfs_buf.h Chandra Seetharaman
2011-07-22  0:32 ` [PATCH 01/12] xfs: Remove the macro XFS_BUF_BFLAGS Chandra Seetharaman
2011-07-22 19:37   ` Alex Elder
2011-07-22  0:32 ` [PATCH 02/12] xfs: Remove the macro XFS_BUF_ZEROFLAGS Chandra Seetharaman
2011-07-22  0:32 ` [PATCH 03/12] xfs: Remove the macro XFS_BUF_ERROR and family Chandra Seetharaman
2011-07-22 19:38   ` Alex Elder [this message]
2011-07-22 20:49     ` Chandra Seetharaman
2011-07-22 21:10       ` Alex Elder
2011-07-22 21:30         ` Alex Elder
2011-07-22 21:31         ` Chandra Seetharaman
2011-07-22  0:33 ` [PATCH 04/12] xfs: Remove macro XFS_BUF_BUSY " Chandra Seetharaman
2011-07-22 19:38   ` Alex Elder
2011-07-22  0:33 ` [PATCH 05/12] xfs: Remove macro XFS_BUF_HOLD Chandra Seetharaman
2011-07-22 19:38   ` Alex Elder
2011-07-22  0:33 ` [PATCH 06/12] xfs: Remove macro XFS_BUF_SET_START Chandra Seetharaman
2011-07-22 19:38   ` Alex Elder
2011-07-22  0:33 ` [PATCH 07/12] xfs: Remove the macro XFS_BUF_PTR Chandra Seetharaman
2011-07-22 19:38   ` Alex Elder
2011-07-22  0:33 ` [PATCH 08/12] xfs: Remove the macro XFS_BUF_SET_PTR Chandra Seetharaman
2011-07-22 19:38   ` Alex Elder
2011-07-22 20:50     ` Chandra Seetharaman
2011-07-24 11:35     ` Christoph Hellwig
2011-07-25 15:57       ` Alex Elder
2011-07-25 16:25         ` Christoph Hellwig
2011-07-25 16:58           ` Alex Elder
2011-07-25 22:18         ` Chandra Seetharaman
2011-07-22  0:33 ` [PATCH 09/12] Replace the macro XFS_BUF_ISPINNED with helper xfs_buf_ispinned Chandra Seetharaman
2011-07-22 19:38   ` Alex Elder
2011-07-22 20:51     ` Chandra Seetharaman
2011-07-22  0:33 ` [PATCH 10/12] xfs: Remove the macro XFS_BUF_SET_TARGET Chandra Seetharaman
2011-07-22 19:38   ` Alex Elder
2011-07-22  0:34 ` [PATCH 11/12] xfs: Remove the macro XFS_BUF_TARGET Chandra Seetharaman
2011-07-22 19:38   ` Alex Elder
2011-07-22 19:46   ` Alex Elder
2011-07-22  0:34 ` [PATCH 12/12] xfs: Remove the macro XFS_BUFTARG_NAME Chandra Seetharaman
2011-07-22 19:49   ` Alex Elder
2011-07-22 21:23     ` Chandra Seetharaman
2011-07-22 21:26       ` Chandra Seetharaman
2011-07-24 11:37     ` Christoph Hellwig
2011-07-25 15:57       ` Alex Elder
2011-07-25 16:26         ` Christoph Hellwig
2011-07-25 22:18         ` Chandra Seetharaman
  -- strict thread matches above, loose matches on Subject: below --
2011-07-16  1:21 [PATCH 00/12] Remove number of macros from xfs_buf.h Chandra Seetharaman
2011-07-16  1:21 ` [PATCH 03/12] xfs: Remove the macro XFS_BUF_ERROR and family Chandra Seetharaman
2011-07-16  2:00   ` Christoph Hellwig

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=1311363490.2771.98.camel@doink \
    --to=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 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.