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 'fs_for_v6.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs

Pull isofs, udf, quota, ext2, and reiserfs updates from Jan Kara:

- convert isofs to the new mount API

- cleanup isofs Makefile

- udf conversion to folios

- some other small udf cleanups and fixes

- ext2 cleanups

- removal of reiserfs .writepage method

- update reiserfs README file

* tag 'fs_for_v6.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
isofs: Use *-y instead of *-objs in Makefile
ext2: Remove LEGACY_DIRECT_IO dependency
isofs: Remove calls to set/clear the error flag
ext2: Remove call to folio_set_error()
udf: Use a folio in udf_write_end()
udf: Convert udf_page_mkwrite() to use a folio
udf: Convert udf_symlink_getattr() to use a folio
udf: Convert udf_adinicb_readpage() to udf_adinicb_read_folio()
udf: Convert udf_expand_file_adinicb() to use a folio
udf: Convert udf_write_begin() to use a folio
udf: Convert udf_symlink_filler() to use a folio
reiserfs: Trim some README bits
quota: fix to propagate error of mark_dquot_dirty() to caller
reiserfs: Convert to writepages
udf: udftime: prevent overflow in udf_disk_stamp_to_time()
ext2: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method
udf: replace deprecated strncpy/strcpy with strscpy
udf: Remove second semicolon
isofs: convert isofs to use the new mount API
fs: quota: use group allocation of per-cpu counters API

