Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.16.* fixes #133

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions exfat_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -929,6 +929,9 @@ s32 ffsMoveFile(struct inode *old_parent_inode, FILE_ID_T *fid, struct inode *ne
}

/* check the validity of directory name in the given new pathname */
if (strlen(new_path) >= MAX_NAME_LENGTH)
return FFS_NAMETOOLONG;

ret = resolve_path(new_parent_inode, new_path, &newdir, &uni_name);
if (ret)
return ret;
Expand Down Expand Up @@ -2107,6 +2110,9 @@ s32 exfat_count_used_clusters(struct super_block *sb)
}
}

if ((p_fs->num_clusters - 2) < (s32)count)
count = p_fs->num_clusters - 2;

return count;
} /* end of exfat_count_used_clusters */

Expand Down Expand Up @@ -5057,8 +5063,10 @@ s32 sector_read(struct super_block *sb, sector_t sec, struct buffer_head **bh, s

if (!p_fs->dev_ejected) {
ret = bdev_read(sb, sec, bh, 1, read);
if (ret != FFS_SUCCESS)
if (ret != FFS_SUCCESS) {
fs_error(sb);
p_fs->dev_ejected = TRUE;
}
}

return ret;
Expand All @@ -5083,8 +5091,10 @@ s32 sector_write(struct super_block *sb, sector_t sec, struct buffer_head *bh, s

if (!p_fs->dev_ejected) {
ret = bdev_write(sb, sec, bh, 1, sync);
if (ret != FFS_SUCCESS)
if (ret != FFS_SUCCESS) {
fs_error(sb);
p_fs->dev_ejected = TRUE;
}
}

return ret;
Expand All @@ -5104,8 +5114,10 @@ s32 multi_sector_read(struct super_block *sb, sector_t sec, struct buffer_head *

if (!p_fs->dev_ejected) {
ret = bdev_read(sb, sec, bh, num_secs, read);
if (ret != FFS_SUCCESS)
if (ret != FFS_SUCCESS) {
fs_error(sb);
p_fs->dev_ejected = TRUE;
}
}

return ret;
Expand All @@ -5130,8 +5142,10 @@ s32 multi_sector_write(struct super_block *sb, sector_t sec, struct buffer_head

if (!p_fs->dev_ejected) {
ret = bdev_write(sb, sec, bh, num_secs, sync);
if (ret != FFS_SUCCESS)
if (ret != FFS_SUCCESS) {
fs_error(sb);
p_fs->dev_ejected = TRUE;
}
}

return ret;
Expand Down
9 changes: 9 additions & 0 deletions exfat_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -2137,6 +2137,10 @@ static int exfat_statfs(struct dentry *dentry, struct kstatfs *buf)
static int exfat_remount(struct super_block *sb, int *flags, char *data)
{
*flags |= MS_NODIRATIME;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,00)
sync_filesystem(sb);
#endif

return 0;
}

Expand All @@ -2150,6 +2154,7 @@ static int exfat_show_options(struct seq_file *m, struct vfsmount *mnt)
struct exfat_sb_info *sbi = EXFAT_SB(mnt->mnt_sb);
#endif
struct exfat_mount_options *opts = &sbi->options;
FS_INFO_T *p_fs = &(sbi->fs_info);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
if (__kuid_val(opts->fs_uid))
seq_printf(m, ",uid=%u", __kuid_val(opts->fs_uid));
Expand Down Expand Up @@ -2180,6 +2185,9 @@ static int exfat_show_options(struct seq_file *m, struct vfsmount *mnt)
if (opts->discard)
seq_printf(m, ",discard");
#endif
if (p_fs->dev_ejected)
seq_puts(m, ",ejected");

return 0;
}

Expand Down Expand Up @@ -2702,6 +2710,7 @@ module_exit(exit_exfat);

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("exFAT Filesystem Driver");
MODULE_VERSION(EXFAT_VERSION);
#ifdef MODULE_ALIAS_FS
#if defined(CONFIG_MACH_LGE) || defined(CONFIG_HTC_BATT_CORE)
MODULE_ALIAS_FS("texfat");
Expand Down