shithub: lwext4

Download patch

ref: 519e5676f7a8e2ec620731adb099a66072d4f1a1
parent: c9b6c30e64e69abab013d29532bacda3c9c5d45f
author: gkostka <[email protected]>
date: Tue Dec 29 05:58:14 EST 2015

ext4_trans: fix return value of ext4_trans_try_revoke_block

Function ext4_trans_try_revoke_block has been always return EOK,
even if jbd_trans_try_revoke_block fail.

--- a/lwext4/ext4_trans.c
+++ b/lwext4/ext4_trans.c
@@ -78,7 +78,8 @@
 	if (r != EOK)
 		return r;
 
-	if((r = ext4_trans_get_write_access(bdev->fs, b)) != EOK)
+	r = ext4_trans_get_write_access(bdev->fs, b);
+	if (r != EOK)
 		ext4_block_set(bdev, b);
 
 	return r;
@@ -92,7 +93,8 @@
 	if (r != EOK)
 		return r;
 
-	if((r = ext4_trans_get_write_access(bdev->fs, b)) != EOK)
+	r = ext4_trans_get_write_access(bdev->fs, b);
+	if (r != EOK)
 		ext4_block_set(bdev, b);
 
 	return r;
@@ -105,7 +107,7 @@
 	struct ext4_fs *fs = bdev->fs;
 	if (fs->jbd_journal && fs->curr_trans) {
 		struct jbd_trans *trans = fs->curr_trans;
-		jbd_trans_try_revoke_block(trans, lba);
+		r = jbd_trans_try_revoke_block(trans, lba);
 	}
 	return r;
 }