+343 -350
-1
fs/ext2/Kconfig
··· 3 3 tristate "Second extended fs support (DEPRECATED)" 4 4 select BUFFER_HEAD 5 5 select FS_IOMAP 6 - select LEGACY_DIRECT_IO 7 6 help 8 7 Ext2 is a standard Linux file system for hard disks. 9 8
-1
fs/ext2/dir.c
··· 175 175 (unsigned long) le32_to_cpu(p->inode)); 176 176 } 177 177 fail: 178 - folio_set_error(folio); 179 178 return false; 180 179 } 181 180
+7 -1
fs/ext2/file.c
··· 302 302 return generic_file_write_iter(iocb, from); 303 303 } 304 304 305 + static int ext2_file_open(struct inode *inode, struct file *filp) 306 + { 307 + filp->f_mode |= FMODE_CAN_ODIRECT; 308 + return dquot_file_open(inode, filp); 309 + } 310 + 305 311 const struct file_operations ext2_file_operations = { 306 312 .llseek = generic_file_llseek, 307 313 .read_iter = ext2_file_read_iter, ··· 317 311 .compat_ioctl = ext2_compat_ioctl, 318 312 #endif 319 313 .mmap = ext2_file_mmap, 320 - .open = dquot_file_open, 314 + .open = ext2_file_open, 321 315 .release = ext2_release_file, 322 316 .fsync = ext2_fsync, 323 317 .get_unmapped_area = thp_get_unmapped_area,
-2
fs/ext2/inode.c
··· 965 965 .write_begin = ext2_write_begin, 966 966 .write_end = ext2_write_end, 967 967 .bmap = ext2_bmap, 968 - .direct_IO = noop_direct_IO, 969 968 .writepages = ext2_writepages, 970 969 .migrate_folio = buffer_migrate_folio, 971 970 .is_partially_uptodate = block_is_partially_uptodate, ··· 973 974 974 975 static const struct address_space_operations ext2_dax_aops = { 975 976 .writepages = ext2_dax_writepages, 976 - .direct_IO = noop_direct_IO, 977 977 .dirty_folio = noop_dirty_folio, 978 978 }; 979 979
+3 -4
fs/isofs/Makefile
··· 5 5 6 6 obj-$(CONFIG_ISO9660_FS) += isofs.o 7 7 8 - isofs-objs-y := namei.o inode.o dir.o util.o rock.o export.o 9 - isofs-objs-$(CONFIG_JOLIET) += joliet.o 10 - isofs-objs-$(CONFIG_ZISOFS) += compress.o 11 - isofs-objs := $(isofs-objs-y) 8 + isofs-y := namei.o inode.o dir.o util.o rock.o export.o 9 + isofs-$(CONFIG_JOLIET) += joliet.o 10 + isofs-$(CONFIG_ZISOFS) += compress.o
-4
fs/isofs/compress.c
··· 346 346 for (i = 0; i < pcount; i++, index++) { 347 347 if (i != full_page) 348 348 pages[i] = grab_cache_page_nowait(mapping, index); 349 - if (pages[i]) 350 - ClearPageError(pages[i]); 351 349 } 352 350 353 351 err = zisofs_fill_pages(inode, full_page, pcount, pages); ··· 354 356 for (i = 0; i < pcount; i++) { 355 357 if (pages[i]) { 356 358 flush_dcache_page(pages[i]); 357 - if (i == full_page && err) 358 - SetPageError(pages[i]); 359 359 unlock_page(pages[i]); 360 360 if (i != full_page) 361 361 put_page(pages[i]);
+237 -230
fs/isofs/inode.c
··· 21 21 #include <linux/ctype.h> 22 22 #include <linux/statfs.h> 23 23 #include <linux/cdrom.h> 24 - #include <linux/parser.h> 25 24 #include <linux/mpage.h> 26 25 #include <linux/user_namespace.h> 27 26 #include <linux/seq_file.h> 28 27 #include <linux/blkdev.h> 28 + #include <linux/fs_context.h> 29 + #include <linux/fs_parser.h> 29 30 30 31 #include "isofs.h" 31 32 #include "zisofs.h" ··· 111 110 kmem_cache_destroy(isofs_inode_cachep); 112 111 } 113 112 114 - static int isofs_remount(struct super_block *sb, int *flags, char *data) 113 + static int isofs_reconfigure(struct fs_context *fc) 115 114 { 116 - sync_filesystem(sb); 117 - if (!(*flags & SB_RDONLY)) 115 + sync_filesystem(fc->root->d_sb); 116 + if (!(fc->sb_flags & SB_RDONLY)) 118 117 return -EROFS; 119 118 return 0; 120 119 } ··· 124 123 .free_inode = isofs_free_inode, 125 124 .put_super = isofs_put_super, 126 125 .statfs = isofs_statfs, 127 - .remount_fs = isofs_remount, 128 126 .show_options = isofs_show_options, 129 127 }; 130 128 ··· 145 145 #endif 146 146 }; 147 147 148 - struct iso9660_options{ 148 + struct isofs_options{ 149 149 unsigned int rock:1; 150 150 unsigned int joliet:1; 151 151 unsigned int cruft:1; ··· 289 289 #endif 290 290 291 291 enum { 292 - Opt_block, Opt_check_r, Opt_check_s, Opt_cruft, Opt_gid, Opt_ignore, 293 - Opt_iocharset, Opt_map_a, Opt_map_n, Opt_map_o, Opt_mode, Opt_nojoliet, 294 - Opt_norock, Opt_sb, Opt_session, Opt_uid, Opt_unhide, Opt_utf8, Opt_err, 295 - Opt_nocompress, Opt_hide, Opt_showassoc, Opt_dmode, Opt_overriderockperm, 292 + Opt_block, Opt_check, Opt_cruft, Opt_gid, Opt_ignore, Opt_iocharset, 293 + Opt_map, Opt_mode, Opt_nojoliet, Opt_norock, Opt_sb, Opt_session, 294 + Opt_uid, Opt_unhide, Opt_utf8, Opt_err, Opt_nocompress, Opt_hide, 295 + Opt_showassoc, Opt_dmode, Opt_overriderockperm, 296 296 }; 297 297 298 - static const match_table_t tokens = { 299 - {Opt_norock, "norock"}, 300 - {Opt_nojoliet, "nojoliet"}, 301 - {Opt_unhide, "unhide"}, 302 - {Opt_hide, "hide"}, 303 - {Opt_showassoc, "showassoc"}, 304 - {Opt_cruft, "cruft"}, 305 - {Opt_utf8, "utf8"}, 306 - {Opt_iocharset, "iocharset=%s"}, 307 - {Opt_map_a, "map=acorn"}, 308 - {Opt_map_a, "map=a"}, 309 - {Opt_map_n, "map=normal"}, 310 - {Opt_map_n, "map=n"}, 311 - {Opt_map_o, "map=off"}, 312 - {Opt_map_o, "map=o"}, 313 - {Opt_session, "session=%u"}, 314 - {Opt_sb, "sbsector=%u"}, 315 - {Opt_check_r, "check=relaxed"}, 316 - {Opt_check_r, "check=r"}, 317 - {Opt_check_s, "check=strict"}, 318 - {Opt_check_s, "check=s"}, 319 - {Opt_uid, "uid=%u"}, 320 - {Opt_gid, "gid=%u"}, 321 - {Opt_mode, "mode=%u"}, 322 - {Opt_dmode, "dmode=%u"}, 323 - {Opt_overriderockperm, "overriderockperm"}, 324 - {Opt_block, "block=%u"}, 325 - {Opt_ignore, "conv=binary"}, 326 - {Opt_ignore, "conv=b"}, 327 - {Opt_ignore, "conv=text"}, 328 - {Opt_ignore, "conv=t"}, 329 - {Opt_ignore, "conv=mtext"}, 330 - {Opt_ignore, "conv=m"}, 331 - {Opt_ignore, "conv=auto"}, 332 - {Opt_ignore, "conv=a"}, 333 - {Opt_nocompress, "nocompress"}, 334 - {Opt_err, NULL} 298 + static const struct constant_table isofs_param_map[] = { 299 + {"acorn", 'a'}, 300 + {"a", 'a'}, 301 + {"normal", 'n'}, 302 + {"n", 'n'}, 303 + {"off", 'o'}, 304 + {"o", 'o'}, 305 + {} 335 306 }; 336 307 337 - static int parse_options(char *options, struct iso9660_options *popt) 308 + static const struct constant_table isofs_param_check[] = { 309 + {"relaxed", 'r'}, 310 + {"r", 'r'}, 311 + {"strict", 's'}, 312 + {"s", 's'}, 313 + {} 314 + }; 315 + 316 + static const struct fs_parameter_spec isofs_param_spec[] = { 317 + fsparam_flag ("norock", Opt_norock), 318 + fsparam_flag ("nojoliet", Opt_nojoliet), 319 + fsparam_flag ("unhide", Opt_unhide), 320 + fsparam_flag ("hide", Opt_hide), 321 + fsparam_flag ("showassoc", Opt_showassoc), 322 + fsparam_flag ("cruft", Opt_cruft), 323 + fsparam_flag ("utf8", Opt_utf8), 324 + fsparam_string ("iocharset", Opt_iocharset), 325 + fsparam_enum ("map", Opt_map, isofs_param_map), 326 + fsparam_u32 ("session", Opt_session), 327 + fsparam_u32 ("sbsector", Opt_sb), 328 + fsparam_enum ("check", Opt_check, isofs_param_check), 329 + fsparam_u32 ("uid", Opt_uid), 330 + fsparam_u32 ("gid", Opt_gid), 331 + /* Note: mode/dmode historically accepted %u not strictly %o */ 332 + fsparam_u32 ("mode", Opt_mode), 333 + fsparam_u32 ("dmode", Opt_dmode), 334 + fsparam_flag ("overriderockperm", Opt_overriderockperm), 335 + fsparam_u32 ("block", Opt_block), 336 + fsparam_string ("conv", Opt_ignore), 337 + fsparam_flag ("nocompress", Opt_nocompress), 338 + {} 339 + }; 340 + 341 + static int isofs_parse_param(struct fs_context *fc, 342 + struct fs_parameter *param) 338 343 { 339 - char *p; 340 - int option; 341 - unsigned int uv; 344 + struct isofs_options *popt = fc->fs_private; 345 + struct fs_parse_result result; 346 + int opt; 347 + kuid_t uid; 348 + kgid_t gid; 349 + unsigned int n; 342 350 343 - popt->map = 'n'; 344 - popt->rock = 1; 345 - popt->joliet = 1; 346 - popt->cruft = 0; 347 - popt->hide = 0; 348 - popt->showassoc = 0; 349 - popt->check = 'u'; /* unset */ 350 - popt->nocompress = 0; 351 - popt->blocksize = 1024; 352 - popt->fmode = popt->dmode = ISOFS_INVALID_MODE; 353 - popt->uid_set = 0; 354 - popt->gid_set = 0; 355 - popt->gid = GLOBAL_ROOT_GID; 356 - popt->uid = GLOBAL_ROOT_UID; 357 - popt->iocharset = NULL; 358 - popt->overriderockperm = 0; 359 - popt->session=-1; 360 - popt->sbsector=-1; 361 - if (!options) 362 - return 1; 351 + /* There are no remountable options */ 352 + if (fc->purpose == FS_CONTEXT_FOR_RECONFIGURE) 353 + return 0; 363 354 364 - while ((p = strsep(&options, ",")) != NULL) { 365 - int token; 366 - substring_t args[MAX_OPT_ARGS]; 367 - unsigned n; 355 + opt = fs_parse(fc, isofs_param_spec, param, &result); 356 + if (opt < 0) 357 + return opt; 368 358 369 - if (!*p) 370 - continue; 371 - 372 - token = match_token(p, tokens, args); 373 - switch (token) { 374 - case Opt_norock: 375 - popt->rock = 0; 376 - break; 377 - case Opt_nojoliet: 378 - popt->joliet = 0; 379 - break; 380 - case Opt_hide: 381 - popt->hide = 1; 382 - break; 383 - case Opt_unhide: 384 - case Opt_showassoc: 385 - popt->showassoc = 1; 386 - break; 387 - case Opt_cruft: 388 - popt->cruft = 1; 389 - break; 359 + switch (opt) { 360 + case Opt_norock: 361 + popt->rock = 0; 362 + break; 363 + case Opt_nojoliet: 364 + popt->joliet = 0; 365 + break; 366 + case Opt_hide: 367 + popt->hide = 1; 368 + break; 369 + case Opt_unhide: 370 + case Opt_showassoc: 371 + popt->showassoc = 1; 372 + break; 373 + case Opt_cruft: 374 + popt->cruft = 1; 375 + break; 390 376 #ifdef CONFIG_JOLIET 391 - case Opt_utf8: 392 - kfree(popt->iocharset); 393 - popt->iocharset = kstrdup("utf8", GFP_KERNEL); 394 - if (!popt->iocharset) 395 - return 0; 396 - break; 397 - case Opt_iocharset: 398 - kfree(popt->iocharset); 399 - popt->iocharset = match_strdup(&args[0]); 400 - if (!popt->iocharset) 401 - return 0; 402 - break; 377 + case Opt_utf8: 378 + kfree(popt->iocharset); 379 + popt->iocharset = kstrdup("utf8", GFP_KERNEL); 380 + if (!popt->iocharset) 381 + return -ENOMEM; 382 + break; 383 + case Opt_iocharset: 384 + kfree(popt->iocharset); 385 + popt->iocharset = kstrdup(param->string, GFP_KERNEL); 386 + if (!popt->iocharset) 387 + return -ENOMEM; 388 + break; 403 389 #endif 404 - case Opt_map_a: 405 - popt->map = 'a'; 406 - break; 407 - case Opt_map_o: 408 - popt->map = 'o'; 409 - break; 410 - case Opt_map_n: 411 - popt->map = 'n'; 412 - break; 413 - case Opt_session: 414 - if (match_int(&args[0], &option)) 415 - return 0; 416 - n = option; 417 - /* 418 - * Track numbers are supposed to be in range 1-99, the 419 - * mount option starts indexing at 0. 420 - */ 421 - if (n >= 99) 422 - return 0; 423 - popt->session = n + 1; 424 - break; 425 - case Opt_sb: 426 - if (match_int(&args[0], &option)) 427 - return 0; 428 - popt->sbsector = option; 429 - break; 430 - case Opt_check_r: 431 - popt->check = 'r'; 432 - break; 433 - case Opt_check_s: 434 - popt->check = 's'; 435 - break; 436 - case Opt_ignore: 437 - break; 438 - case Opt_uid: 439 - if (match_uint(&args[0], &uv)) 440 - return 0; 441 - popt->uid = make_kuid(current_user_ns(), uv); 442 - if (!uid_valid(popt->uid)) 443 - return 0; 444 - popt->uid_set = 1; 445 - break; 446 - case Opt_gid: 447 - if (match_uint(&args[0], &uv)) 448 - return 0; 449 - popt->gid = make_kgid(current_user_ns(), uv); 450 - if (!gid_valid(popt->gid)) 451 - return 0; 452 - popt->gid_set = 1; 453 - break; 454 - case Opt_mode: 455 - if (match_int(&args[0], &option)) 456 - return 0; 457 - popt->fmode = option; 458 - break; 459 - case Opt_dmode: 460 - if (match_int(&args[0], &option)) 461 - return 0; 462 - popt->dmode = option; 463 - break; 464 - case Opt_overriderockperm: 465 - popt->overriderockperm = 1; 466 - break; 467 - case Opt_block: 468 - if (match_int(&args[0], &option)) 469 - return 0; 470 - n = option; 471 - if (n != 512 && n != 1024 && n != 2048) 472 - return 0; 473 - popt->blocksize = n; 474 - break; 475 - case Opt_nocompress: 476 - popt->nocompress = 1; 477 - break; 478 - default: 479 - return 0; 480 - } 390 + case Opt_map: 391 + popt->map = result.uint_32; 392 + break; 393 + case Opt_session: 394 + n = result.uint_32; 395 + /* 396 + * Track numbers are supposed to be in range 1-99, the 397 + * mount option starts indexing at 0. 398 + */ 399 + if (n >= 99) 400 + return -EINVAL; 401 + popt->session = n + 1; 402 + break; 403 + case Opt_sb: 404 + popt->sbsector = result.uint_32; 405 + break; 406 + case Opt_check: 407 + popt->check = result.uint_32; 408 + break; 409 + case Opt_ignore: 410 + break; 411 + case Opt_uid: 412 + uid = make_kuid(current_user_ns(), result.uint_32); 413 + if (!uid_valid(uid)) 414 + return -EINVAL; 415 + popt->uid = uid; 416 + popt->uid_set = 1; 417 + break; 418 + case Opt_gid: 419 + gid = make_kgid(current_user_ns(), result.uint_32); 420 + if (!gid_valid(gid)) 421 + return -EINVAL; 422 + popt->gid = gid; 423 + popt->gid_set = 1; 424 + break; 425 + case Opt_mode: 426 + popt->fmode = result.uint_32; 427 + break; 428 + case Opt_dmode: 429 + popt->dmode = result.uint_32; 430 + break; 431 + case Opt_overriderockperm: 432 + popt->overriderockperm = 1; 433 + break; 434 + case Opt_block: 435 + n = result.uint_32; 436 + if (n != 512 && n != 1024 && n != 2048) 437 + return -EINVAL; 438 + popt->blocksize = n; 439 + break; 440 + case Opt_nocompress: 441 + popt->nocompress = 1; 442 + break; 443 + default: 444 + return -EINVAL; 481 445 } 482 - return 1; 446 + return 0; 483 447 } 484 448 485 449 /* ··· 579 615 /* 580 616 * Initialize the superblock and read the root inode. 581 617 */ 582 - static int isofs_fill_super(struct super_block *s, void *data, int silent) 618 + static int isofs_fill_super(struct super_block *s, struct fs_context *fc) 583 619 { 584 620 struct buffer_head *bh = NULL, *pri_bh = NULL; 585 621 struct hs_primary_descriptor *h_pri = NULL; ··· 587 623 struct iso_supplementary_descriptor *sec = NULL; 588 624 struct iso_directory_record *rootp; 589 625 struct inode *inode; 590 - struct iso9660_options opt; 626 + struct isofs_options *opt = fc->fs_private; 591 627 struct isofs_sb_info *sbi; 592 628 unsigned long first_data_zone; 593 629 int joliet_level = 0; ··· 595 631 int orig_zonesize; 596 632 int table, error = -EINVAL; 597 633 unsigned int vol_desc_start; 634 + int silent = fc->sb_flags & SB_SILENT; 598 635 599 636 sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); 600 637 if (!sbi) 601 638 return -ENOMEM; 602 639 s->s_fs_info = sbi; 603 - 604 - if (!parse_options((char *)data, &opt)) 605 - goto out_freesbi; 606 640 607 641 /* 608 642 * First of all, get the hardware blocksize for this device. ··· 617 655 bdev_logical_block_size(s->s_bdev)); 618 656 goto out_freesbi; 619 657 } 620 - opt.blocksize = sb_min_blocksize(s, opt.blocksize); 658 + opt->blocksize = sb_min_blocksize(s, opt->blocksize); 621 659 622 660 sbi->s_high_sierra = 0; /* default is iso9660 */ 623 - sbi->s_session = opt.session; 624 - sbi->s_sbsector = opt.sbsector; 661 + sbi->s_session = opt->session; 662 + sbi->s_sbsector = opt->sbsector; 625 663 626 - vol_desc_start = (opt.sbsector != -1) ? 627 - opt.sbsector : isofs_get_last_session(s,opt.session); 664 + vol_desc_start = (opt->sbsector != -1) ? 665 + opt->sbsector : isofs_get_last_session(s, opt->session); 628 666 629 667 for (iso_blknum = vol_desc_start+16; 630 668 iso_blknum < vol_desc_start+100; iso_blknum++) { ··· 658 696 else if (isonum_711(vdp->type) == ISO_VD_SUPPLEMENTARY) { 659 697 sec = (struct iso_supplementary_descriptor *)vdp; 660 698 if (sec->escape[0] == 0x25 && sec->escape[1] == 0x2f) { 661 - if (opt.joliet) { 699 + if (opt->joliet) { 662 700 if (sec->escape[2] == 0x40) 663 701 joliet_level = 1; 664 702 else if (sec->escape[2] == 0x43) ··· 683 721 goto out_freebh; 684 722 685 723 sbi->s_high_sierra = 1; 686 - opt.rock = 0; 724 + opt->rock = 0; 687 725 h_pri = (struct hs_primary_descriptor *)vdp; 688 726 goto root_found; 689 727 } ··· 711 749 goto out_freebh; 712 750 } 713 751 714 - if (joliet_level && (!pri || !opt.rock)) { 752 + if (joliet_level && (!pri || !opt->rock)) { 715 753 /* This is the case of Joliet with the norock mount flag. 716 754 * A disc with both Joliet and Rock Ridge is handled later 717 755 */ ··· 742 780 * blocks that were 512 bytes (which should only very rarely 743 781 * happen.) 744 782 */ 745 - if (orig_zonesize < opt.blocksize) 783 + if (orig_zonesize < opt->blocksize) 746 784 goto out_bad_size; 747 785 748 786 /* RDE: convert log zone size to bit shift */ ··· 827 865 828 866 #ifdef CONFIG_JOLIET 829 867 if (joliet_level) { 830 - char *p = opt.iocharset ? opt.iocharset : CONFIG_NLS_DEFAULT; 868 + char *p = opt->iocharset ? opt->iocharset : CONFIG_NLS_DEFAULT; 831 869 if (strcmp(p, "utf8") != 0) { 832 - sbi->s_nls_iocharset = opt.iocharset ? 833 - load_nls(opt.iocharset) : load_nls_default(); 870 + sbi->s_nls_iocharset = opt->iocharset ? 871 + load_nls(opt->iocharset) : load_nls_default(); 834 872 if (!sbi->s_nls_iocharset) 835 873 goto out_freesbi; 836 874 } ··· 838 876 #endif 839 877 s->s_op = &isofs_sops; 840 878 s->s_export_op = &isofs_export_ops; 841 - sbi->s_mapping = opt.map; 842 - sbi->s_rock = (opt.rock ? 2 : 0); 879 + sbi->s_mapping = opt->map; 880 + sbi->s_rock = (opt->rock ? 2 : 0); 843 881 sbi->s_rock_offset = -1; /* initial offset, will guess until SP is found*/ 844 - sbi->s_cruft = opt.cruft; 845 - sbi->s_hide = opt.hide; 846 - sbi->s_showassoc = opt.showassoc; 847 - sbi->s_uid = opt.uid; 848 - sbi->s_gid = opt.gid; 849 - sbi->s_uid_set = opt.uid_set; 850 - sbi->s_gid_set = opt.gid_set; 851 - sbi->s_nocompress = opt.nocompress; 852 - sbi->s_overriderockperm = opt.overriderockperm; 882 + sbi->s_cruft = opt->cruft; 883 + sbi->s_hide = opt->hide; 884 + sbi->s_showassoc = opt->showassoc; 885 + sbi->s_uid = opt->uid; 886 + sbi->s_gid = opt->gid; 887 + sbi->s_uid_set = opt->uid_set; 888 + sbi->s_gid_set = opt->gid_set; 889 + sbi->s_nocompress = opt->nocompress; 890 + sbi->s_overriderockperm = opt->overriderockperm; 853 891 /* 854 892 * It would be incredibly stupid to allow people to mark every file 855 893 * on the disk as suid, so we merely allow them to set the default 856 894 * permissions. 857 895 */ 858 - if (opt.fmode != ISOFS_INVALID_MODE) 859 - sbi->s_fmode = opt.fmode & 0777; 896 + if (opt->fmode != ISOFS_INVALID_MODE) 897 + sbi->s_fmode = opt->fmode & 0777; 860 898 else 861 899 sbi->s_fmode = ISOFS_INVALID_MODE; 862 - if (opt.dmode != ISOFS_INVALID_MODE) 863 - sbi->s_dmode = opt.dmode & 0777; 900 + if (opt->dmode != ISOFS_INVALID_MODE) 901 + sbi->s_dmode = opt->dmode & 0777; 864 902 else 865 903 sbi->s_dmode = ISOFS_INVALID_MODE; 866 904 ··· 922 960 } 923 961 } 924 962 925 - if (opt.check == 'u') { 963 + if (opt->check == 'u') { 926 964 /* Only Joliet is case insensitive by default */ 927 965 if (joliet_level) 928 - opt.check = 'r'; 966 + opt->check = 'r'; 929 967 else 930 - opt.check = 's'; 968 + opt->check = 's'; 931 969 } 932 970 sbi->s_joliet_level = joliet_level; 933 971 ··· 942 980 table = 0; 943 981 if (joliet_level) 944 982 table += 2; 945 - if (opt.check == 'r') 983 + if (opt->check == 'r') 946 984 table++; 947 - sbi->s_check = opt.check; 985 + sbi->s_check = opt->check; 948 986 949 987 if (table) 950 988 s->s_d_op = &isofs_dentry_ops[table - 1]; ··· 956 994 goto out_no_inode; 957 995 } 958 996 959 - kfree(opt.iocharset); 997 + kfree(opt->iocharset); 960 998 961 999 return 0; 962 1000 ··· 985 1023 goto out_freebh; 986 1024 out_bad_size: 987 1025 printk(KERN_WARNING "ISOFS: Logical zone size(%d) < hardware blocksize(%u)\n", 988 - orig_zonesize, opt.blocksize); 1026 + orig_zonesize, opt->blocksize); 989 1027 goto out_freebh; 990 1028 out_unknown_format: 991 1029 if (!silent) ··· 995 1033 brelse(bh); 996 1034 brelse(pri_bh); 997 1035 out_freesbi: 998 - kfree(opt.iocharset); 1036 + kfree(opt->iocharset); 999 1037 kfree(sbi); 1000 1038 s->s_fs_info = NULL; 1001 1039 return error; ··· 1529 1567 return inode; 1530 1568 } 1531 1569 1532 - static struct dentry *isofs_mount(struct file_system_type *fs_type, 1533 - int flags, const char *dev_name, void *data) 1570 + static int isofs_get_tree(struct fs_context *fc) 1534 1571 { 1535 - return mount_bdev(fs_type, flags, dev_name, data, isofs_fill_super); 1572 + return get_tree_bdev(fc, isofs_fill_super); 1573 + } 1574 + 1575 + static void isofs_free_fc(struct fs_context *fc) 1576 + { 1577 + kfree(fc->fs_private); 1578 + } 1579 + 1580 + static const struct fs_context_operations isofs_context_ops = { 1581 + .parse_param = isofs_parse_param, 1582 + .get_tree = isofs_get_tree, 1583 + .reconfigure = isofs_reconfigure, 1584 + .free = isofs_free_fc, 1585 + }; 1586 + 1587 + static int isofs_init_fs_context(struct fs_context *fc) 1588 + { 1589 + struct isofs_options *opt; 1590 + 1591 + opt = kzalloc(sizeof(*opt), GFP_KERNEL); 1592 + if (!opt) 1593 + return -ENOMEM; 1594 + 1595 + opt->map = 'n'; 1596 + opt->rock = 1; 1597 + opt->joliet = 1; 1598 + opt->cruft = 0; 1599 + opt->hide = 0; 1600 + opt->showassoc = 0; 1601 + opt->check = 'u'; /* unset */ 1602 + opt->nocompress = 0; 1603 + opt->blocksize = 1024; 1604 + opt->fmode = opt->dmode = ISOFS_INVALID_MODE; 1605 + opt->uid_set = 0; 1606 + opt->gid_set = 0; 1607 + opt->gid = GLOBAL_ROOT_GID; 1608 + opt->uid = GLOBAL_ROOT_UID; 1609 + opt->iocharset = NULL; 1610 + opt->overriderockperm = 0; 1611 + opt->session = -1; 1612 + opt->sbsector = -1; 1613 + 1614 + fc->fs_private = opt; 1615 + fc->ops = &isofs_context_ops; 1616 + 1617 + return 0; 1536 1618 } 1537 1619 1538 1620 static struct file_system_type iso9660_fs_type = { 1539 1621 .owner = THIS_MODULE, 1540 1622 .name = "iso9660", 1541 - .mount = isofs_mount, 1542 1623 .kill_sb = kill_block_super, 1543 1624 .fs_flags = FS_REQUIRES_DEV, 1625 + .init_fs_context = isofs_init_fs_context, 1626 + .parameters = isofs_param_spec, 1544 1627 }; 1545 1628 MODULE_ALIAS_FS("iso9660"); 1546 1629 MODULE_ALIAS("iso9660");
+19 -14
fs/quota/dquot.c
··· 410 410 if (dquot) 411 411 /* Even in case of error we have to continue */ 412 412 ret = mark_dquot_dirty(dquot); 413 - if (!err) 413 + if (!err && ret < 0) 414 414 err = ret; 415 415 } 416 416 return err; ··· 1737 1737 1738 1738 if (reserve) 1739 1739 goto out_flush_warn; 1740 - mark_all_dquot_dirty(dquots); 1740 + ret = mark_all_dquot_dirty(dquots); 1741 1741 out_flush_warn: 1742 1742 srcu_read_unlock(&dquot_srcu, index); 1743 1743 flush_warnings(warn); ··· 1786 1786 warn_put_all: 1787 1787 spin_unlock(&inode->i_lock); 1788 1788 if (ret == 0) 1789 - mark_all_dquot_dirty(dquots); 1789 + ret = mark_all_dquot_dirty(dquots); 1790 1790 srcu_read_unlock(&dquot_srcu, index); 1791 1791 flush_warnings(warn); 1792 1792 return ret; ··· 1990 1990 qsize_t inode_usage = 1; 1991 1991 struct dquot __rcu **dquots; 1992 1992 struct dquot *transfer_from[MAXQUOTAS] = {}; 1993 - int cnt, index, ret = 0; 1993 + int cnt, index, ret = 0, err; 1994 1994 char is_valid[MAXQUOTAS] = {}; 1995 1995 struct dquot_warn warn_to[MAXQUOTAS]; 1996 1996 struct dquot_warn warn_from_inodes[MAXQUOTAS]; ··· 2087 2087 * mark_all_dquot_dirty(). 2088 2088 */ 2089 2089 index = srcu_read_lock(&dquot_srcu); 2090 - mark_all_dquot_dirty((struct dquot __rcu **)transfer_from); 2091 - mark_all_dquot_dirty((struct dquot __rcu **)transfer_to); 2090 + err = mark_all_dquot_dirty((struct dquot __rcu **)transfer_from); 2091 + if (err < 0) 2092 + ret = err; 2093 + err = mark_all_dquot_dirty((struct dquot __rcu **)transfer_to); 2094 + if (err < 0) 2095 + ret = err; 2092 2096 srcu_read_unlock(&dquot_srcu, index); 2093 2097 2094 2098 flush_warnings(warn_to); ··· 2102 2098 for (cnt = 0; cnt < MAXQUOTAS; cnt++) 2103 2099 if (is_valid[cnt]) 2104 2100 transfer_to[cnt] = transfer_from[cnt]; 2105 - return 0; 2101 + return ret; 2106 2102 over_quota: 2107 2103 /* Back out changes we already did */ 2108 2104 for (cnt--; cnt >= 0; cnt--) { ··· 2730 2726 struct mem_dqblk *dm = &dquot->dq_dqb; 2731 2727 int check_blim = 0, check_ilim = 0; 2732 2728 struct mem_dqinfo *dqi = &sb_dqopt(dquot->dq_sb)->info[dquot->dq_id.type]; 2729 + int ret; 2733 2730 2734 2731 if (di->d_fieldmask & ~VFS_QC_MASK) 2735 2732 return -EINVAL; ··· 2812 2807 else 2813 2808 set_bit(DQ_FAKE_B, &dquot->dq_flags); 2814 2809 spin_unlock(&dquot->dq_dqb_lock); 2815 - mark_dquot_dirty(dquot); 2816 - 2810 + ret = mark_dquot_dirty(dquot); 2811 + if (ret < 0) 2812 + return ret; 2817 2813 return 0; 2818 2814 } 2819 2815 ··· 3022 3016 if (!dquot_hash) 3023 3017 panic("Cannot create dquot hash table"); 3024 3018 3025 - for (i = 0; i < _DQST_DQSTAT_LAST; i++) { 3026 - ret = percpu_counter_init(&dqstats.counter[i], 0, GFP_KERNEL); 3027 - if (ret) 3028 - panic("Cannot create dquot stat counters"); 3029 - } 3019 + ret = percpu_counter_init_many(dqstats.counter, 0, GFP_KERNEL, 3020 + _DQST_DQSTAT_LAST); 3021 + if (ret) 3022 + panic("Cannot create dquot stat counters"); 3030 3023 3031 3024 /* Find power-of-two hlist_heads which can fit into allocation */ 3032 3025 nr_hash = (1UL << order) * PAGE_SIZE / sizeof(struct hlist_head);
+3 -13
fs/reiserfs/README
··· 102 102 align files), and he invented and implemented indirect items and 103 103 unformatted nodes as the solution. 104 104 105 - Konstantin Shvachko, with the help of the Russian version of a VC, 106 - tried to put me in a position where I was forced into giving control 107 - of the project to him. (Fortunately, as the person paying the money 108 - for all salaries from my dayjob I owned all copyrights, and you can't 109 - really force takeovers of sole proprietorships.) This was something 110 - curious, because he never really understood the value of our project, 111 - why we should do what we do, or why innovation was possible in 112 - general, but he was sure that he ought to be controlling it. Every 113 - innovation had to be forced past him while he was with us. He added 114 - two years to the time required to complete reiserfs, and was a net 115 - loss for me. Mikhail Gilula was a brilliant innovator who also left 116 - in a destructive way that erased the value of his contributions, and 117 - that he was shown much generosity just makes it more painful. 105 + Konstantin Shvachko was taking part in the early days. 106 + 107 + Mikhail Gilula was a brilliant innovator that has shown much generosity. 118 108 119 109 Grigory Zaigralin was an extremely effective system administrator for 120 110 our group.
+8 -8
fs/reiserfs/inode.c
··· 2503 2503 * start/recovery path as __block_write_full_folio, along with special 2504 2504 * code to handle reiserfs tails. 2505 2505 */ 2506 - static int reiserfs_write_full_folio(struct folio *folio, 2507 - struct writeback_control *wbc) 2506 + static int reiserfs_write_folio(struct folio *folio, 2507 + struct writeback_control *wbc, void *data) 2508 2508 { 2509 2509 struct inode *inode = folio->mapping->host; 2510 2510 unsigned long end_index = inode->i_size >> PAGE_SHIFT; ··· 2721 2721 return block_read_full_folio(folio, reiserfs_get_block); 2722 2722 } 2723 2723 2724 - static int reiserfs_writepage(struct page *page, struct writeback_control *wbc) 2724 + static int reiserfs_writepages(struct address_space *mapping, 2725 + struct writeback_control *wbc) 2725 2726 { 2726 - struct folio *folio = page_folio(page); 2727 - struct inode *inode = folio->mapping->host; 2728 - reiserfs_wait_on_write_block(inode->i_sb); 2729 - return reiserfs_write_full_folio(folio, wbc); 2727 + reiserfs_wait_on_write_block(mapping->host->i_sb); 2728 + return write_cache_pages(mapping, wbc, reiserfs_write_folio, NULL); 2730 2729 } 2731 2730 2732 2731 static void reiserfs_truncate_failed_write(struct inode *inode) ··· 3404 3405 } 3405 3406 3406 3407 const struct address_space_operations reiserfs_address_space_operations = { 3407 - .writepage = reiserfs_writepage, 3408 + .writepages = reiserfs_writepages, 3408 3409 .read_folio = reiserfs_read_folio, 3409 3410 .readahead = reiserfs_readahead, 3410 3411 .release_folio = reiserfs_release_folio, ··· 3414 3415 .bmap = reiserfs_aop_bmap, 3415 3416 .direct_IO = reiserfs_direct_IO, 3416 3417 .dirty_folio = reiserfs_dirty_folio, 3418 + .migrate_folio = buffer_migrate_folio, 3417 3419 };
+10 -10
fs/udf/file.c
··· 39 39 struct vm_area_struct *vma = vmf->vma; 40 40 struct inode *inode = file_inode(vma->vm_file); 41 41 struct address_space *mapping = inode->i_mapping; 42 - struct page *page = vmf->page; 42 + struct folio *folio = page_folio(vmf->page); 43 43 loff_t size; 44 44 unsigned int end; 45 45 vm_fault_t ret = VM_FAULT_LOCKED; ··· 48 48 sb_start_pagefault(inode->i_sb); 49 49 file_update_time(vma->vm_file); 50 50 filemap_invalidate_lock_shared(mapping); 51 - lock_page(page); 51 + folio_lock(folio); 52 52 size = i_size_read(inode); 53 - if (page->mapping != inode->i_mapping || page_offset(page) >= size) { 54 - unlock_page(page); 53 + if (folio->mapping != inode->i_mapping || folio_pos(folio) >= size) { 54 + folio_unlock(folio); 55 55 ret = VM_FAULT_NOPAGE; 56 56 goto out_unlock; 57 57 } 58 58 /* Space is already allocated for in-ICB file */ 59 59 if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) 60 60 goto out_dirty; 61 - if (page->index == size >> PAGE_SHIFT) 61 + if (folio->index == size >> PAGE_SHIFT) 62 62 end = size & ~PAGE_MASK; 63 63 else 64 64 end = PAGE_SIZE; 65 - err = __block_write_begin(page, 0, end, udf_get_block); 65 + err = __block_write_begin(&folio->page, 0, end, udf_get_block); 66 66 if (err) { 67 - unlock_page(page); 67 + folio_unlock(folio); 68 68 ret = vmf_fs_error(err); 69 69 goto out_unlock; 70 70 } 71 71 72 - block_commit_write(page, 0, end); 72 + block_commit_write(&folio->page, 0, end); 73 73 out_dirty: 74 - set_page_dirty(page); 75 - wait_for_stable_page(page); 74 + folio_mark_dirty(folio); 75 + folio_wait_stable(folio); 76 76 out_unlock: 77 77 filemap_invalidate_unlock_shared(mapping); 78 78 sb_end_pagefault(inode->i_sb);
+32 -33
fs/udf/inode.c
··· 208 208 return write_cache_pages(mapping, wbc, udf_adinicb_writepage, NULL); 209 209 } 210 210 211 - static void udf_adinicb_readpage(struct page *page) 211 + static void udf_adinicb_read_folio(struct folio *folio) 212 212 { 213 - struct inode *inode = page->mapping->host; 214 - char *kaddr; 213 + struct inode *inode = folio->mapping->host; 215 214 struct udf_inode_info *iinfo = UDF_I(inode); 216 215 loff_t isize = i_size_read(inode); 217 216 218 - kaddr = kmap_local_page(page); 219 - memcpy(kaddr, iinfo->i_data + iinfo->i_lenEAttr, isize); 220 - memset(kaddr + isize, 0, PAGE_SIZE - isize); 221 - flush_dcache_page(page); 222 - SetPageUptodate(page); 223 - kunmap_local(kaddr); 217 + folio_fill_tail(folio, 0, iinfo->i_data + iinfo->i_lenEAttr, isize); 218 + folio_mark_uptodate(folio); 224 219 } 225 220 226 221 static int udf_read_folio(struct file *file, struct folio *folio) ··· 223 228 struct udf_inode_info *iinfo = UDF_I(file_inode(file)); 224 229 225 230 if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) { 226 - udf_adinicb_readpage(&folio->page); 231 + udf_adinicb_read_folio(folio); 227 232 folio_unlock(folio); 228 233 return 0; 229 234 } ··· 249 254 struct page **pagep, void **fsdata) 250 255 { 251 256 struct udf_inode_info *iinfo = UDF_I(file_inode(file)); 252 - struct page *page; 257 + struct folio *folio; 253 258 int ret; 254 259 255 260 if (iinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB) { ··· 261 266 } 262 267 if (WARN_ON_ONCE(pos >= PAGE_SIZE)) 263 268 return -EIO; 264 - page = grab_cache_page_write_begin(mapping, 0); 265 - if (!page) 266 - return -ENOMEM; 267 - *pagep = page; 268 - if (!PageUptodate(page)) 269 - udf_adinicb_readpage(page); 269 + folio = __filemap_get_folio(mapping, 0, FGP_WRITEBEGIN, 270 + mapping_gfp_mask(mapping)); 271 + if (IS_ERR(folio)) 272 + return PTR_ERR(folio); 273 + *pagep = &folio->page; 274 + if (!folio_test_uptodate(folio)) 275 + udf_adinicb_read_folio(folio); 270 276 return 0; 271 277 } 272 278 ··· 276 280 struct page *page, void *fsdata) 277 281 { 278 282 struct inode *inode = file_inode(file); 283 + struct folio *folio; 279 284 loff_t last_pos; 280 285 281 286 if (UDF_I(inode)->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB) 282 287 return generic_write_end(file, mapping, pos, len, copied, page, 283 288 fsdata); 289 + folio = page_folio(page); 284 290 last_pos = pos + copied; 285 291 if (last_pos > inode->i_size) 286 292 i_size_write(inode, last_pos); 287 - set_page_dirty(page); 288 - unlock_page(page); 289 - put_page(page); 293 + folio_mark_dirty(folio); 294 + folio_unlock(folio); 295 + folio_put(folio); 290 296 291 297 return copied; 292 298 } ··· 339 341 */ 340 342 int udf_expand_file_adinicb(struct inode *inode) 341 343 { 342 - struct page *page; 344 + struct folio *folio; 343 345 struct udf_inode_info *iinfo = UDF_I(inode); 344 346 int err; 345 347 ··· 355 357 return 0; 356 358 } 357 359 358 - page = find_or_create_page(inode->i_mapping, 0, GFP_KERNEL); 359 - if (!page) 360 - return -ENOMEM; 360 + folio = __filemap_get_folio(inode->i_mapping, 0, 361 + FGP_LOCK | FGP_ACCESSED | FGP_CREAT, GFP_KERNEL); 362 + if (IS_ERR(folio)) 363 + return PTR_ERR(folio); 361 364 362 - if (!PageUptodate(page)) 363 - udf_adinicb_readpage(page); 365 + if (!folio_test_uptodate(folio)) 366 + udf_adinicb_read_folio(folio); 364 367 down_write(&iinfo->i_data_sem); 365 368 memset(iinfo->i_data + iinfo->i_lenEAttr, 0x00, 366 369 iinfo->i_lenAlloc); ··· 370 371 iinfo->i_alloc_type = ICBTAG_FLAG_AD_SHORT; 371 372 else 372 373 iinfo->i_alloc_type = ICBTAG_FLAG_AD_LONG; 373 - set_page_dirty(page); 374 - unlock_page(page); 374 + folio_mark_dirty(folio); 375 + folio_unlock(folio); 375 376 up_write(&iinfo->i_data_sem); 376 377 err = filemap_fdatawrite(inode->i_mapping); 377 378 if (err) { 378 379 /* Restore everything back so that we don't lose data... */ 379 - lock_page(page); 380 + folio_lock(folio); 380 381 down_write(&iinfo->i_data_sem); 381 - memcpy_to_page(page, 0, iinfo->i_data + iinfo->i_lenEAttr, 382 - inode->i_size); 383 - unlock_page(page); 382 + memcpy_from_folio(iinfo->i_data + iinfo->i_lenEAttr, 383 + folio, 0, inode->i_size); 384 + folio_unlock(folio); 384 385 iinfo->i_alloc_type = ICBTAG_FLAG_AD_IN_ICB; 385 386 iinfo->i_lenAlloc = inode->i_size; 386 387 up_write(&iinfo->i_data_sem); 387 388 } 388 - put_page(page); 389 + folio_put(folio); 389 390 mark_inode_dirty(inode); 390 391 391 392 return err;
+4 -4
fs/udf/super.c
··· 630 630 if (!uopt->nls_map) { 631 631 errorf(fc, "iocharset %s not found", 632 632 param->string); 633 - return -EINVAL;; 633 + return -EINVAL; 634 634 } 635 635 } 636 636 break; ··· 895 895 int ret; 896 896 struct timestamp *ts; 897 897 898 - outstr = kmalloc(128, GFP_KERNEL); 898 + outstr = kzalloc(128, GFP_KERNEL); 899 899 if (!outstr) 900 900 return -ENOMEM; 901 901 ··· 921 921 922 922 ret = udf_dstrCS0toChar(sb, outstr, 31, pvoldesc->volIdent, 32); 923 923 if (ret < 0) { 924 - strcpy(UDF_SB(sb)->s_volume_ident, "InvalidName"); 924 + strscpy_pad(UDF_SB(sb)->s_volume_ident, "InvalidName"); 925 925 pr_warn("incorrect volume identification, setting to " 926 926 "'InvalidName'\n"); 927 927 } else { 928 - strncpy(UDF_SB(sb)->s_volume_ident, outstr, ret); 928 + strscpy_pad(UDF_SB(sb)->s_volume_ident, outstr); 929 929 } 930 930 udf_debug("volIdent[] = '%s'\n", UDF_SB(sb)->s_volume_ident); 931 931
+12 -22
fs/udf/symlink.c
··· 99 99 100 100 static int udf_symlink_filler(struct file *file, struct folio *folio) 101 101 { 102 - struct page *page = &folio->page; 103 - struct inode *inode = page->mapping->host; 102 + struct inode *inode = folio->mapping->host; 104 103 struct buffer_head *bh = NULL; 105 104 unsigned char *symlink; 106 105 int err = 0; 107 - unsigned char *p = page_address(page); 106 + unsigned char *p = folio_address(folio); 108 107 struct udf_inode_info *iinfo = UDF_I(inode); 109 108 110 109 /* We don't support symlinks longer than one block */ 111 110 if (inode->i_size > inode->i_sb->s_blocksize) { 112 111 err = -ENAMETOOLONG; 113 - goto out_unlock; 112 + goto out; 114 113 } 115 114 116 115 if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) { ··· 119 120 if (!bh) { 120 121 if (!err) 121 122 err = -EFSCORRUPTED; 122 - goto out_err; 123 + goto out; 123 124 } 124 125 symlink = bh->b_data; 125 126 } 126 127 127 128 err = udf_pc_to_char(inode->i_sb, symlink, inode->i_size, p, PAGE_SIZE); 128 129 brelse(bh); 129 - if (err) 130 - goto out_err; 131 - 132 - SetPageUptodate(page); 133 - unlock_page(page); 134 - return 0; 135 - 136 - out_err: 137 - SetPageError(page); 138 - out_unlock: 139 - unlock_page(page); 130 + out: 131 + folio_end_read(folio, err == 0); 140 132 return err; 141 133 } 142 134 ··· 137 147 { 138 148 struct dentry *dentry = path->dentry; 139 149 struct inode *inode = d_backing_inode(dentry); 140 - struct page *page; 150 + struct folio *folio; 141 151 142 152 generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat); 143 - page = read_mapping_page(inode->i_mapping, 0, NULL); 144 - if (IS_ERR(page)) 145 - return PTR_ERR(page); 153 + folio = read_mapping_folio(inode->i_mapping, 0, NULL); 154 + if (IS_ERR(folio)) 155 + return PTR_ERR(folio); 146 156 /* 147 157 * UDF uses non-trivial encoding of symlinks so i_size does not match 148 158 * number of characters reported by readlink(2) which apparently some ··· 152 162 * let's report the length of string returned by readlink(2) for 153 163 * st_size. 154 164 */ 155 - stat->size = strlen(page_address(page)); 156 - put_page(page); 165 + stat->size = strlen(folio_address(folio)); 166 + folio_put(folio); 157 167 158 168 return 0; 159 169 }
+8 -3
fs/udf/udftime.c
··· 46 46 dest->tv_sec = mktime64(year, src.month, src.day, src.hour, src.minute, 47 47 src.second); 48 48 dest->tv_sec -= offset * 60; 49 - dest->tv_nsec = 1000 * (src.centiseconds * 10000 + 50 - src.hundredsOfMicroseconds * 100 + src.microseconds); 49 + 51 50 /* 52 51 * Sanitize nanosecond field since reportedly some filesystems are 53 52 * recorded with bogus sub-second values. 54 53 */ 55 - dest->tv_nsec %= NSEC_PER_SEC; 54 + if (src.centiseconds < 100 && src.hundredsOfMicroseconds < 100 && 55 + src.microseconds < 100) { 56 + dest->tv_nsec = 1000 * (src.centiseconds * 10000 + 57 + src.hundredsOfMicroseconds * 100 + src.microseconds); 58 + } else { 59 + dest->tv_nsec = 0; 60 + } 56 61 } 57 62 58 63 void