shithub: lwext4

Download patch

ref: 191fb80f249b0e82bd77b860d090741e0ace9450
parent: c897dc5a646527c2b87e4bc0399db59b46edbb1d
author: ngkaho1234 <ngkaho1234@gmail.com>
date: Sun Sep 20 17:38:02 EDT 2015

FIX: 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) {