public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Ruben Porras <ruben.porras@linworks.de>
To: xfs@oss.sgi.com
Subject: [PATCH] do not test return value of xfs_bmap_*_count_leaves
Date: Fri, 28 Mar 2008 16:43:31 +0100	[thread overview]
Message-ID: <1206719011.8339.6.camel@marzo> (raw)

[-- Attachment #1: Type: text/plain, Size: 153 bytes --]

These functions, xfs_bmap_count_leaves and xfs_bmap_disk_count_leaves,
return always 0. Therefore it is not necessary to test the return value.

Regards

[-- Attachment #2: xfs_bmap.patch --]
[-- Type: text/x-patch, Size: 1246 bytes --]

Index: fs/xfs/xfs_bmap.c
===================================================================
RCS file: /cvs/linux-2.6-xfs/fs/xfs/xfs_bmap.c,v
retrieving revision 1.383
diff -u -r1.383 xfs_bmap.c
--- fs/xfs/xfs_bmap.c	6 Feb 2008 05:18:18 -0000	1.383
+++ fs/xfs/xfs_bmap.c	28 Mar 2008 15:39:59 -0000
@@ -6361,13 +6361,9 @@
 	mp = ip->i_mount;
 	ifp = XFS_IFORK_PTR(ip, whichfork);
 	if ( XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_EXTENTS ) {
-		if (unlikely(xfs_bmap_count_leaves(ifp, 0,
+		xfs_bmap_count_leaves(ifp, 0,
 			ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t),
-			count) < 0)) {
-			XFS_ERROR_REPORT("xfs_bmap_count_blocks(1)",
-					 XFS_ERRLEVEL_LOW, mp);
-			return XFS_ERROR(EFSCORRUPTED);
-		}
+			count);
 		return 0;
 	}
 
@@ -6448,13 +6444,7 @@
 		for (;;) {
 			nextbno = be64_to_cpu(block->bb_rightsib);
 			numrecs = be16_to_cpu(block->bb_numrecs);
-			if (unlikely(xfs_bmap_disk_count_leaves(0,
-					block, numrecs, count) < 0)) {
-				xfs_trans_brelse(tp, bp);
-				XFS_ERROR_REPORT("xfs_bmap_count_tree(2)",
-						 XFS_ERRLEVEL_LOW, mp);
-				return XFS_ERROR(EFSCORRUPTED);
-			}
+			xfs_bmap_disk_count_leaves(0, block, numrecs, count);
 			xfs_trans_brelse(tp, bp);
 			if (nextbno == NULLFSBLOCK)
 				break;

             reply	other threads:[~2008-03-28 15:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-28 15:43 Ruben Porras [this message]
2008-03-28 15:46 ` [PATCH] do not test return value of xfs_bmap_*_count_leaves Josef 'Jeff' Sipek
2008-04-04 15:08   ` Ruben Porras

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=1206719011.8339.6.camel@marzo \
    --to=ruben.porras@linworks.de \
    --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