FAT: Fix some root directory logic that was conditionally done only for FAT32. Apparently this needs to be done for all FAT types. From Tridge via Lorenz Meier

This commit is contained in:
Gregory Nutt 2014-01-14 18:24:21 -06:00
parent 2bfad60c85
commit c9cb7972fb
2 changed files with 7 additions and 2 deletions

View File

@ -6442,3 +6442,8 @@
* net/net_close.c: If CONFIG_NET_TCP_WRITE_BUFFERS is selected,
then it is necessary to free the write buffere callback structure
when the socket is closed (2014-1-14).
* fs/fat/fs_fat32.c: Fix some root directory logic that was
conditionally done only for FAT 32. Apparently this needs to
done for all FAT types. From Tridge via Lorenz Meier
(2014-1-14).

View File

@ -1,7 +1,7 @@
/****************************************************************************
* fs/fat/fs_fat32.c
*
* Copyright (C) 2007-2009, 2011-2013 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009, 2011-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* References:
@ -2119,7 +2119,7 @@ static int fat_mkdir(struct inode *mountpt, const char *relpath, mode_t mode)
DIR_PUTFSTCLUSTLO(direntry, dircluster);
parentcluster = dirinfo.dir.fd_startcluster;
if (fs->fs_type != FSTYPE_FAT32 && parentcluster == fs->fs_rootbase)
if (parentcluster == fs->fs_rootbase)
{
parentcluster = 0;
}