[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1891546521.01672360201726.JavaMail.epsvc@epcpadp3>
Date: Thu, 29 Dec 2022 20:52:38 +0900
From: Sungjong Seo <sj1557.seo@...sung.com>
To: linkinjeon@...nel.org
Cc: pali@...nel.org, viro@...iv.linux.org.uk,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
Sungjong Seo <sj1557.seo@...sung.com>,
Yuezhang Mo <Yuezhang.Mo@...y.com>
Subject: [PATCH] exfat: redefine DIR_DELETED as the bad cluster number
When a file or a directory is deleted, the hint for the cluster of
its parent directory in its in-memory inode is set as DIR_DELETED.
Therefore, DIR_DELETED must be one of invalid cluster numbers. According
to the exFAT specification, a volume can have at most 2^32-11 clusters.
However, DIR_DELETED is wrongly defined as 0xFFFF0321, which could be
a valid cluster number. To fix it, let's redefine DIR_DELETED as
0xFFFFFFF7, the bad cluster number.
Fixes: 1acf1a564b60 ("exfat: add in-memory and on-disk structures and headers")
Reported-by: Yuezhang Mo <Yuezhang.Mo@...y.com>
Signed-off-by: Sungjong Seo <sj1557.seo@...sung.com>
---
fs/exfat/exfat_fs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/exfat/exfat_fs.h b/fs/exfat/exfat_fs.h
index bc6d21d7c5ad..25a5df0fdfe0 100644
--- a/fs/exfat/exfat_fs.h
+++ b/fs/exfat/exfat_fs.h
@@ -50,7 +50,7 @@ enum {
#define ES_IDX_LAST_FILENAME(name_len) \
(ES_IDX_FIRST_FILENAME + EXFAT_FILENAME_ENTRY_NUM(name_len) - 1)
-#define DIR_DELETED 0xFFFF0321
+#define DIR_DELETED 0xFFFFFFF7
/* type values */
#define TYPE_UNUSED 0x0000
--
2.25.1
Powered by blists - more mailing lists