Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'exfat-for-6.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat

Pull exfat updates from Namjae Jeon:

- Add support for FS_IOC_{GET,SET}FSLABEL ioctl

- Two small clean-up patches

- Optimizes allocation bitmap loading time on large partitions with
small cluster sizes

- Allow changes for discard, zero_size_dir, and errors options via
remount

- Validate that the clusters used for the allocation bitmap are
correctly marked as in-use during mount, preventing potential data
corruption from reallocating the bitmap's own space

- Uses ratelimit to avoid too many error prints on I/O error path

* tag 'exfat-for-6.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat:
exfat: Add support for FS_IOC_{GET,SET}FSLABEL
exfat: combine iocharset and utf8 option setup
exfat: support modifying mount options via remount
exfat: optimize allocation bitmap loading time
exfat: Remove unnecessary parentheses
exfat: drop redundant conversion to bool
exfat: validate cluster allocation bits of the allocation bitmap
exfat: limit log print for IO error

+360 -35
+73 -12
fs/exfat/balloc.c
··· 7 7 #include <linux/slab.h> 8 8 #include <linux/bitmap.h> 9 9 #include <linux/buffer_head.h> 10 + #include <linux/backing-dev.h> 10 11 11 12 #include "exfat_raw.h" 12 13 #include "exfat_fs.h" ··· 27 26 /* 28 27 * Allocation Bitmap Management Functions 29 28 */ 29 + static bool exfat_test_bitmap_range(struct super_block *sb, unsigned int clu, 30 + unsigned int count) 31 + { 32 + struct exfat_sb_info *sbi = EXFAT_SB(sb); 33 + unsigned int start = clu; 34 + unsigned int end = clu + count; 35 + unsigned int ent_idx, i, b; 36 + unsigned int bit_offset, bits_to_check; 37 + __le_long *bitmap_le; 38 + unsigned long mask, word; 39 + 40 + if (!is_valid_cluster(sbi, start) || !is_valid_cluster(sbi, end - 1)) 41 + return false; 42 + 43 + while (start < end) { 44 + ent_idx = CLUSTER_TO_BITMAP_ENT(start); 45 + i = BITMAP_OFFSET_SECTOR_INDEX(sb, ent_idx); 46 + b = BITMAP_OFFSET_BIT_IN_SECTOR(sb, ent_idx); 47 + 48 + bitmap_le = (__le_long *)sbi->vol_amap[i]->b_data; 49 + 50 + /* Calculate how many bits we can check in the current word */ 51 + bit_offset = b % BITS_PER_LONG; 52 + bits_to_check = min(end - start, 53 + (unsigned int)(BITS_PER_LONG - bit_offset)); 54 + 55 + /* Create a bitmask for the range of bits to check */ 56 + if (bits_to_check >= BITS_PER_LONG) 57 + mask = ~0UL; 58 + else 59 + mask = ((1UL << bits_to_check) - 1) << bit_offset; 60 + word = lel_to_cpu(bitmap_le[b / BITS_PER_LONG]); 61 + 62 + /* Check if all bits in the mask are set */ 63 + if ((word & mask) != mask) 64 + return false; 65 + 66 + start += bits_to_check; 67 + } 68 + 69 + return true; 70 + } 71 + 30 72 static int exfat_allocate_bitmap(struct super_block *sb, 31 73 struct exfat_dentry *ep) 32 74 { 33 75 struct exfat_sb_info *sbi = EXFAT_SB(sb); 76 + struct blk_plug plug; 34 77 long long map_size; 35 - unsigned int i, need_map_size; 78 + unsigned int i, j, need_map_size; 36 79 sector_t sector; 80 + unsigned int max_ra_count; 37 81 38 82 sbi->map_clu = le32_to_cpu(ep->dentry.bitmap.start_clu); 39 83 map_size = le64_to_cpu(ep->dentry.bitmap.size); ··· 102 56 return -ENOMEM; 103 57 104 58 sector = exfat_cluster_to_sector(sbi, sbi->map_clu); 59 + max_ra_count = min(sb->s_bdi->ra_pages, sb->s_bdi->io_pages) << 60 + (PAGE_SHIFT - sb->s_blocksize_bits); 105 61 for (i = 0; i < sbi->map_sectors; i++) { 106 - sbi->vol_amap[i] = sb_bread(sb, sector + i); 107 - if (!sbi->vol_amap[i]) { 108 - /* release all buffers and free vol_amap */ 109 - int j = 0; 110 - 111 - while (j < i) 112 - brelse(sbi->vol_amap[j++]); 113 - 114 - kvfree(sbi->vol_amap); 115 - sbi->vol_amap = NULL; 116 - return -EIO; 62 + /* Trigger the next readahead in advance. */ 63 + if (0 == (i % max_ra_count)) { 64 + blk_start_plug(&plug); 65 + for (j = i; j < min(max_ra_count, sbi->map_sectors - i) + i; j++) 66 + sb_breadahead(sb, sector + j); 67 + blk_finish_plug(&plug); 117 68 } 69 + 70 + sbi->vol_amap[i] = sb_bread(sb, sector + i); 71 + if (!sbi->vol_amap[i]) 72 + goto err_out; 118 73 } 119 74 75 + if (exfat_test_bitmap_range(sb, sbi->map_clu, 76 + EXFAT_B_TO_CLU_ROUND_UP(map_size, sbi)) == false) 77 + goto err_out; 78 + 120 79 return 0; 80 + 81 + err_out: 82 + j = 0; 83 + /* release all buffers and free vol_amap */ 84 + while (j < i) 85 + brelse(sbi->vol_amap[j++]); 86 + 87 + kvfree(sbi->vol_amap); 88 + sbi->vol_amap = NULL; 89 + return -EIO; 121 90 } 122 91 123 92 int exfat_load_bitmap(struct super_block *sb)
+160
fs/exfat/dir.c
··· 1244 1244 1245 1245 return count; 1246 1246 } 1247 + 1248 + static int exfat_get_volume_label_dentry(struct super_block *sb, 1249 + struct exfat_entry_set_cache *es) 1250 + { 1251 + int i; 1252 + int dentry = 0; 1253 + unsigned int type; 1254 + struct exfat_sb_info *sbi = EXFAT_SB(sb); 1255 + struct exfat_hint_femp hint_femp; 1256 + struct exfat_inode_info *ei = EXFAT_I(sb->s_root->d_inode); 1257 + struct exfat_chain clu; 1258 + struct exfat_dentry *ep; 1259 + struct buffer_head *bh; 1260 + 1261 + hint_femp.eidx = EXFAT_HINT_NONE; 1262 + exfat_chain_set(&clu, sbi->root_dir, 0, ALLOC_FAT_CHAIN); 1263 + 1264 + while (clu.dir != EXFAT_EOF_CLUSTER) { 1265 + for (i = 0; i < sbi->dentries_per_clu; i++, dentry++) { 1266 + ep = exfat_get_dentry(sb, &clu, i, &bh); 1267 + if (!ep) 1268 + return -EIO; 1269 + 1270 + type = exfat_get_entry_type(ep); 1271 + if (hint_femp.eidx == EXFAT_HINT_NONE) { 1272 + if (type == TYPE_DELETED || type == TYPE_UNUSED) { 1273 + hint_femp.cur = clu; 1274 + hint_femp.eidx = dentry; 1275 + hint_femp.count = 1; 1276 + } 1277 + } 1278 + 1279 + if (type == TYPE_UNUSED) { 1280 + brelse(bh); 1281 + goto not_found; 1282 + } 1283 + 1284 + if (type != TYPE_VOLUME) { 1285 + brelse(bh); 1286 + continue; 1287 + } 1288 + 1289 + memset(es, 0, sizeof(*es)); 1290 + es->sb = sb; 1291 + es->bh = es->__bh; 1292 + es->bh[0] = bh; 1293 + es->num_bh = 1; 1294 + es->start_off = EXFAT_DEN_TO_B(i) % sb->s_blocksize; 1295 + 1296 + return 0; 1297 + } 1298 + 1299 + if (exfat_get_next_cluster(sb, &(clu.dir))) 1300 + return -EIO; 1301 + } 1302 + 1303 + not_found: 1304 + if (hint_femp.eidx == EXFAT_HINT_NONE) { 1305 + hint_femp.cur.dir = EXFAT_EOF_CLUSTER; 1306 + hint_femp.eidx = dentry; 1307 + hint_femp.count = 0; 1308 + } 1309 + 1310 + ei->hint_femp = hint_femp; 1311 + 1312 + return -ENOENT; 1313 + } 1314 + 1315 + int exfat_read_volume_label(struct super_block *sb, struct exfat_uni_name *label_out) 1316 + { 1317 + int ret, i; 1318 + struct exfat_sb_info *sbi = EXFAT_SB(sb); 1319 + struct exfat_entry_set_cache es; 1320 + struct exfat_dentry *ep; 1321 + 1322 + mutex_lock(&sbi->s_lock); 1323 + 1324 + memset(label_out, 0, sizeof(*label_out)); 1325 + ret = exfat_get_volume_label_dentry(sb, &es); 1326 + if (ret < 0) { 1327 + /* 1328 + * ENOENT signifies that a volume label dentry doesn't exist 1329 + * We will treat this as an empty volume label and not fail. 1330 + */ 1331 + if (ret == -ENOENT) 1332 + ret = 0; 1333 + 1334 + goto unlock; 1335 + } 1336 + 1337 + ep = exfat_get_dentry_cached(&es, 0); 1338 + label_out->name_len = ep->dentry.volume_label.char_count; 1339 + if (label_out->name_len > EXFAT_VOLUME_LABEL_LEN) { 1340 + ret = -EIO; 1341 + exfat_put_dentry_set(&es, false); 1342 + goto unlock; 1343 + } 1344 + 1345 + for (i = 0; i < label_out->name_len; i++) 1346 + label_out->name[i] = le16_to_cpu(ep->dentry.volume_label.volume_label[i]); 1347 + 1348 + exfat_put_dentry_set(&es, false); 1349 + unlock: 1350 + mutex_unlock(&sbi->s_lock); 1351 + return ret; 1352 + } 1353 + 1354 + int exfat_write_volume_label(struct super_block *sb, 1355 + struct exfat_uni_name *label) 1356 + { 1357 + int ret, i; 1358 + struct exfat_sb_info *sbi = EXFAT_SB(sb); 1359 + struct inode *root_inode = sb->s_root->d_inode; 1360 + struct exfat_entry_set_cache es; 1361 + struct exfat_chain clu; 1362 + struct exfat_dentry *ep; 1363 + 1364 + if (label->name_len > EXFAT_VOLUME_LABEL_LEN) 1365 + return -EINVAL; 1366 + 1367 + mutex_lock(&sbi->s_lock); 1368 + 1369 + ret = exfat_get_volume_label_dentry(sb, &es); 1370 + if (ret == -ENOENT) { 1371 + if (label->name_len == 0) { 1372 + /* No volume label dentry, no need to clear */ 1373 + ret = 0; 1374 + goto unlock; 1375 + } 1376 + 1377 + ret = exfat_find_empty_entry(root_inode, &clu, 1, &es); 1378 + } 1379 + 1380 + if (ret < 0) 1381 + goto unlock; 1382 + 1383 + ep = exfat_get_dentry_cached(&es, 0); 1384 + 1385 + if (label->name_len == 0 && ep->dentry.volume_label.char_count == 0) { 1386 + /* volume label had been cleared */ 1387 + exfat_put_dentry_set(&es, 0); 1388 + goto unlock; 1389 + } 1390 + 1391 + memset(ep, 0, sizeof(*ep)); 1392 + ep->type = EXFAT_VOLUME; 1393 + 1394 + for (i = 0; i < label->name_len; i++) 1395 + ep->dentry.volume_label.volume_label[i] = 1396 + cpu_to_le16(label->name[i]); 1397 + 1398 + ep->dentry.volume_label.char_count = label->name_len; 1399 + es.modified = true; 1400 + 1401 + ret = exfat_put_dentry_set(&es, IS_DIRSYNC(root_inode)); 1402 + 1403 + unlock: 1404 + mutex_unlock(&sbi->s_lock); 1405 + return ret; 1406 + }
+7
fs/exfat/exfat_fs.h
··· 477 477 /* namei.c */ 478 478 extern const struct dentry_operations exfat_dentry_ops; 479 479 extern const struct dentry_operations exfat_utf8_dentry_ops; 480 + int exfat_find_empty_entry(struct inode *inode, 481 + struct exfat_chain *p_dir, int num_entries, 482 + struct exfat_entry_set_cache *es); 480 483 481 484 /* cache.c */ 482 485 int exfat_cache_init(void); ··· 520 517 unsigned int num_entries); 521 518 int exfat_put_dentry_set(struct exfat_entry_set_cache *es, int sync); 522 519 int exfat_count_dir_entries(struct super_block *sb, struct exfat_chain *p_dir); 520 + int exfat_read_volume_label(struct super_block *sb, 521 + struct exfat_uni_name *label_out); 522 + int exfat_write_volume_label(struct super_block *sb, 523 + struct exfat_uni_name *label); 523 524 524 525 /* inode.c */ 525 526 extern const struct inode_operations exfat_file_inode_operations;
+6
fs/exfat/exfat_raw.h
··· 80 80 #define BOOTSEC_OLDBPB_LEN 53 81 81 82 82 #define EXFAT_FILE_NAME_LEN 15 83 + #define EXFAT_VOLUME_LABEL_LEN 11 83 84 84 85 #define EXFAT_MIN_SECT_SIZE_BITS 9 85 86 #define EXFAT_MAX_SECT_SIZE_BITS 12 ··· 160 159 __le32 start_clu; 161 160 __le64 size; 162 161 } __packed upcase; /* up-case table directory entry */ 162 + struct { 163 + __u8 char_count; 164 + __le16 volume_label[EXFAT_VOLUME_LABEL_LEN]; 165 + __u8 reserved[8]; 166 + } __packed volume_label; /* volume label directory entry */ 163 167 struct { 164 168 __u8 flags; 165 169 __u8 vendor_guid[16];
+6 -5
fs/exfat/fatent.c
··· 89 89 int err; 90 90 91 91 if (!is_valid_cluster(sbi, loc)) { 92 - exfat_fs_error(sb, "invalid access to FAT (entry 0x%08x)", 92 + exfat_fs_error_ratelimit(sb, 93 + "invalid access to FAT (entry 0x%08x)", 93 94 loc); 94 95 return -EIO; 95 96 } 96 97 97 98 err = __exfat_ent_get(sb, loc, content); 98 99 if (err) { 99 - exfat_fs_error(sb, 100 + exfat_fs_error_ratelimit(sb, 100 101 "failed to access to FAT (entry 0x%08x, err:%d)", 101 102 loc, err); 102 103 return err; 103 104 } 104 105 105 106 if (*content == EXFAT_FREE_CLUSTER) { 106 - exfat_fs_error(sb, 107 + exfat_fs_error_ratelimit(sb, 107 108 "invalid access to FAT free cluster (entry 0x%08x)", 108 109 loc); 109 110 return -EIO; 110 111 } 111 112 112 113 if (*content == EXFAT_BAD_CLUSTER) { 113 - exfat_fs_error(sb, 114 + exfat_fs_error_ratelimit(sb, 114 115 "invalid access to FAT bad cluster (entry 0x%08x)", 115 116 loc); 116 117 return -EIO; 117 118 } 118 119 119 120 if (*content != EXFAT_EOF_CLUSTER && !is_valid_cluster(sbi, *content)) { 120 - exfat_fs_error(sb, 121 + exfat_fs_error_ratelimit(sb, 121 122 "invalid access to FAT (entry 0x%08x) bogus content (0x%08x)", 122 123 loc, *content); 123 124 return -EIO;
+52
fs/exfat/file.c
··· 486 486 return exfat_force_shutdown(sb, flags); 487 487 } 488 488 489 + static int exfat_ioctl_get_volume_label(struct super_block *sb, unsigned long arg) 490 + { 491 + int ret; 492 + char label[FSLABEL_MAX] = {0}; 493 + struct exfat_uni_name uniname; 494 + 495 + ret = exfat_read_volume_label(sb, &uniname); 496 + if (ret < 0) 497 + return ret; 498 + 499 + ret = exfat_utf16_to_nls(sb, &uniname, label, uniname.name_len); 500 + if (ret < 0) 501 + return ret; 502 + 503 + if (copy_to_user((char __user *)arg, label, ret + 1)) 504 + return -EFAULT; 505 + 506 + return 0; 507 + } 508 + 509 + static int exfat_ioctl_set_volume_label(struct super_block *sb, 510 + unsigned long arg) 511 + { 512 + int ret = 0, lossy; 513 + char label[FSLABEL_MAX]; 514 + struct exfat_uni_name uniname; 515 + 516 + if (!capable(CAP_SYS_ADMIN)) 517 + return -EPERM; 518 + 519 + if (copy_from_user(label, (char __user *)arg, FSLABEL_MAX)) 520 + return -EFAULT; 521 + 522 + memset(&uniname, 0, sizeof(uniname)); 523 + if (label[0]) { 524 + ret = exfat_nls_to_utf16(sb, label, FSLABEL_MAX, 525 + &uniname, &lossy); 526 + if (ret < 0) 527 + return ret; 528 + else if (lossy & NLS_NAME_LOSSY) 529 + return -EINVAL; 530 + } 531 + 532 + uniname.name_len = ret; 533 + 534 + return exfat_write_volume_label(sb, &uniname); 535 + } 536 + 489 537 long exfat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 490 538 { 491 539 struct inode *inode = file_inode(filp); ··· 548 500 return exfat_ioctl_shutdown(inode->i_sb, arg); 549 501 case FITRIM: 550 502 return exfat_ioctl_fitrim(inode, arg); 503 + case FS_IOC_GETFSLABEL: 504 + return exfat_ioctl_get_volume_label(inode->i_sb, arg); 505 + case FS_IOC_SETFSLABEL: 506 + return exfat_ioctl_set_volume_label(inode->i_sb, arg); 551 507 default: 552 508 return -ENOTTY; 553 509 }
+1 -1
fs/exfat/inode.c
··· 25 25 struct super_block *sb = inode->i_sb; 26 26 struct exfat_sb_info *sbi = EXFAT_SB(sb); 27 27 struct exfat_inode_info *ei = EXFAT_I(inode); 28 - bool is_dir = (ei->type == TYPE_DIR) ? true : false; 28 + bool is_dir = (ei->type == TYPE_DIR); 29 29 struct timespec64 ts; 30 30 31 31 if (inode->i_ino == EXFAT_ROOT_INO)
+1 -1
fs/exfat/namei.c
··· 300 300 * the directory entry index in p_dir is returned on succeeds 301 301 * -error code is returned on failure 302 302 */ 303 - static int exfat_find_empty_entry(struct inode *inode, 303 + int exfat_find_empty_entry(struct inode *inode, 304 304 struct exfat_chain *p_dir, int num_entries, 305 305 struct exfat_entry_set_cache *es) 306 306 {
+1 -1
fs/exfat/nls.c
··· 789 789 return ret; 790 790 } 791 791 792 - if (exfat_get_next_cluster(sb, &(clu.dir))) 792 + if (exfat_get_next_cluster(sb, &clu.dir)) 793 793 return -EIO; 794 794 } 795 795
+53 -15
fs/exfat/super.c
··· 31 31 kfree(sbi->options.iocharset); 32 32 } 33 33 34 + static void exfat_set_iocharset(struct exfat_mount_options *opts, 35 + char *iocharset) 36 + { 37 + opts->iocharset = iocharset; 38 + if (!strcmp(opts->iocharset, "utf8")) 39 + opts->utf8 = 1; 40 + else 41 + opts->utf8 = 0; 42 + } 43 + 34 44 static void exfat_put_super(struct super_block *sb) 35 45 { 36 46 struct exfat_sb_info *sbi = EXFAT_SB(sb); ··· 253 243 fsparam_u32oct("allow_utime", Opt_allow_utime), 254 244 fsparam_string("iocharset", Opt_charset), 255 245 fsparam_enum("errors", Opt_errors, exfat_param_enums), 256 - fsparam_flag("discard", Opt_discard), 246 + fsparam_flag_no("discard", Opt_discard), 257 247 fsparam_flag("keep_last_dots", Opt_keep_last_dots), 258 248 fsparam_flag("sys_tz", Opt_sys_tz), 259 249 fsparam_s32("time_offset", Opt_time_offset), 260 - fsparam_flag("zero_size_dir", Opt_zero_size_dir), 250 + fsparam_flag_no("zero_size_dir", Opt_zero_size_dir), 261 251 __fsparam(NULL, "utf8", Opt_utf8, fs_param_deprecated, 262 252 NULL), 263 253 __fsparam(NULL, "debug", Opt_debug, fs_param_deprecated, ··· 302 292 break; 303 293 case Opt_charset: 304 294 exfat_free_iocharset(sbi); 305 - opts->iocharset = param->string; 295 + exfat_set_iocharset(opts, param->string); 306 296 param->string = NULL; 307 297 break; 308 298 case Opt_errors: 309 299 opts->errors = result.uint_32; 310 300 break; 311 301 case Opt_discard: 312 - opts->discard = 1; 302 + opts->discard = !result.negated; 313 303 break; 314 304 case Opt_keep_last_dots: 315 305 opts->keep_last_dots = 1; ··· 327 317 opts->time_offset = result.int_32; 328 318 break; 329 319 case Opt_zero_size_dir: 330 - opts->zero_size_dir = true; 320 + opts->zero_size_dir = !result.negated; 331 321 break; 332 322 case Opt_utf8: 333 323 case Opt_debug: ··· 674 664 /* set up enough so that it can read an inode */ 675 665 exfat_hash_init(sb); 676 666 677 - if (!strcmp(sbi->options.iocharset, "utf8")) 678 - opts->utf8 = 1; 667 + if (sbi->options.utf8) 668 + set_default_d_op(sb, &exfat_utf8_dentry_ops); 679 669 else { 680 670 sbi->nls_io = load_nls(sbi->options.iocharset); 681 671 if (!sbi->nls_io) { ··· 684 674 err = -EINVAL; 685 675 goto free_table; 686 676 } 687 - } 688 - 689 - if (sbi->options.utf8) 690 - set_default_d_op(sb, &exfat_utf8_dentry_ops); 691 - else 692 677 set_default_d_op(sb, &exfat_dentry_ops); 678 + } 693 679 694 680 root_inode = new_inode(sb); 695 681 if (!root_inode) { ··· 748 742 static int exfat_reconfigure(struct fs_context *fc) 749 743 { 750 744 struct super_block *sb = fc->root->d_sb; 745 + struct exfat_sb_info *remount_sbi = fc->s_fs_info; 746 + struct exfat_sb_info *sbi = EXFAT_SB(sb); 747 + struct exfat_mount_options *new_opts = &remount_sbi->options; 748 + struct exfat_mount_options *cur_opts = &sbi->options; 749 + 751 750 fc->sb_flags |= SB_NODIRATIME; 752 751 753 752 sync_filesystem(sb); 754 - mutex_lock(&EXFAT_SB(sb)->s_lock); 753 + mutex_lock(&sbi->s_lock); 755 754 exfat_clear_volume_dirty(sb); 756 - mutex_unlock(&EXFAT_SB(sb)->s_lock); 755 + mutex_unlock(&sbi->s_lock); 756 + 757 + if (new_opts->allow_utime == (unsigned short)-1) 758 + new_opts->allow_utime = ~new_opts->fs_dmask & 0022; 759 + 760 + /* 761 + * Since the old settings of these mount options are cached in 762 + * inodes or dentries, they cannot be modified dynamically. 763 + */ 764 + if (strcmp(new_opts->iocharset, cur_opts->iocharset) || 765 + new_opts->keep_last_dots != cur_opts->keep_last_dots || 766 + new_opts->sys_tz != cur_opts->sys_tz || 767 + new_opts->time_offset != cur_opts->time_offset || 768 + !uid_eq(new_opts->fs_uid, cur_opts->fs_uid) || 769 + !gid_eq(new_opts->fs_gid, cur_opts->fs_gid) || 770 + new_opts->fs_fmask != cur_opts->fs_fmask || 771 + new_opts->fs_dmask != cur_opts->fs_dmask || 772 + new_opts->allow_utime != cur_opts->allow_utime) 773 + return -EINVAL; 774 + 775 + if (new_opts->discard != cur_opts->discard && 776 + new_opts->discard && 777 + !bdev_max_discard_sectors(sb->s_bdev)) { 778 + exfat_warn(sb, "remounting with \"discard\" option, but the device does not support discard"); 779 + return -EINVAL; 780 + } 781 + 782 + swap(*cur_opts, *new_opts); 757 783 758 784 return 0; 759 785 } ··· 815 777 sbi->options.fs_fmask = current->fs->umask; 816 778 sbi->options.fs_dmask = current->fs->umask; 817 779 sbi->options.allow_utime = -1; 818 - sbi->options.iocharset = exfat_default_iocharset; 819 780 sbi->options.errors = EXFAT_ERRORS_RO; 781 + exfat_set_iocharset(&sbi->options, exfat_default_iocharset); 820 782 821 783 fc->s_fs_info = sbi; 822 784 fc->ops = &exfat_context_ops;