R0.11 with patch 1
March 9, 2015 At the thread-safe configuration (_FS_REENTRANT == 1), an unexpected operation to the volume can result a wrong volume lock. For example, f_open() ==> media change ==> f_close(), in this case the volume gets left locked and following function calls to the volume will be locked out until a forced initialization of the volume by f_mount(). To solve this problem, apply this patch to the ff.c.
This commit is contained in:
@@ -2329,14 +2329,11 @@ FRESULT validate ( /* FR_OK(0): The object is valid, !=0: Invalid */
|
|||||||
FIL *fil = (FIL*)obj; /* Assuming offset of .fs and .id in the FIL/DIR structure is identical */
|
FIL *fil = (FIL*)obj; /* Assuming offset of .fs and .id in the FIL/DIR structure is identical */
|
||||||
|
|
||||||
|
|
||||||
if (!fil || !fil->fs || !fil->fs->fs_type || fil->fs->id != fil->id)
|
if (!fil || !fil->fs || !fil->fs->fs_type || fil->fs->id != fil->id || (disk_status(fil->fs->drv) & STA_NOINIT))
|
||||||
return FR_INVALID_OBJECT;
|
return FR_INVALID_OBJECT;
|
||||||
|
|
||||||
ENTER_FF(fil->fs); /* Lock file system */
|
ENTER_FF(fil->fs); /* Lock file system */
|
||||||
|
|
||||||
if (disk_status(fil->fs->drv) & STA_NOINIT)
|
|
||||||
return FR_NOT_READY;
|
|
||||||
|
|
||||||
return FR_OK;
|
return FR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user