|
Kmods SIG |
50e2b3 |
From d1727d55c0327efdba2a5bad7801d509b721fef3 Mon Sep 17 00:00:00 2001
|
|
Kmods SIG |
50e2b3 |
From: Joe Perches <joe@perches.com>
|
|
Kmods SIG |
50e2b3 |
Date: Fri, 24 Apr 2020 13:31:12 +0900
|
|
Kmods SIG |
50e2b3 |
Subject: [Backport d1727d55c032] exfat: Use a more common logging style
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
Remove the direct use of KERN_<LEVEL> in functions by creating
|
|
Kmods SIG |
50e2b3 |
separate exfat_<level> macros.
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
Miscellanea:
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
o Remove several unnecessary terminating newlines in formats
|
|
Kmods SIG |
50e2b3 |
o Realign arguments and fit to 80 columns where appropriate
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
Signed-off-by: Joe Perches <joe@perches.com>
|
|
Kmods SIG |
50e2b3 |
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
|
|
Kmods SIG |
50e2b3 |
---
|
|
Kmods SIG |
50e2b3 |
src/balloc.c | 8 +++-----
|
|
Kmods SIG |
50e2b3 |
src/dir.c | 9 ++++-----
|
|
Kmods SIG |
50e2b3 |
src/exfat_fs.h | 7 +++++++
|
|
Kmods SIG |
50e2b3 |
src/fatent.c | 13 +++++--------
|
|
Kmods SIG |
50e2b3 |
src/misc.c | 4 ++--
|
|
Kmods SIG |
50e2b3 |
src/namei.c | 26 ++++++++++---------------
|
|
Kmods SIG |
50e2b3 |
src/nls.c | 20 ++++++++-----------
|
|
Kmods SIG |
50e2b3 |
src/super.c | 47 ++++++++++++++++++++-------------------------
|
|
Kmods SIG |
50e2b3 |
8 files changed, 60 insertions(+), 74 deletions(-)
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
diff --git a/src/balloc.c b/src/balloc.c
|
|
Kmods SIG |
50e2b3 |
index 6774a5a6ded8290fb790bf70f04a1c6e3253cd7a..4055eb00ea9b84a3550dea0f831fafa2df3b3121 100644
|
|
Kmods SIG |
50e2b3 |
--- a/src/balloc.c
|
|
Kmods SIG |
50e2b3 |
+++ b/src/balloc.c
|
|
Kmods SIG |
50e2b3 |
@@ -58,9 +58,8 @@ static int exfat_allocate_bitmap(struct super_block *sb,
|
|
Kmods SIG |
50e2b3 |
need_map_size = ((EXFAT_DATA_CLUSTER_COUNT(sbi) - 1) / BITS_PER_BYTE)
|
|
Kmods SIG |
50e2b3 |
+ 1;
|
|
Kmods SIG |
50e2b3 |
if (need_map_size != map_size) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR,
|
|
Kmods SIG |
50e2b3 |
- "bogus allocation bitmap size(need : %u, cur : %lld)",
|
|
Kmods SIG |
50e2b3 |
- need_map_size, map_size);
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "bogus allocation bitmap size(need : %u, cur : %lld)",
|
|
Kmods SIG |
50e2b3 |
+ need_map_size, map_size);
|
|
Kmods SIG |
50e2b3 |
/*
|
|
Kmods SIG |
50e2b3 |
* Only allowed when bogus allocation
|
|
Kmods SIG |
50e2b3 |
* bitmap size is large
|
|
Kmods SIG |
50e2b3 |
@@ -192,8 +191,7 @@ void exfat_clear_bitmap(struct inode *inode, unsigned int clu)
|
|
Kmods SIG |
50e2b3 |
(1 << sbi->sect_per_clus_bits), GFP_NOFS, 0);
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
if (ret_discard == -EOPNOTSUPP) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR,
|
|
Kmods SIG |
50e2b3 |
- "discard not supported by device, disabling");
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "discard not supported by device, disabling");
|
|
Kmods SIG |
50e2b3 |
opts->discard = 0;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
diff --git a/src/dir.c b/src/dir.c
|
|
Kmods SIG |
50e2b3 |
index 4b91afb0f0515c06036821468b667ea14b43654d..53ae965da7ec583fb4e31cc548c40daf08ae941a 100644
|
|
Kmods SIG |
50e2b3 |
--- a/src/dir.c
|
|
Kmods SIG |
50e2b3 |
+++ b/src/dir.c
|
|
Kmods SIG |
50e2b3 |
@@ -720,9 +720,8 @@ static int exfat_dir_readahead(struct super_block *sb, sector_t sec)
|
|
Kmods SIG |
50e2b3 |
return 0;
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
if (sec < sbi->data_start_sector) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR,
|
|
Kmods SIG |
50e2b3 |
- "requested sector is invalid(sect:%llu, root:%llu)",
|
|
Kmods SIG |
50e2b3 |
- (unsigned long long)sec, sbi->data_start_sector);
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "requested sector is invalid(sect:%llu, root:%llu)",
|
|
Kmods SIG |
50e2b3 |
+ (unsigned long long)sec, sbi->data_start_sector);
|
|
Kmods SIG |
50e2b3 |
return -EIO;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
@@ -750,7 +749,7 @@ struct exfat_dentry *exfat_get_dentry(struct super_block *sb,
|
|
Kmods SIG |
50e2b3 |
sector_t sec;
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
if (p_dir->dir == DIR_DELETED) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR, "abnormal access to deleted dentry\n");
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "abnormal access to deleted dentry");
|
|
Kmods SIG |
50e2b3 |
return NULL;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
@@ -853,7 +852,7 @@ struct exfat_entry_set_cache *exfat_get_dentry_set(struct super_block *sb,
|
|
Kmods SIG |
50e2b3 |
struct buffer_head *bh;
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
if (p_dir->dir == DIR_DELETED) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR, "access to deleted dentry\n");
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "access to deleted dentry");
|
|
Kmods SIG |
50e2b3 |
return NULL;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
diff --git a/src/exfat_fs.h b/src/exfat_fs.h
|
|
Kmods SIG |
50e2b3 |
index d67fb8a6f770c28db8f1618c78fde493e2a4b965..1ebfb9085f1f719180051ee87aea94962accd238 100644
|
|
Kmods SIG |
50e2b3 |
--- a/src/exfat_fs.h
|
|
Kmods SIG |
50e2b3 |
+++ b/src/exfat_fs.h
|
|
Kmods SIG |
50e2b3 |
@@ -505,6 +505,13 @@ void __exfat_fs_error(struct super_block *sb, int report, const char *fmt, ...)
|
|
Kmods SIG |
50e2b3 |
fmt, ## args)
|
|
Kmods SIG |
50e2b3 |
void exfat_msg(struct super_block *sb, const char *lv, const char *fmt, ...)
|
|
Kmods SIG |
50e2b3 |
__printf(3, 4) __cold;
|
|
Kmods SIG |
50e2b3 |
+#define exfat_err(sb, fmt, ...) \
|
|
Kmods SIG |
50e2b3 |
+ exfat_msg(sb, KERN_ERR, fmt, ##__VA_ARGS__)
|
|
Kmods SIG |
50e2b3 |
+#define exfat_warn(sb, fmt, ...) \
|
|
Kmods SIG |
50e2b3 |
+ exfat_msg(sb, KERN_WARNING, fmt, ##__VA_ARGS__)
|
|
Kmods SIG |
50e2b3 |
+#define exfat_info(sb, fmt, ...) \
|
|
Kmods SIG |
50e2b3 |
+ exfat_msg(sb, KERN_INFO, fmt, ##__VA_ARGS__)
|
|
Kmods SIG |
50e2b3 |
+
|
|
Kmods SIG |
50e2b3 |
void exfat_get_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
|
|
Kmods SIG |
50e2b3 |
u8 tz, __le16 time, __le16 date, u8 time_ms);
|
|
Kmods SIG |
50e2b3 |
void exfat_truncate_atime(struct timespec64 *ts);
|
|
Kmods SIG |
50e2b3 |
diff --git a/src/fatent.c b/src/fatent.c
|
|
Kmods SIG |
50e2b3 |
index a855b1769a96198264b134bfb45bcd4f6f6c01d1..267e5e09eb134c34990ac2d5ce17e2692c955be8 100644
|
|
Kmods SIG |
50e2b3 |
--- a/src/fatent.c
|
|
Kmods SIG |
50e2b3 |
+++ b/src/fatent.c
|
|
Kmods SIG |
50e2b3 |
@@ -170,8 +170,7 @@ int exfat_free_cluster(struct inode *inode, struct exfat_chain *p_chain)
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
/* check cluster validation */
|
|
Kmods SIG |
50e2b3 |
if (p_chain->dir < 2 && p_chain->dir >= sbi->num_clusters) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR, "invalid start cluster (%u)",
|
|
Kmods SIG |
50e2b3 |
- p_chain->dir);
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "invalid start cluster (%u)", p_chain->dir);
|
|
Kmods SIG |
50e2b3 |
return -EIO;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
@@ -305,8 +304,7 @@ int exfat_zeroed_cluster(struct inode *dir, unsigned int clu)
|
|
Kmods SIG |
50e2b3 |
return 0;
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
release_bhs:
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR, "failed zeroed sect %llu\n",
|
|
Kmods SIG |
50e2b3 |
- (unsigned long long)blknr);
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "failed zeroed sect %llu\n", (unsigned long long)blknr);
|
|
Kmods SIG |
50e2b3 |
for (i = 0; i < n; i++)
|
|
Kmods SIG |
50e2b3 |
bforget(bhs[i]);
|
|
Kmods SIG |
50e2b3 |
return err;
|
|
Kmods SIG |
50e2b3 |
@@ -337,9 +335,8 @@ int exfat_alloc_cluster(struct inode *inode, unsigned int num_alloc,
|
|
Kmods SIG |
50e2b3 |
/* find new cluster */
|
|
Kmods SIG |
50e2b3 |
if (hint_clu == EXFAT_EOF_CLUSTER) {
|
|
Kmods SIG |
50e2b3 |
if (sbi->clu_srch_ptr < EXFAT_FIRST_CLUSTER) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR,
|
|
Kmods SIG |
50e2b3 |
- "sbi->clu_srch_ptr is invalid (%u)\n",
|
|
Kmods SIG |
50e2b3 |
- sbi->clu_srch_ptr);
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "sbi->clu_srch_ptr is invalid (%u)\n",
|
|
Kmods SIG |
50e2b3 |
+ sbi->clu_srch_ptr);
|
|
Kmods SIG |
50e2b3 |
sbi->clu_srch_ptr = EXFAT_FIRST_CLUSTER;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
@@ -350,7 +347,7 @@ int exfat_alloc_cluster(struct inode *inode, unsigned int num_alloc,
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
/* check cluster validation */
|
|
Kmods SIG |
50e2b3 |
if (hint_clu < EXFAT_FIRST_CLUSTER && hint_clu >= sbi->num_clusters) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR, "hint_cluster is invalid (%u)\n",
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "hint_cluster is invalid (%u)",
|
|
Kmods SIG |
50e2b3 |
hint_clu);
|
|
Kmods SIG |
50e2b3 |
hint_clu = EXFAT_FIRST_CLUSTER;
|
|
Kmods SIG |
50e2b3 |
if (p_chain->flags == ALLOC_NO_FAT_CHAIN) {
|
|
Kmods SIG |
50e2b3 |
diff --git a/src/misc.c b/src/misc.c
|
|
Kmods SIG |
50e2b3 |
index ebd2cbe3cbc11c2aede3819c414020b9344ec1f9..ce5e8a1b0726c6778db86daebe39c437f23c7fba 100644
|
|
Kmods SIG |
50e2b3 |
--- a/src/misc.c
|
|
Kmods SIG |
50e2b3 |
+++ b/src/misc.c
|
|
Kmods SIG |
50e2b3 |
@@ -32,7 +32,7 @@ void __exfat_fs_error(struct super_block *sb, int report, const char *fmt, ...)
|
|
Kmods SIG |
50e2b3 |
va_start(args, fmt);
|
|
Kmods SIG |
50e2b3 |
vaf.fmt = fmt;
|
|
Kmods SIG |
50e2b3 |
vaf.va = &arg;;
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR, "error, %pV\n", &vaf;;
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "error, %pV", &vaf;;
|
|
Kmods SIG |
50e2b3 |
va_end(args);
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
@@ -41,7 +41,7 @@ void __exfat_fs_error(struct super_block *sb, int report, const char *fmt, ...)
|
|
Kmods SIG |
50e2b3 |
sb->s_id);
|
|
Kmods SIG |
50e2b3 |
} else if (opts->errors == EXFAT_ERRORS_RO && !sb_rdonly(sb)) {
|
|
Kmods SIG |
50e2b3 |
sb->s_flags |= SB_RDONLY;
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR, "Filesystem has been set read-only");
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "Filesystem has been set read-only");
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
diff --git a/src/namei.c b/src/namei.c
|
|
Kmods SIG |
50e2b3 |
index 731da41cabbf7b9dfd38f001fc502573bfd6c078..585b47b2db3da5d208fa1d53da9b18ae3d07c2dd 100644
|
|
Kmods SIG |
50e2b3 |
--- a/src/namei.c
|
|
Kmods SIG |
50e2b3 |
+++ b/src/namei.c
|
|
Kmods SIG |
50e2b3 |
@@ -773,8 +773,8 @@ static struct dentry *exfat_lookup(struct inode *dir, struct dentry *dentry,
|
|
Kmods SIG |
50e2b3 |
if (d_unhashed(alias)) {
|
|
Kmods SIG |
50e2b3 |
WARN_ON(alias->d_name.hash_len !=
|
|
Kmods SIG |
50e2b3 |
dentry->d_name.hash_len);
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_INFO,
|
|
Kmods SIG |
50e2b3 |
- "rehashed a dentry(%p) in read lookup", alias);
|
|
Kmods SIG |
50e2b3 |
+ exfat_info(sb, "rehashed a dentry(%p) in read lookup",
|
|
Kmods SIG |
50e2b3 |
+ alias);
|
|
Kmods SIG |
50e2b3 |
d_drop(dentry);
|
|
Kmods SIG |
50e2b3 |
d_rehash(alias);
|
|
Kmods SIG |
50e2b3 |
} else if (!S_ISDIR(i_mode)) {
|
|
Kmods SIG |
50e2b3 |
@@ -819,7 +819,7 @@ static int exfat_unlink(struct inode *dir, struct dentry *dentry)
|
|
Kmods SIG |
50e2b3 |
exfat_chain_dup(&cdir, &ei->dir);
|
|
Kmods SIG |
50e2b3 |
entry = ei->entry;
|
|
Kmods SIG |
50e2b3 |
if (ei->dir.dir == DIR_DELETED) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR, "abnormal access to deleted dentry");
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "abnormal access to deleted dentry");
|
|
Kmods SIG |
50e2b3 |
err = -ENOENT;
|
|
Kmods SIG |
50e2b3 |
goto unlock;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
@@ -974,7 +974,7 @@ static int exfat_rmdir(struct inode *dir, struct dentry *dentry)
|
|
Kmods SIG |
50e2b3 |
entry = ei->entry;
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
if (ei->dir.dir == DIR_DELETED) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR, "abnormal access to deleted dentry");
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "abnormal access to deleted dentry");
|
|
Kmods SIG |
50e2b3 |
err = -ENOENT;
|
|
Kmods SIG |
50e2b3 |
goto unlock;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
@@ -986,9 +986,8 @@ static int exfat_rmdir(struct inode *dir, struct dentry *dentry)
|
|
Kmods SIG |
50e2b3 |
err = exfat_check_dir_empty(sb, &clu_to_free);
|
|
Kmods SIG |
50e2b3 |
if (err) {
|
|
Kmods SIG |
50e2b3 |
if (err == -EIO)
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR,
|
|
Kmods SIG |
50e2b3 |
- "failed to exfat_check_dir_empty : err(%d)",
|
|
Kmods SIG |
50e2b3 |
- err);
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "failed to exfat_check_dir_empty : err(%d)",
|
|
Kmods SIG |
50e2b3 |
+ err);
|
|
Kmods SIG |
50e2b3 |
goto unlock;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
@@ -1009,9 +1008,7 @@ static int exfat_rmdir(struct inode *dir, struct dentry *dentry)
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
err = exfat_remove_entries(dir, &cdir, entry, 0, num_entries);
|
|
Kmods SIG |
50e2b3 |
if (err) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR,
|
|
Kmods SIG |
50e2b3 |
- "failed to exfat_remove_entries : err(%d)",
|
|
Kmods SIG |
50e2b3 |
- err);
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "failed to exfat_remove_entries : err(%d)", err);
|
|
Kmods SIG |
50e2b3 |
goto unlock;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
ei->dir.dir = DIR_DELETED;
|
|
Kmods SIG |
50e2b3 |
@@ -1240,8 +1237,7 @@ static int __exfat_rename(struct inode *old_parent_inode,
|
|
Kmods SIG |
50e2b3 |
return -EINVAL;
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
if (ei->dir.dir == DIR_DELETED) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR,
|
|
Kmods SIG |
50e2b3 |
- "abnormal access to deleted source dentry");
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "abnormal access to deleted source dentry");
|
|
Kmods SIG |
50e2b3 |
return -ENOENT;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
@@ -1263,8 +1259,7 @@ static int __exfat_rename(struct inode *old_parent_inode,
|
|
Kmods SIG |
50e2b3 |
new_ei = EXFAT_I(new_inode);
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
if (new_ei->dir.dir == DIR_DELETED) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR,
|
|
Kmods SIG |
50e2b3 |
- "abnormal access to deleted target dentry");
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "abnormal access to deleted target dentry");
|
|
Kmods SIG |
50e2b3 |
goto out;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
@@ -1426,8 +1421,7 @@ static int exfat_rename(struct inode *old_dir, struct dentry *old_dentry,
|
|
Kmods SIG |
50e2b3 |
if (S_ISDIR(new_inode->i_mode))
|
|
Kmods SIG |
50e2b3 |
drop_nlink(new_inode);
|
|
Kmods SIG |
50e2b3 |
} else {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_WARNING,
|
|
Kmods SIG |
50e2b3 |
- "abnormal access to an inode dropped");
|
|
Kmods SIG |
50e2b3 |
+ exfat_warn(sb, "abnormal access to an inode dropped");
|
|
Kmods SIG |
50e2b3 |
WARN_ON(new_inode->i_nlink == 0);
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
new_inode->i_ctime = EXFAT_I(new_inode)->i_crtime =
|
|
Kmods SIG |
50e2b3 |
diff --git a/src/nls.c b/src/nls.c
|
|
Kmods SIG |
50e2b3 |
index 6d1c3ae130ff177cec9261510b6f7c4a961f5177..2178786b708b577a385137994a41e078bedcb8b7 100644
|
|
Kmods SIG |
50e2b3 |
--- a/src/nls.c
|
|
Kmods SIG |
50e2b3 |
+++ b/src/nls.c
|
|
Kmods SIG |
50e2b3 |
@@ -503,16 +503,14 @@ static int exfat_utf8_to_utf16(struct super_block *sb,
|
|
Kmods SIG |
50e2b3 |
unilen = utf8s_to_utf16s(p_cstring, len, UTF16_HOST_ENDIAN,
|
|
Kmods SIG |
50e2b3 |
(wchar_t *)uniname, MAX_NAME_LENGTH + 2);
|
|
Kmods SIG |
50e2b3 |
if (unilen < 0) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR,
|
|
Kmods SIG |
50e2b3 |
- "failed to %s (err : %d) nls len : %d",
|
|
Kmods SIG |
50e2b3 |
- __func__, unilen, len);
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "failed to %s (err : %d) nls len : %d",
|
|
Kmods SIG |
50e2b3 |
+ __func__, unilen, len);
|
|
Kmods SIG |
50e2b3 |
return unilen;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
if (unilen > MAX_NAME_LENGTH) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR,
|
|
Kmods SIG |
50e2b3 |
- "failed to %s (estr:ENAMETOOLONG) nls len : %d, unilen : %d > %d",
|
|
Kmods SIG |
50e2b3 |
- __func__, len, unilen, MAX_NAME_LENGTH);
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "failed to %s (estr:ENAMETOOLONG) nls len : %d, unilen : %d > %d",
|
|
Kmods SIG |
50e2b3 |
+ __func__, len, unilen, MAX_NAME_LENGTH);
|
|
Kmods SIG |
50e2b3 |
return -ENAMETOOLONG;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
@@ -687,9 +685,8 @@ static int exfat_load_upcase_table(struct super_block *sb,
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
bh = sb_bread(sb, sector);
|
|
Kmods SIG |
50e2b3 |
if (!bh) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR,
|
|
Kmods SIG |
50e2b3 |
- "failed to read sector(0x%llx)\n",
|
|
Kmods SIG |
50e2b3 |
- (unsigned long long)sector);
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "failed to read sector(0x%llx)\n",
|
|
Kmods SIG |
50e2b3 |
+ (unsigned long long)sector);
|
|
Kmods SIG |
50e2b3 |
ret = -EIO;
|
|
Kmods SIG |
50e2b3 |
goto free_table;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
@@ -722,9 +719,8 @@ static int exfat_load_upcase_table(struct super_block *sb,
|
|
Kmods SIG |
50e2b3 |
if (index >= 0xFFFF && utbl_checksum == checksum)
|
|
Kmods SIG |
50e2b3 |
return 0;
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR,
|
|
Kmods SIG |
50e2b3 |
- "failed to load upcase table (idx : 0x%08x, chksum : 0x%08x, utbl_chksum : 0x%08x)\n",
|
|
Kmods SIG |
50e2b3 |
- index, checksum, utbl_checksum);
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "failed to load upcase table (idx : 0x%08x, chksum : 0x%08x, utbl_chksum : 0x%08x)",
|
|
Kmods SIG |
50e2b3 |
+ index, checksum, utbl_checksum);
|
|
Kmods SIG |
50e2b3 |
ret = -EINVAL;
|
|
Kmods SIG |
50e2b3 |
free_table:
|
|
Kmods SIG |
50e2b3 |
exfat_free_upcase_table(sbi);
|
|
Kmods SIG |
50e2b3 |
diff --git a/src/super.c b/src/super.c
|
|
Kmods SIG |
50e2b3 |
index a846ff555656cd876e77ae014b35e192b5ccd183..f9aa1e5dc2381a4f9e4f9dc6f3d61dc525f1095c 100644
|
|
Kmods SIG |
50e2b3 |
--- a/src/super.c
|
|
Kmods SIG |
50e2b3 |
+++ b/src/super.c
|
|
Kmods SIG |
50e2b3 |
@@ -376,15 +376,13 @@ static struct pbr *exfat_read_pbr_with_logical_sector(struct super_block *sb)
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
if (!is_power_of_2(logical_sect) ||
|
|
Kmods SIG |
50e2b3 |
logical_sect < 512 || logical_sect > 4096) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR, "bogus logical sector size %u",
|
|
Kmods SIG |
50e2b3 |
- logical_sect);
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "bogus logical sector size %u", logical_sect);
|
|
Kmods SIG |
50e2b3 |
return NULL;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
if (logical_sect < sb->s_blocksize) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR,
|
|
Kmods SIG |
50e2b3 |
- "logical sector size too small for device (logical sector size = %u)",
|
|
Kmods SIG |
50e2b3 |
- logical_sect);
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "logical sector size too small for device (logical sector size = %u)",
|
|
Kmods SIG |
50e2b3 |
+ logical_sect);
|
|
Kmods SIG |
50e2b3 |
return NULL;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
@@ -393,15 +391,14 @@ static struct pbr *exfat_read_pbr_with_logical_sector(struct super_block *sb)
|
|
Kmods SIG |
50e2b3 |
sbi->pbr_bh = NULL;
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
if (!sb_set_blocksize(sb, logical_sect)) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR,
|
|
Kmods SIG |
50e2b3 |
- "unable to set blocksize %u", logical_sect);
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "unable to set blocksize %u",
|
|
Kmods SIG |
50e2b3 |
+ logical_sect);
|
|
Kmods SIG |
50e2b3 |
return NULL;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
sbi->pbr_bh = sb_bread(sb, 0);
|
|
Kmods SIG |
50e2b3 |
if (!sbi->pbr_bh) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR,
|
|
Kmods SIG |
50e2b3 |
- "unable to read boot sector (logical sector size = %lu)",
|
|
Kmods SIG |
50e2b3 |
- sb->s_blocksize);
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "unable to read boot sector (logical sector size = %lu)",
|
|
Kmods SIG |
50e2b3 |
+ sb->s_blocksize);
|
|
Kmods SIG |
50e2b3 |
return NULL;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
@@ -424,7 +421,7 @@ static int __exfat_fill_super(struct super_block *sb)
|
|
Kmods SIG |
50e2b3 |
/* read boot sector */
|
|
Kmods SIG |
50e2b3 |
sbi->pbr_bh = sb_bread(sb, 0);
|
|
Kmods SIG |
50e2b3 |
if (!sbi->pbr_bh) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR, "unable to read boot sector");
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "unable to read boot sector");
|
|
Kmods SIG |
50e2b3 |
return -EIO;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
@@ -433,7 +430,7 @@ static int __exfat_fill_super(struct super_block *sb)
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
/* check the validity of PBR */
|
|
Kmods SIG |
50e2b3 |
if (le16_to_cpu((p_pbr->signature)) != PBR_SIGNATURE) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR, "invalid boot record signature");
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "invalid boot record signature");
|
|
Kmods SIG |
50e2b3 |
ret = -EINVAL;
|
|
Kmods SIG |
50e2b3 |
goto free_bh;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
@@ -458,7 +455,7 @@ static int __exfat_fill_super(struct super_block *sb)
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
p_bpb = (struct pbr64 *)p_pbr;
|
|
Kmods SIG |
50e2b3 |
if (!p_bpb->bsx.num_fats) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR, "bogus number of FAT structure");
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "bogus number of FAT structure");
|
|
Kmods SIG |
50e2b3 |
ret = -EINVAL;
|
|
Kmods SIG |
50e2b3 |
goto free_bh;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
@@ -488,8 +485,7 @@ static int __exfat_fill_super(struct super_block *sb)
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
if (le16_to_cpu(p_bpb->bsx.vol_flags) & VOL_DIRTY) {
|
|
Kmods SIG |
50e2b3 |
sbi->vol_flag |= VOL_DIRTY;
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_WARNING,
|
|
Kmods SIG |
50e2b3 |
- "Volume was not properly unmounted. Some data may be corrupt. Please run fsck.");
|
|
Kmods SIG |
50e2b3 |
+ exfat_warn(sb, "Volume was not properly unmounted. Some data may be corrupt. Please run fsck.");
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
/* exFAT file size is limited by a disk volume size */
|
|
Kmods SIG |
50e2b3 |
@@ -498,19 +494,19 @@ static int __exfat_fill_super(struct super_block *sb)
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
ret = exfat_create_upcase_table(sb);
|
|
Kmods SIG |
50e2b3 |
if (ret) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR, "failed to load upcase table");
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "failed to load upcase table");
|
|
Kmods SIG |
50e2b3 |
goto free_bh;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
ret = exfat_load_bitmap(sb);
|
|
Kmods SIG |
50e2b3 |
if (ret) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR, "failed to load alloc-bitmap");
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "failed to load alloc-bitmap");
|
|
Kmods SIG |
50e2b3 |
goto free_upcase_table;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
ret = exfat_count_used_clusters(sb, &sbi->used_clusters);
|
|
Kmods SIG |
50e2b3 |
if (ret) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR, "failed to scan clusters");
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "failed to scan clusters");
|
|
Kmods SIG |
50e2b3 |
goto free_alloc_bitmap;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
@@ -539,8 +535,7 @@ static int exfat_fill_super(struct super_block *sb, struct fs_context *fc)
|
|
Kmods SIG |
50e2b3 |
struct request_queue *q = bdev_get_queue(sb->s_bdev);
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
if (!blk_queue_discard(q)) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_WARNING,
|
|
Kmods SIG |
50e2b3 |
- "mounting with \"discard\" option, but the device does not support discard");
|
|
Kmods SIG |
50e2b3 |
+ exfat_warn(sb, "mounting with \"discard\" option, but the device does not support discard");
|
|
Kmods SIG |
50e2b3 |
opts->discard = 0;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
@@ -555,7 +550,7 @@ static int exfat_fill_super(struct super_block *sb, struct fs_context *fc)
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
err = __exfat_fill_super(sb);
|
|
Kmods SIG |
50e2b3 |
if (err) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR, "failed to recognize exfat type");
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "failed to recognize exfat type");
|
|
Kmods SIG |
50e2b3 |
goto check_nls_io;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
@@ -567,8 +562,8 @@ static int exfat_fill_super(struct super_block *sb, struct fs_context *fc)
|
|
Kmods SIG |
50e2b3 |
else {
|
|
Kmods SIG |
50e2b3 |
sbi->nls_io = load_nls(sbi->options.iocharset);
|
|
Kmods SIG |
50e2b3 |
if (!sbi->nls_io) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR, "IO charset %s not found",
|
|
Kmods SIG |
50e2b3 |
- sbi->options.iocharset);
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "IO charset %s not found",
|
|
Kmods SIG |
50e2b3 |
+ sbi->options.iocharset);
|
|
Kmods SIG |
50e2b3 |
err = -EINVAL;
|
|
Kmods SIG |
50e2b3 |
goto free_table;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
@@ -581,7 +576,7 @@ static int exfat_fill_super(struct super_block *sb, struct fs_context *fc)
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
root_inode = new_inode(sb);
|
|
Kmods SIG |
50e2b3 |
if (!root_inode) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR, "failed to allocate root inode.");
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "failed to allocate root inode");
|
|
Kmods SIG |
50e2b3 |
err = -ENOMEM;
|
|
Kmods SIG |
50e2b3 |
goto free_table;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
@@ -590,7 +585,7 @@ static int exfat_fill_super(struct super_block *sb, struct fs_context *fc)
|
|
Kmods SIG |
50e2b3 |
inode_set_iversion(root_inode, 1);
|
|
Kmods SIG |
50e2b3 |
err = exfat_read_root(root_inode);
|
|
Kmods SIG |
50e2b3 |
if (err) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR, "failed to initialize root inode.");
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "failed to initialize root inode");
|
|
Kmods SIG |
50e2b3 |
goto put_inode;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
@@ -599,7 +594,7 @@ static int exfat_fill_super(struct super_block *sb, struct fs_context *fc)
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
sb->s_root = d_make_root(root_inode);
|
|
Kmods SIG |
50e2b3 |
if (!sb->s_root) {
|
|
Kmods SIG |
50e2b3 |
- exfat_msg(sb, KERN_ERR, "failed to get the root dentry");
|
|
Kmods SIG |
50e2b3 |
+ exfat_err(sb, "failed to get the root dentry");
|
|
Kmods SIG |
50e2b3 |
err = -ENOMEM;
|
|
Kmods SIG |
50e2b3 |
goto put_inode;
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
--
|
|
Kmods SIG |
50e2b3 |
2.31.1
|
|
Kmods SIG |
50e2b3 |
|