From c9cb7972fbfc469c645836735e843925fd8043a6 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 14 Jan 2014 18:24:21 -0600 Subject: [PATCH] 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 --- ChangeLog | 5 +++++ fs/fat/fs_fat32.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 13d4bb7778..061def0d3a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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). + diff --git a/fs/fat/fs_fat32.c b/fs/fat/fs_fat32.c index cbbc3cd894..c26d9ee618 100644 --- a/fs/fat/fs_fat32.c +++ b/fs/fat/fs_fat32.c @@ -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 * * 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; }