shithub: lwext4

Download patch

ref: 9e5db3d386e63d5aa3b001ae4d0167a20f472f48
parent: c897dc5a646527c2b87e4bc0399db59b46edbb1d
parent: 191fb80f249b0e82bd77b860d090741e0ace9450
author: gkostka <kostka.grzegorz@gmail.com>
date: Sun Sep 20 12:27:55 EDT 2015

Merge pull request #1 from ngkaho1234/master

FIXME: MP lock was held without release at ext4_dir_entry_next in case the end of directory is reached.

--- a/lwext4/ext4.c
+++ b/lwext4/ext4.c
@@ -1892,8 +1892,10 @@
 
 	EXT4_MP_LOCK(d->f.mp);
 
-	if (d->next_off == EXT4_DIR_ENTRY_OFFSET_TERM)
+	if (d->next_off == EXT4_DIR_ENTRY_OFFSET_TERM) {
+		EXT4_MP_UNLOCK(d->f.mp);
 		return 0;
+	}
 
 	r = ext4_fs_get_inode_ref(&d->f.mp->fs, d->f.inode, &dir);
 	if (r != EOK) {