shithub: lwext4

Download patch

ref: 57ab5f230b0a085bc236cf353013d02854e42aa5
parent: d68a48bfeb7f77b46c64aa9dab1f93448c3ad601
author: ngkaho1234 <ngkaho1234@gmail.com>
date: Thu Sep 24 05:26:54 EDT 2015

Regard to gkostka, EXT4_MP_LOCK/UNLOCK should be implemented as recursive mutex.
https://github.com/ngkaho1234/lwext4/commit/d68a48bfeb7f77b46c64aa9dab1f93448c3ad601

--- a/lwext4/ext4.c
+++ b/lwext4/ext4.c
@@ -1899,7 +1899,6 @@
 	EXT4_MP_LOCK(mp);
 	ext4_block_cache_write_back(mp->fs.bdev, 1);
 	r = ext4_generic_open2(&f, path, O_RDONLY, filetype, 0, 0);
-	EXT4_MP_UNLOCK(mp);
 	if (r == EOK)
 		r = ext4_fread(&f, buf, bufsize, rcnt);
 	else
@@ -1908,7 +1907,6 @@
 	ext4_fclose(&f);
 
 Finish:
-	EXT4_MP_LOCK(mp);
 	ext4_block_cache_write_back(mp->fs.bdev, 0);
 	EXT4_MP_UNLOCK(mp);
 	return r;