public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: remove impossible condition
@ 2016-02-25 12:43 Luis de Bethencourt
  2016-03-01 12:08 ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Luis de Bethencourt @ 2016-02-25 12:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: cmaiolino, darrick.wong, namjae.jeon, bfoster, sandeen, xfs,
	Luis de Bethencourt, billodo

bp_release is set to 0 just before the breakpoint of the for loop before
the conditional check (in line 458). The other breakpoint is a goto that
skips the dead code.

Addresses-Coverity-Id: 102338

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
---

Hi,

Thanks for reviewing this :)

Luis

 fs/xfs/libxfs/xfs_bmap.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index 6a05166..1171795 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -477,10 +477,7 @@ xfs_bmap_check_leaf_extents(
 		}
 		block = XFS_BUF_TO_BLOCK(bp);
 	}
-	if (bp_release) {
-		bp_release = 0;
-		xfs_trans_brelse(NULL, bp);
-	}
+
 	return;
 
 error0:
-- 
2.5.1

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] xfs: remove impossible condition
  2016-02-25 12:43 [PATCH] xfs: remove impossible condition Luis de Bethencourt
@ 2016-03-01 12:08 ` Christoph Hellwig
  2016-03-01 13:23   ` Luis de Bethencourt
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2016-03-01 12:08 UTC (permalink / raw)
  To: Luis de Bethencourt
  Cc: cmaiolino, darrick.wong, namjae.jeon, bfoster, sandeen,
	linux-kernel, xfs, billodo

On Thu, Feb 25, 2016 at 12:43:57PM +0000, Luis de Bethencourt wrote:
> bp_release is set to 0 just before the breakpoint of the for loop before
> the conditional check (in line 458). The other breakpoint is a goto that
> skips the dead code.

Yes, this looks correct:

Reviewed-by: Christoph Hellwig <hch@lst.de>

The whole code around this is rather grotty and could use some more
work, though..

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] xfs: remove impossible condition
  2016-03-01 12:08 ` Christoph Hellwig
@ 2016-03-01 13:23   ` Luis de Bethencourt
  2016-03-01 18:22     ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Luis de Bethencourt @ 2016-03-01 13:23 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: cmaiolino, darrick.wong, namjae.jeon, bfoster, sandeen,
	linux-kernel, xfs, billodo

On 01/03/16 12:08, Christoph Hellwig wrote:
> On Thu, Feb 25, 2016 at 12:43:57PM +0000, Luis de Bethencourt wrote:
>> bp_release is set to 0 just before the breakpoint of the for loop before
>> the conditional check (in line 458). The other breakpoint is a goto that
>> skips the dead code.
> 
> Yes, this looks correct:
> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> 
> The whole code around this is rather grotty and could use some more
> work, though..
> 

Thanks for the review Christoph!

If you have some specific things in mind that I could fix in the code around
this, I am happy to add it to my ToDo list. Or I can continue reading it and
let you know of anything I see, so you can confirm before I try to fix it.

Regards,
Luis

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] xfs: remove impossible condition
  2016-03-01 13:23   ` Luis de Bethencourt
@ 2016-03-01 18:22     ` Christoph Hellwig
  0 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2016-03-01 18:22 UTC (permalink / raw)
  To: Luis de Bethencourt
  Cc: cmaiolino, darrick.wong, namjae.jeon, bfoster, sandeen,
	linux-kernel, xfs, Christoph Hellwig, billodo

On Tue, Mar 01, 2016 at 01:23:33PM +0000, Luis de Bethencourt wrote:
> If you have some specific things in mind that I could fix in the code around
> this, I am happy to add it to my ToDo list. Or I can continue reading it and
> let you know of anything I see, so you can confirm before I try to fix it.

I don't think this mess is something I want to let newbies loose on :)

Thanks a lot for the patch again!

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-03-01 18:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-25 12:43 [PATCH] xfs: remove impossible condition Luis de Bethencourt
2016-03-01 12:08 ` Christoph Hellwig
2016-03-01 13:23   ` Luis de Bethencourt
2016-03-01 18:22     ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox