aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2017-11-14 05:09:53 -0500
committerJan Kara <jack@suse.cz>2017-11-14 05:09:53 -0500
commit838bee9e756ec46e9b5be25f9e44388d7e185a2a (patch)
treeebabacacc94478173d2707ea3f931a79b7bae214
parentac3d79392f8c2728f7600dd32ed88b3a1bfdc1af (diff)
parent88d8ff976abdad043cc37dc1b4f01d93603842d7 (diff)
Merge udf, isofs, quota, ext2 changes for 4.15-rc1.
-rw-r--r--Documentation/filesystems/udf.txt8
-rw-r--r--fs/ext2/super.c161
-rw-r--r--fs/isofs/isofs.h22
-rw-r--r--fs/isofs/rock.h64
-rw-r--r--fs/isofs/util.c2
-rw-r--r--fs/notify/fanotify/fanotify.c8
-rw-r--r--fs/notify/fanotify/fanotify_user.c16
-rw-r--r--fs/notify/fdinfo.c3
-rw-r--r--fs/quota/dquot.c13
-rw-r--r--fs/udf/balloc.c29
-rw-r--r--fs/udf/dir.c2
-rw-r--r--fs/udf/directory.c9
-rw-r--r--fs/udf/ialloc.c2
-rw-r--r--fs/udf/inode.c50
-rw-r--r--fs/udf/misc.c8
-rw-r--r--fs/udf/namei.c13
-rw-r--r--fs/udf/partition.c6
-rw-r--r--fs/udf/super.c56
-rw-r--r--fs/udf/truncate.c2
-rw-r--r--fs/udf/udfdecl.h21
-rw-r--r--fs/udf/unicode.c2
-rw-r--r--include/linux/audit.h10
-rw-r--r--include/linux/fsnotify_backend.h1
-rw-r--r--include/uapi/linux/audit.h1
-rw-r--r--include/uapi/linux/fanotify.h3
-rw-r--r--include/uapi/linux/iso_fs.h162
-rw-r--r--kernel/auditsc.c6
27 files changed, 366 insertions, 314 deletions
diff --git a/Documentation/filesystems/udf.txt b/Documentation/filesystems/udf.txt
index 902b95d0ee51..d3d0e3218f86 100644
--- a/Documentation/filesystems/udf.txt
+++ b/Documentation/filesystems/udf.txt
@@ -1,11 +1,9 @@
1* 1*
2* Documentation/filesystems/udf.txt 2* Documentation/filesystems/udf.txt
3* 3*
4UDF Filesystem version 0.9.8.1
5 4
6If you encounter problems with reading UDF discs using this driver, 5If you encounter problems with reading UDF discs using this driver,
7please report them to linux_udf@hpesjro.fc.hp.com, which is the 6please report them according to MAINTAINERS file.
8developer's list.
9 7
10Write support requires a block driver which supports writing. Currently 8Write support requires a block driver which supports writing. Currently
11dvd+rw drives and media support true random sector writes, and so a udf 9dvd+rw drives and media support true random sector writes, and so a udf
@@ -73,10 +71,8 @@ The following expect a offset from the partition root.
73 71
74 72
75For the latest version and toolset see: 73For the latest version and toolset see:
76 http://linux-udf.sourceforge.net/ 74 https://github.com/pali/udftools
77 75
78Documentation on UDF and ECMA 167 is available FREE from: 76Documentation on UDF and ECMA 167 is available FREE from:
79 http://www.osta.org/ 77 http://www.osta.org/
80 http://www.ecma-international.org/ 78 http://www.ecma-international.org/
81
82Ben Fennema <bfennema@falcon.csc.calpoly.edu>
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index 1458706bd2ec..e2b6be03e69b 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -479,10 +479,10 @@ static const match_table_t tokens = {
479 {Opt_err, NULL} 479 {Opt_err, NULL}
480}; 480};
481 481
482static int parse_options(char *options, struct super_block *sb) 482static int parse_options(char *options, struct super_block *sb,
483 struct ext2_mount_options *opts)
483{ 484{
484 char *p; 485 char *p;
485 struct ext2_sb_info *sbi = EXT2_SB(sb);
486 substring_t args[MAX_OPT_ARGS]; 486 substring_t args[MAX_OPT_ARGS];
487 int option; 487 int option;
488 kuid_t uid; 488 kuid_t uid;
@@ -499,16 +499,16 @@ static int parse_options(char *options, struct super_block *sb)
499 token = match_token(p, tokens, args); 499 token = match_token(p, tokens, args);
500 switch (token) { 500 switch (token) {
501 case Opt_bsd_df: 501 case Opt_bsd_df:
502 clear_opt (sbi->s_mount_opt, MINIX_DF); 502 clear_opt (opts->s_mount_opt, MINIX_DF);
503 break; 503 break;
504 case Opt_minix_df: 504 case Opt_minix_df:
505 set_opt (sbi->s_mount_opt, MINIX_DF); 505 set_opt (opts->s_mount_opt, MINIX_DF);
506 break; 506 break;
507 case Opt_grpid: 507 case Opt_grpid:
508 set_opt (sbi->s_mount_opt, GRPID); 508 set_opt (opts->s_mount_opt, GRPID);
509 break; 509 break;
510 case Opt_nogrpid: 510 case Opt_nogrpid:
511 clear_opt (sbi->s_mount_opt, GRPID); 511 clear_opt (opts->s_mount_opt, GRPID);
512 break; 512 break;
513 case Opt_resuid: 513 case Opt_resuid:
514 if (match_int(&args[0], &option)) 514 if (match_int(&args[0], &option))
@@ -519,7 +519,7 @@ static int parse_options(char *options, struct super_block *sb)
519 return 0; 519 return 0;
520 520
521 } 521 }
522 sbi->s_resuid = uid; 522 opts->s_resuid = uid;
523 break; 523 break;
524 case Opt_resgid: 524 case Opt_resgid:
525 if (match_int(&args[0], &option)) 525 if (match_int(&args[0], &option))
@@ -529,51 +529,51 @@ static int parse_options(char *options, struct super_block *sb)
529 ext2_msg(sb, KERN_ERR, "Invalid gid value %d", option); 529 ext2_msg(sb, KERN_ERR, "Invalid gid value %d", option);
530 return 0; 530 return 0;
531 } 531 }
532 sbi->s_resgid = gid; 532 opts->s_resgid = gid;
533 break; 533 break;
534 case Opt_sb: 534 case Opt_sb:
535 /* handled by get_sb_block() instead of here */ 535 /* handled by get_sb_block() instead of here */
536 /* *sb_block = match_int(&args[0]); */ 536 /* *sb_block = match_int(&args[0]); */
537 break; 537 break;
538 case Opt_err_panic: 538 case Opt_err_panic:
539 clear_opt (sbi->s_mount_opt, ERRORS_CONT); 539 clear_opt (opts->s_mount_opt, ERRORS_CONT);
540 clear_opt (sbi->s_mount_opt, ERRORS_RO); 540 clear_opt (opts->s_mount_opt, ERRORS_RO);
541 set_opt (sbi->s_mount_opt, ERRORS_PANIC); 541 set_opt (opts->s_mount_opt, ERRORS_PANIC);
542 break; 542 break;
543 case Opt_err_ro: 543 case Opt_err_ro:
544 clear_opt (sbi->s_mount_opt, ERRORS_CONT); 544 clear_opt (opts->s_mount_opt, ERRORS_CONT);
545 clear_opt (sbi->s_mount_opt, ERRORS_PANIC); 545 clear_opt (opts->s_mount_opt, ERRORS_PANIC);
546 set_opt (sbi->s_mount_opt, ERRORS_RO); 546 set_opt (opts->s_mount_opt, ERRORS_RO);
547 break; 547 break;
548 case Opt_err_cont: 548 case Opt_err_cont:
549 clear_opt (sbi->s_mount_opt, ERRORS_RO); 549 clear_opt (opts->s_mount_opt, ERRORS_RO);
550 clear_opt (sbi->s_mount_opt, ERRORS_PANIC); 550 clear_opt (opts->s_mount_opt, ERRORS_PANIC);
551 set_opt (sbi->s_mount_opt, ERRORS_CONT); 551 set_opt (opts->s_mount_opt, ERRORS_CONT);
552 break; 552 break;
553 case Opt_nouid32: 553 case Opt_nouid32:
554 set_opt (sbi->s_mount_opt, NO_UID32); 554 set_opt (opts->s_mount_opt, NO_UID32);
555 break; 555 break;
556 case Opt_nocheck: 556 case Opt_nocheck:
557 clear_opt (sbi->s_mount_opt, CHECK); 557 clear_opt (opts->s_mount_opt, CHECK);
558 break; 558 break;
559 case Opt_debug: 559 case Opt_debug:
560 set_opt (sbi->s_mount_opt, DEBUG); 560 set_opt (opts->s_mount_opt, DEBUG);
561 break; 561 break;
562 case Opt_oldalloc: 562 case Opt_oldalloc:
563 set_opt (sbi->s_mount_opt, OLDALLOC); 563 set_opt (opts->s_mount_opt, OLDALLOC);
564 break; 564 break;
565 case Opt_orlov: 565 case Opt_orlov:
566 clear_opt (sbi->s_mount_opt, OLDALLOC); 566 clear_opt (opts->s_mount_opt, OLDALLOC);
567 break; 567 break;
568 case Opt_nobh: 568 case Opt_nobh:
569 set_opt (sbi->s_mount_opt, NOBH); 569 set_opt (opts->s_mount_opt, NOBH);
570 break; 570 break;
571#ifdef CONFIG_EXT2_FS_XATTR 571#ifdef CONFIG_EXT2_FS_XATTR
572 case Opt_user_xattr: 572 case Opt_user_xattr:
573 set_opt (sbi->s_mount_opt, XATTR_USER); 573 set_opt (opts->s_mount_opt, XATTR_USER);
574 break; 574 break;
575 case Opt_nouser_xattr: 575 case Opt_nouser_xattr:
576 clear_opt (sbi->s_mount_opt, XATTR_USER); 576 clear_opt (opts->s_mount_opt, XATTR_USER);
577 break; 577 break;
578#else 578#else
579 case Opt_user_xattr: 579 case Opt_user_xattr:
@@ -584,10 +584,10 @@ static int parse_options(char *options, struct super_block *sb)
584#endif 584#endif
585#ifdef CONFIG_EXT2_FS_POSIX_ACL 585#ifdef CONFIG_EXT2_FS_POSIX_ACL
586 case Opt_acl: 586 case Opt_acl:
587 set_opt(sbi->s_mount_opt, POSIX_ACL); 587 set_opt(opts->s_mount_opt, POSIX_ACL);
588 break; 588 break;
589 case Opt_noacl: 589 case Opt_noacl:
590 clear_opt(sbi->s_mount_opt, POSIX_ACL); 590 clear_opt(opts->s_mount_opt, POSIX_ACL);
591 break; 591 break;
592#else 592#else
593 case Opt_acl: 593 case Opt_acl:
@@ -598,13 +598,13 @@ static int parse_options(char *options, struct super_block *sb)
598#endif 598#endif
599 case Opt_xip: 599 case Opt_xip:
600 ext2_msg(sb, KERN_INFO, "use dax instead of xip"); 600 ext2_msg(sb, KERN_INFO, "use dax instead of xip");
601 set_opt(sbi->s_mount_opt, XIP); 601 set_opt(opts->s_mount_opt, XIP);
602 /* Fall through */ 602 /* Fall through */
603 case Opt_dax: 603 case Opt_dax:
604#ifdef CONFIG_FS_DAX 604#ifdef CONFIG_FS_DAX
605 ext2_msg(sb, KERN_WARNING, 605 ext2_msg(sb, KERN_WARNING,
606 "DAX enabled. Warning: EXPERIMENTAL, use at your own risk"); 606 "DAX enabled. Warning: EXPERIMENTAL, use at your own risk");
607 set_opt(sbi->s_mount_opt, DAX); 607 set_opt(opts->s_mount_opt, DAX);
608#else 608#else
609 ext2_msg(sb, KERN_INFO, "dax option not supported"); 609 ext2_msg(sb, KERN_INFO, "dax option not supported");
610#endif 610#endif
@@ -613,11 +613,11 @@ static int parse_options(char *options, struct super_block *sb)
613#if defined(CONFIG_QUOTA) 613#if defined(CONFIG_QUOTA)
614 case Opt_quota: 614 case Opt_quota:
615 case Opt_usrquota: 615 case Opt_usrquota:
616 set_opt(sbi->s_mount_opt, USRQUOTA); 616 set_opt(opts->s_mount_opt, USRQUOTA);
617 break; 617 break;
618 618
619 case Opt_grpquota: 619 case Opt_grpquota:
620 set_opt(sbi->s_mount_opt, GRPQUOTA); 620 set_opt(opts->s_mount_opt, GRPQUOTA);
621 break; 621 break;
622#else 622#else
623 case Opt_quota: 623 case Opt_quota:
@@ -629,11 +629,11 @@ static int parse_options(char *options, struct super_block *sb)
629#endif 629#endif
630 630
631 case Opt_reservation: 631 case Opt_reservation:
632 set_opt(sbi->s_mount_opt, RESERVATION); 632 set_opt(opts->s_mount_opt, RESERVATION);
633 ext2_msg(sb, KERN_INFO, "reservations ON"); 633 ext2_msg(sb, KERN_INFO, "reservations ON");
634 break; 634 break;
635 case Opt_noreservation: 635 case Opt_noreservation:
636 clear_opt(sbi->s_mount_opt, RESERVATION); 636 clear_opt(opts->s_mount_opt, RESERVATION);
637 ext2_msg(sb, KERN_INFO, "reservations OFF"); 637 ext2_msg(sb, KERN_INFO, "reservations OFF");
638 break; 638 break;
639 case Opt_ignore: 639 case Opt_ignore:
@@ -830,6 +830,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
830 int i, j; 830 int i, j;
831 __le32 features; 831 __le32 features;
832 int err; 832 int err;
833 struct ext2_mount_options opts;
833 834
834 err = -ENOMEM; 835 err = -ENOMEM;
835 sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); 836 sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
@@ -890,35 +891,39 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
890 /* Set defaults before we parse the mount options */ 891 /* Set defaults before we parse the mount options */
891 def_mount_opts = le32_to_cpu(es->s_default_mount_opts); 892 def_mount_opts = le32_to_cpu(es->s_default_mount_opts);
892 if (def_mount_opts & EXT2_DEFM_DEBUG) 893 if (def_mount_opts & EXT2_DEFM_DEBUG)
893 set_opt(sbi->s_mount_opt, DEBUG); 894 set_opt(opts.s_mount_opt, DEBUG);
894 if (def_mount_opts & EXT2_DEFM_BSDGROUPS) 895 if (def_mount_opts & EXT2_DEFM_BSDGROUPS)
895 set_opt(sbi->s_mount_opt, GRPID); 896 set_opt(opts.s_mount_opt, GRPID);
896 if (def_mount_opts & EXT2_DEFM_UID16) 897 if (def_mount_opts & EXT2_DEFM_UID16)
897 set_opt(sbi->s_mount_opt, NO_UID32); 898 set_opt(opts.s_mount_opt, NO_UID32);
898#ifdef CONFIG_EXT2_FS_XATTR 899#ifdef CONFIG_EXT2_FS_XATTR
899 if (def_mount_opts & EXT2_DEFM_XATTR_USER) 900 if (def_mount_opts & EXT2_DEFM_XATTR_USER)
900 set_opt(sbi->s_mount_opt, XATTR_USER); 901 set_opt(opts.s_mount_opt, XATTR_USER);
901#endif 902#endif
902#ifdef CONFIG_EXT2_FS_POSIX_ACL 903#ifdef CONFIG_EXT2_FS_POSIX_ACL
903 if (def_mount_opts & EXT2_DEFM_ACL) 904 if (def_mount_opts & EXT2_DEFM_ACL)
904 set_opt(sbi->s_mount_opt, POSIX_ACL); 905 set_opt(opts.s_mount_opt, POSIX_ACL);
905#endif 906#endif
906 907
907 if (le16_to_cpu(sbi->s_es->s_errors) == EXT2_ERRORS_PANIC) 908 if (le16_to_cpu(sbi->s_es->s_errors) == EXT2_ERRORS_PANIC)
908 set_opt(sbi->s_mount_opt, ERRORS_PANIC); 909 set_opt(opts.s_mount_opt, ERRORS_PANIC);
909 else if (le16_to_cpu(sbi->s_es->s_errors) == EXT2_ERRORS_CONTINUE) 910 else if (le16_to_cpu(sbi->s_es->s_errors) == EXT2_ERRORS_CONTINUE)
910 set_opt(sbi->s_mount_opt, ERRORS_CONT); 911 set_opt(opts.s_mount_opt, ERRORS_CONT);
911 else 912 else
912 set_opt(sbi->s_mount_opt, ERRORS_RO); 913 set_opt(opts.s_mount_opt, ERRORS_RO);
913 914
914 sbi->s_resuid = make_kuid(&init_user_ns, le16_to_cpu(es->s_def_resuid)); 915 opts.s_resuid = make_kuid(&init_user_ns, le16_to_cpu(es->s_def_resuid));
915 sbi->s_resgid = make_kgid(&init_user_ns, le16_to_cpu(es->s_def_resgid)); 916 opts.s_resgid = make_kgid(&init_user_ns, le16_to_cpu(es->s_def_resgid));
916 917
917 set_opt(sbi->s_mount_opt, RESERVATION); 918 set_opt(opts.s_mount_opt, RESERVATION);
918 919
919 if (!parse_options((char *) data, sb)) 920 if (!parse_options((char *) data, sb, &opts))
920 goto failed_mount; 921 goto failed_mount;
921 922
923 sbi->s_mount_opt = opts.s_mount_opt;
924 sbi->s_resuid = opts.s_resuid;
925 sbi->s_resgid = opts.s_resgid;
926
922 sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | 927 sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
923 ((EXT2_SB(sb)->s_mount_opt & EXT2_MOUNT_POSIX_ACL) ? 928 ((EXT2_SB(sb)->s_mount_opt & EXT2_MOUNT_POSIX_ACL) ?
924 MS_POSIXACL : 0); 929 MS_POSIXACL : 0);
@@ -1312,46 +1317,36 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data)
1312{ 1317{
1313 struct ext2_sb_info * sbi = EXT2_SB(sb); 1318 struct ext2_sb_info * sbi = EXT2_SB(sb);
1314 struct ext2_super_block * es; 1319 struct ext2_super_block * es;
1315 struct ext2_mount_options old_opts; 1320 struct ext2_mount_options new_opts;
1316 unsigned long old_sb_flags;
1317 int err; 1321 int err;
1318 1322
1319 sync_filesystem(sb); 1323 sync_filesystem(sb);
1320 spin_lock(&sbi->s_lock);
1321 1324
1322 /* Store the old options */ 1325 spin_lock(&sbi->s_lock);
1323 old_sb_flags = sb->s_flags; 1326 new_opts.s_mount_opt = sbi->s_mount_opt;
1324 old_opts.s_mount_opt = sbi->s_mount_opt; 1327 new_opts.s_resuid = sbi->s_resuid;
1325 old_opts.s_resuid = sbi->s_resuid; 1328 new_opts.s_resgid = sbi->s_resgid;
1326 old_opts.s_resgid = sbi->s_resgid; 1329 spin_unlock(&sbi->s_lock);
1327 1330
1328 /* 1331 /*
1329 * Allow the "check" option to be passed as a remount option. 1332 * Allow the "check" option to be passed as a remount option.
1330 */ 1333 */
1331 if (!parse_options(data, sb)) { 1334 if (!parse_options(data, sb, &new_opts))
1332 err = -EINVAL; 1335 return -EINVAL;
1333 goto restore_opts;
1334 }
1335
1336 sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
1337 ((sbi->s_mount_opt & EXT2_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0);
1338 1336
1337 spin_lock(&sbi->s_lock);
1339 es = sbi->s_es; 1338 es = sbi->s_es;
1340 if ((sbi->s_mount_opt ^ old_opts.s_mount_opt) & EXT2_MOUNT_DAX) { 1339 if ((sbi->s_mount_opt ^ new_opts.s_mount_opt) & EXT2_MOUNT_DAX) {
1341 ext2_msg(sb, KERN_WARNING, "warning: refusing change of " 1340 ext2_msg(sb, KERN_WARNING, "warning: refusing change of "
1342 "dax flag with busy inodes while remounting"); 1341 "dax flag with busy inodes while remounting");
1343 sbi->s_mount_opt ^= EXT2_MOUNT_DAX; 1342 new_opts.s_mount_opt ^= EXT2_MOUNT_DAX;
1344 }
1345 if ((bool)(*flags & MS_RDONLY) == sb_rdonly(sb)) {
1346 spin_unlock(&sbi->s_lock);
1347 return 0;
1348 } 1343 }
1344 if ((bool)(*flags & MS_RDONLY) == sb_rdonly(sb))
1345 goto out_set;
1349 if (*flags & MS_RDONLY) { 1346 if (*flags & MS_RDONLY) {
1350 if (le16_to_cpu(es->s_state) & EXT2_VALID_FS || 1347 if (le16_to_cpu(es->s_state) & EXT2_VALID_FS ||
1351 !(sbi->s_mount_state & EXT2_VALID_FS)) { 1348 !(sbi->s_mount_state & EXT2_VALID_FS))
1352 spin_unlock(&sbi->s_lock); 1349 goto out_set;
1353 return 0;
1354 }
1355 1350
1356 /* 1351 /*
1357 * OK, we are remounting a valid rw partition rdonly, so set 1352 * OK, we are remounting a valid rw partition rdonly, so set
@@ -1362,22 +1357,20 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data)
1362 spin_unlock(&sbi->s_lock); 1357 spin_unlock(&sbi->s_lock);
1363 1358
1364 err = dquot_suspend(sb, -1); 1359 err = dquot_suspend(sb, -1);
1365 if (err < 0) { 1360 if (err < 0)
1366 spin_lock(&sbi->s_lock); 1361 return err;
1367 goto restore_opts;
1368 }
1369 1362
1370 ext2_sync_super(sb, es, 1); 1363 ext2_sync_super(sb, es, 1);
1371 } else { 1364 } else {
1372 __le32 ret = EXT2_HAS_RO_COMPAT_FEATURE(sb, 1365 __le32 ret = EXT2_HAS_RO_COMPAT_FEATURE(sb,
1373 ~EXT2_FEATURE_RO_COMPAT_SUPP); 1366 ~EXT2_FEATURE_RO_COMPAT_SUPP);
1374 if (ret) { 1367 if (ret) {
1368 spin_unlock(&sbi->s_lock);
1375 ext2_msg(sb, KERN_WARNING, 1369 ext2_msg(sb, KERN_WARNING,
1376 "warning: couldn't remount RDWR because of " 1370 "warning: couldn't remount RDWR because of "
1377 "unsupported optional features (%x).", 1371 "unsupported optional features (%x).",
1378 le32_to_cpu(ret)); 1372 le32_to_cpu(ret));
1379 err = -EROFS; 1373 return -EROFS;
1380 goto restore_opts;
1381 } 1374 }
1382 /* 1375 /*
1383 * Mounting a RDONLY partition read-write, so reread and 1376 * Mounting a RDONLY partition read-write, so reread and
@@ -1394,14 +1387,16 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data)
1394 dquot_resume(sb, -1); 1387 dquot_resume(sb, -1);
1395 } 1388 }
1396 1389
1397 return 0; 1390 spin_lock(&sbi->s_lock);
1398restore_opts: 1391out_set:
1399 sbi->s_mount_opt = old_opts.s_mount_opt; 1392 sbi->s_mount_opt = new_opts.s_mount_opt;
1400 sbi->s_resuid = old_opts.s_resuid; 1393 sbi->s_resuid = new_opts.s_resuid;
1401 sbi->s_resgid = old_opts.s_resgid; 1394 sbi->s_resgid = new_opts.s_resgid;
1402 sb->s_flags = old_sb_flags; 1395 sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
1396 ((sbi->s_mount_opt & EXT2_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0);
1403 spin_unlock(&sbi->s_lock); 1397 spin_unlock(&sbi->s_lock);
1404 return err; 1398
1399 return 0;
1405} 1400}
1406 1401
1407static int ext2_statfs (struct dentry * dentry, struct kstatfs * buf) 1402static int ext2_statfs (struct dentry * dentry, struct kstatfs * buf)
diff --git a/fs/isofs/isofs.h b/fs/isofs/isofs.h
index 133a456b0425..c882f207dd5c 100644
--- a/fs/isofs/isofs.h
+++ b/fs/isofs/isofs.h
@@ -72,41 +72,41 @@ static inline struct iso_inode_info *ISOFS_I(struct inode *inode)
72 return container_of(inode, struct iso_inode_info, vfs_inode); 72 return container_of(inode, struct iso_inode_info, vfs_inode);
73} 73}
74 74
75static inline int isonum_711(char *p) 75static inline int isonum_711(u8 *p)
76{ 76{
77 return *(u8 *)p; 77 return *p;
78} 78}
79static inline int isonum_712(char *p) 79static inline int isonum_712(s8 *p)
80{ 80{
81 return *(s8 *)p; 81 return *p;
82} 82}
83static inline unsigned int isonum_721(char *p) 83static inline unsigned int isonum_721(u8 *p)
84{ 84{
85 return get_unaligned_le16(p); 85 return get_unaligned_le16(p);
86} 86}
87static inline unsigned int isonum_722(char *p) 87static inline unsigned int isonum_722(u8 *p)
88{ 88{
89 return get_unaligned_be16(p); 89 return get_unaligned_be16(p);
90} 90}
91static inline unsigned int isonum_723(char *p) 91static inline unsigned int isonum_723(u8 *p)
92{ 92{
93 /* Ignore bigendian datum due to broken mastering programs */ 93 /* Ignore bigendian datum due to broken mastering programs */
94 return get_unaligned_le16(p); 94 return get_unaligned_le16(p);
95} 95}
96static inline unsigned int isonum_731(char *p) 96static inline unsigned int isonum_731(u8 *p)
97{ 97{
98 return get_unaligned_le32(p); 98 return get_unaligned_le32(p);
99} 99}
100static inline unsigned int isonum_732(char *p) 100static inline unsigned int isonum_732(u8 *p)
101{ 101{
102 return get_unaligned_be32(p); 102 return get_unaligned_be32(p);
103} 103}
104static inline unsigned int isonum_733(char *p) 104static inline unsigned int isonum_733(u8 *p)
105{ 105{
106 /* Ignore bigendian datum due to broken mastering programs */ 106 /* Ignore bigendian datum due to broken mastering programs */
107 return get_unaligned_le32(p); 107 return get_unaligned_le32(p);
108} 108}
109extern int iso_date(char *, int); 109extern int iso_date(u8 *, int);
110 110
111struct inode; /* To make gcc happy */ 111struct inode; /* To make gcc happy */
112 112
diff --git a/fs/isofs/rock.h b/fs/isofs/rock.h
index ed09e2b08637..8780d67c6ca5 100644
--- a/fs/isofs/rock.h
+++ b/fs/isofs/rock.h
@@ -6,78 +6,78 @@
6 */ 6 */
7 7
8struct SU_SP_s { 8struct SU_SP_s {
9 unsigned char magic[2]; 9 __u8 magic[2];
10 unsigned char skip; 10 __u8 skip;
11} __attribute__ ((packed)); 11} __attribute__ ((packed));
12 12
13struct SU_CE_s { 13struct SU_CE_s {
14 char extent[8]; 14 __u8 extent[8];
15 char offset[8]; 15 __u8 offset[8];
16 char size[8]; 16 __u8 size[8];
17}; 17};
18 18
19struct SU_ER_s { 19struct SU_ER_s {
20 unsigned char len_id; 20 __u8 len_id;
21 unsigned char len_des; 21 __u8 len_des;
22 unsigned char len_src; 22 __u8 len_src;
23 unsigned char ext_ver; 23 __u8 ext_ver;
24 char data[0]; 24 __u8 data[0];
25} __attribute__ ((packed)); 25} __attribute__ ((packed));
26 26
27struct RR_RR_s { 27struct RR_RR_s {
28 char flags[1]; 28 __u8 flags[1];
29} __attribute__ ((packed)); 29} __attribute__ ((packed));
30 30
31struct RR_PX_s { 31struct RR_PX_s {
32 char mode[8]; 32 __u8 mode[8];
33 char n_links[8]; 33 __u8 n_links[8];
34 char uid[8]; 34 __u8 uid[8];
35 char gid[8]; 35 __u8 gid[8];
36}; 36};
37 37
38struct RR_PN_s { 38struct RR_PN_s {
39 char dev_high[8]; 39 __u8 dev_high[8];
40 char dev_low[8]; 40 __u8 dev_low[8];
41}; 41};
42 42
43struct SL_component { 43struct SL_component {
44 unsigned char flags; 44 __u8 flags;
45 unsigned char len; 45 __u8 len;
46 char text[0]; 46 __u8 text[0];
47} __attribute__ ((packed)); 47} __attribute__ ((packed));
48 48
49struct RR_SL_s { 49struct RR_SL_s {
50 unsigned char flags; 50 __u8 flags;
51 struct SL_component link; 51 struct SL_component link;
52} __attribute__ ((packed)); 52} __attribute__ ((packed));
53 53
54struct RR_NM_s { 54struct RR_NM_s {
55 unsigned char flags; 55 __u8 flags;
56 char name[0]; 56 char name[0];
57} __attribute__ ((packed)); 57} __attribute__ ((packed));
58 58
59struct RR_CL_s { 59struct RR_CL_s {
60 char location[8]; 60 __u8 location[8];
61}; 61};
62 62
63struct RR_PL_s { 63struct RR_PL_s {
64 char location[8]; 64 __u8 location[8];
65}; 65};
66 66
67struct stamp { 67struct stamp {
68 char time[7]; 68 __u8 time[7]; /* actually 6 unsigned, 1 signed */
69} __attribute__ ((packed)); 69} __attribute__ ((packed));
70 70
71struct RR_TF_s { 71struct RR_TF_s {
72 char flags; 72 __u8 flags;
73 struct stamp times[0]; /* Variable number of these beasts */ 73 struct stamp times[0]; /* Variable number of these beasts */
74} __attribute__ ((packed)); 74} __attribute__ ((packed));
75 75
76/* Linux-specific extension for transparent decompression */ 76/* Linux-specific extension for transparent decompression */
77struct RR_ZF_s { 77struct RR_ZF_s {
78 char algorithm[2]; 78 __u8 algorithm[2];
79 char parms[2]; 79 __u8 parms[2];
80 char real_size[8]; 80 __u8 real_size[8];
81}; 81};
82 82
83/* 83/*
@@ -93,9 +93,9 @@ struct RR_ZF_s {
93#define TF_LONG_FORM 128 93#define TF_LONG_FORM 128
94 94
95struct rock_ridge { 95struct rock_ridge {
96 char signature[2]; 96 __u8 signature[2];
97 unsigned char len; 97 __u8 len;
98 unsigned char version; 98 __u8 version;
99 union { 99 union {
100 struct SU_SP_s SP; 100 struct SU_SP_s SP;
101 struct SU_CE_s CE; 101 struct SU_CE_s CE;
diff --git a/fs/isofs/util.c b/fs/isofs/util.c
index 005a15cfd30a..37860fea364d 100644
--- a/fs/isofs/util.c
+++ b/fs/isofs/util.c
@@ -15,7 +15,7 @@
15 * to GMT. Thus we should always be correct. 15 * to GMT. Thus we should always be correct.
16 */ 16 */
17 17
18int iso_date(char * p, int flag) 18int iso_date(u8 *p, int flag)
19{ 19{
20 int year, month, day, hour, minute, second, tz; 20 int year, month, day, hour, minute, second, tz;
21 int crtime; 21 int crtime;
diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c
index 2fa99aeaa095..1968d21a3f37 100644
--- a/fs/notify/fanotify/fanotify.c
+++ b/fs/notify/fanotify/fanotify.c
@@ -9,6 +9,7 @@
9#include <linux/sched/user.h> 9#include <linux/sched/user.h>
10#include <linux/types.h> 10#include <linux/types.h>
11#include <linux/wait.h> 11#include <linux/wait.h>
12#include <linux/audit.h>
12 13
13#include "fanotify.h" 14#include "fanotify.h"
14 15
@@ -78,7 +79,7 @@ static int fanotify_get_response(struct fsnotify_group *group,
78 fsnotify_finish_user_wait(iter_info); 79 fsnotify_finish_user_wait(iter_info);
79out: 80out:
80 /* userspace responded, convert to something usable */ 81 /* userspace responded, convert to something usable */
81 switch (event->response) { 82 switch (event->response & ~FAN_AUDIT) {
82 case FAN_ALLOW: 83 case FAN_ALLOW:
83 ret = 0; 84 ret = 0;
84 break; 85 break;
@@ -86,6 +87,11 @@ out:
86 default: 87 default:
87 ret = -EPERM; 88 ret = -EPERM;
88 } 89 }
90
91 /* Check if the response should be audited */
92 if (event->response & FAN_AUDIT)
93 audit_fanotify(event->response & ~FAN_AUDIT);
94
89 event->response = 0; 95 event->response = 0;
90 96
91 pr_debug("%s: group=%p event=%p about to return ret=%d\n", __func__, 97 pr_debug("%s: group=%p event=%p about to return ret=%d\n", __func__,
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
index 907a481ac781..0455ea729384 100644
--- a/fs/notify/fanotify/fanotify_user.c
+++ b/fs/notify/fanotify/fanotify_user.c
@@ -179,7 +179,7 @@ static int process_access_response(struct fsnotify_group *group,
179 * userspace can send a valid response or we will clean it up after the 179 * userspace can send a valid response or we will clean it up after the
180 * timeout 180 * timeout
181 */ 181 */
182 switch (response) { 182 switch (response & ~FAN_AUDIT) {
183 case FAN_ALLOW: 183 case FAN_ALLOW:
184 case FAN_DENY: 184 case FAN_DENY:
185 break; 185 break;
@@ -190,6 +190,9 @@ static int process_access_response(struct fsnotify_group *group,
190 if (fd < 0) 190 if (fd < 0)
191 return -EINVAL; 191 return -EINVAL;
192 192
193 if ((response & FAN_AUDIT) && !group->fanotify_data.audit)
194 return -EINVAL;
195
193 event = dequeue_event(group, fd); 196 event = dequeue_event(group, fd);
194 if (!event) 197 if (!event)
195 return -ENOENT; 198 return -ENOENT;
@@ -721,7 +724,11 @@ SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags)
721 if (!capable(CAP_SYS_ADMIN)) 724 if (!capable(CAP_SYS_ADMIN))
722 return -EPERM; 725 return -EPERM;
723 726
727#ifdef CONFIG_AUDITSYSCALL
728 if (flags & ~(FAN_ALL_INIT_FLAGS | FAN_ENABLE_AUDIT))
729#else
724 if (flags & ~FAN_ALL_INIT_FLAGS) 730 if (flags & ~FAN_ALL_INIT_FLAGS)
731#endif
725 return -EINVAL; 732 return -EINVAL;
726 733
727 if (event_f_flags & ~FANOTIFY_INIT_ALL_EVENT_F_BITS) 734 if (event_f_flags & ~FANOTIFY_INIT_ALL_EVENT_F_BITS)
@@ -805,6 +812,13 @@ SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags)
805 group->fanotify_data.max_marks = FANOTIFY_DEFAULT_MAX_MARKS; 812 group->fanotify_data.max_marks = FANOTIFY_DEFAULT_MAX_MARKS;
806 } 813 }
807 814
815 if (flags & FAN_ENABLE_AUDIT) {
816 fd = -EPERM;
817 if (!capable(CAP_AUDIT_WRITE))
818 goto out_destroy_group;
819 group->fanotify_data.audit = true;
820 }
821
808 fd = anon_inode_getfd("[fanotify]", &fanotify_fops, group, f_flags); 822 fd = anon_inode_getfd("[fanotify]", &fanotify_fops, group, f_flags);
809 if (fd < 0) 823 if (fd < 0)
810 goto out_destroy_group; 824 goto out_destroy_group;
diff --git a/fs/notify/fdinfo.c b/fs/notify/fdinfo.c
index dd63aa9a6f9a..645ab561e790 100644
--- a/fs/notify/fdinfo.c
+++ b/fs/notify/fdinfo.c
@@ -156,6 +156,9 @@ void fanotify_show_fdinfo(struct seq_file *m, struct file *f)
156 if (group->fanotify_data.max_marks == UINT_MAX) 156 if (group->fanotify_data.max_marks == UINT_MAX)
157 flags |= FAN_UNLIMITED_MARKS; 157 flags |= FAN_UNLIMITED_MARKS;
158 158
159 if (group->fanotify_data.audit)
160 flags |= FAN_ENABLE_AUDIT;
161
159 seq_printf(m, "fanotify flags:%x event-flags:%x\n", 162 seq_printf(m, "fanotify flags:%x event-flags:%x\n",
160 flags, group->fanotify_data.f_flags); 163 flags, group->fanotify_data.f_flags);
161 164
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 52ad15192e72..5db18c0582c8 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -644,8 +644,15 @@ int dquot_writeback_dquots(struct super_block *sb, int type)
644 spin_unlock(&dq_list_lock); 644 spin_unlock(&dq_list_lock);
645 dqstats_inc(DQST_LOOKUPS); 645 dqstats_inc(DQST_LOOKUPS);
646 err = sb->dq_op->write_dquot(dquot); 646 err = sb->dq_op->write_dquot(dquot);
647 if (!ret && err) 647 if (err) {
648 ret = err; 648 /*
649 * Clear dirty bit anyway to avoid infinite
650 * loop here.
651 */
652 clear_dquot_dirty(dquot);
653 if (!ret)
654 ret = err;
655 }
649 dqput(dquot); 656 dqput(dquot);
650 spin_lock(&dq_list_lock); 657 spin_lock(&dq_list_lock);
651 } 658 }
@@ -2138,7 +2145,7 @@ int dquot_file_open(struct inode *inode, struct file *file)
2138 2145
2139 error = generic_file_open(inode, file); 2146 error = generic_file_open(inode, file);
2140 if (!error && (file->f_mode & FMODE_WRITE)) 2147 if (!error && (file->f_mode & FMODE_WRITE))
2141 dquot_initialize(inode); 2148 error = dquot_initialize(inode);
2142 return error; 2149 return error;
2143} 2150}
2144EXPORT_SYMBOL(dquot_file_open); 2151EXPORT_SYMBOL(dquot_file_open);
diff --git a/fs/udf/balloc.c b/fs/udf/balloc.c
index e0fd65fe73e8..1b961b1d9699 100644
--- a/fs/udf/balloc.c
+++ b/fs/udf/balloc.c
@@ -58,7 +58,7 @@ static int __load_block_bitmap(struct super_block *sb,
58 int nr_groups = bitmap->s_nr_groups; 58 int nr_groups = bitmap->s_nr_groups;
59 59
60 if (block_group >= nr_groups) { 60 if (block_group >= nr_groups) {
61 udf_debug("block_group (%d) > nr_groups (%d)\n", 61 udf_debug("block_group (%u) > nr_groups (%d)\n",
62 block_group, nr_groups); 62 block_group, nr_groups);
63 } 63 }
64 64
@@ -122,7 +122,7 @@ static void udf_bitmap_free_blocks(struct super_block *sb,
122 partmap = &sbi->s_partmaps[bloc->partitionReferenceNum]; 122 partmap = &sbi->s_partmaps[bloc->partitionReferenceNum];
123 if (bloc->logicalBlockNum + count < count || 123 if (bloc->logicalBlockNum + count < count ||
124 (bloc->logicalBlockNum + count) > partmap->s_partition_len) { 124 (bloc->logicalBlockNum + count) > partmap->s_partition_len) {
125 udf_debug("%d < %d || %d + %d > %d\n", 125 udf_debug("%u < %d || %u + %u > %u\n",
126 bloc->logicalBlockNum, 0, 126 bloc->logicalBlockNum, 0,
127 bloc->logicalBlockNum, count, 127 bloc->logicalBlockNum, count,
128 partmap->s_partition_len); 128 partmap->s_partition_len);
@@ -151,9 +151,9 @@ static void udf_bitmap_free_blocks(struct super_block *sb,
151 bh = bitmap->s_block_bitmap[bitmap_nr]; 151 bh = bitmap->s_block_bitmap[bitmap_nr];
152 for (i = 0; i < count; i++) { 152 for (i = 0; i < count; i++) {
153 if (udf_set_bit(bit + i, bh->b_data)) { 153 if (udf_set_bit(bit + i, bh->b_data)) {
154 udf_debug("bit %ld already set\n", bit + i); 154 udf_debug("bit %lu already set\n", bit + i);
155 udf_debug("byte=%2x\n", 155 udf_debug("byte=%2x\n",
156 ((char *)bh->b_data)[(bit + i) >> 3]); 156 ((__u8 *)bh->b_data)[(bit + i) >> 3]);
157 } 157 }
158 } 158 }
159 udf_add_free_space(sb, sbi->s_partition, count); 159 udf_add_free_space(sb, sbi->s_partition, count);
@@ -218,16 +218,18 @@ out:
218 return alloc_count; 218 return alloc_count;
219} 219}
220 220
221static int udf_bitmap_new_block(struct super_block *sb, 221static udf_pblk_t udf_bitmap_new_block(struct super_block *sb,
222 struct udf_bitmap *bitmap, uint16_t partition, 222 struct udf_bitmap *bitmap, uint16_t partition,
223 uint32_t goal, int *err) 223 uint32_t goal, int *err)
224{ 224{
225 struct udf_sb_info *sbi = UDF_SB(sb); 225 struct udf_sb_info *sbi = UDF_SB(sb);
226 int newbit, bit = 0, block, block_group, group_start; 226 int newbit, bit = 0;
227 udf_pblk_t block;
228 int block_group, group_start;
227 int end_goal, nr_groups, bitmap_nr, i; 229 int end_goal, nr_groups, bitmap_nr, i;
228 struct buffer_head *bh = NULL; 230 struct buffer_head *bh = NULL;
229 char *ptr; 231 char *ptr;
230 int newblock = 0; 232 udf_pblk_t newblock = 0;
231 233
232 *err = -ENOSPC; 234 *err = -ENOSPC;
233 mutex_lock(&sbi->s_alloc_mutex); 235 mutex_lock(&sbi->s_alloc_mutex);
@@ -362,7 +364,7 @@ static void udf_table_free_blocks(struct super_block *sb,
362 partmap = &sbi->s_partmaps[bloc->partitionReferenceNum]; 364 partmap = &sbi->s_partmaps[bloc->partitionReferenceNum];
363 if (bloc->logicalBlockNum + count < count || 365 if (bloc->logicalBlockNum + count < count ||
364 (bloc->logicalBlockNum + count) > partmap->s_partition_len) { 366 (bloc->logicalBlockNum + count) > partmap->s_partition_len) {
365 udf_debug("%d < %d || %d + %d > %d\n", 367 udf_debug("%u < %d || %u + %u > %u\n",
366 bloc->logicalBlockNum, 0, 368 bloc->logicalBlockNum, 0,
367 bloc->logicalBlockNum, count, 369 bloc->logicalBlockNum, count,
368 partmap->s_partition_len); 370 partmap->s_partition_len);
@@ -515,7 +517,7 @@ static int udf_table_prealloc_blocks(struct super_block *sb,
515 517
516 while (first_block != eloc.logicalBlockNum && 518 while (first_block != eloc.logicalBlockNum &&
517 (etype = udf_next_aext(table, &epos, &eloc, &elen, 1)) != -1) { 519 (etype = udf_next_aext(table, &epos, &eloc, &elen, 1)) != -1) {
518 udf_debug("eloc=%d, elen=%d, first_block=%d\n", 520 udf_debug("eloc=%u, elen=%u, first_block=%u\n",
519 eloc.logicalBlockNum, elen, first_block); 521 eloc.logicalBlockNum, elen, first_block);
520 ; /* empty loop body */ 522 ; /* empty loop body */
521 } 523 }
@@ -545,13 +547,14 @@ static int udf_table_prealloc_blocks(struct super_block *sb,
545 return alloc_count; 547 return alloc_count;
546} 548}
547 549
548static int udf_table_new_block(struct super_block *sb, 550static udf_pblk_t udf_table_new_block(struct super_block *sb,
549 struct inode *table, uint16_t partition, 551 struct inode *table, uint16_t partition,
550 uint32_t goal, int *err) 552 uint32_t goal, int *err)
551{ 553{
552 struct udf_sb_info *sbi = UDF_SB(sb); 554 struct udf_sb_info *sbi = UDF_SB(sb);
553 uint32_t spread = 0xFFFFFFFF, nspread = 0xFFFFFFFF; 555 uint32_t spread = 0xFFFFFFFF, nspread = 0xFFFFFFFF;
554 uint32_t newblock = 0, adsize; 556 udf_pblk_t newblock = 0;
557 uint32_t adsize;
555 uint32_t elen, goal_elen = 0; 558 uint32_t elen, goal_elen = 0;
556 struct kernel_lb_addr eloc, uninitialized_var(goal_eloc); 559 struct kernel_lb_addr eloc, uninitialized_var(goal_eloc);
557 struct extent_position epos, goal_epos; 560 struct extent_position epos, goal_epos;
@@ -700,12 +703,12 @@ inline int udf_prealloc_blocks(struct super_block *sb,
700 return allocated; 703 return allocated;
701} 704}
702 705
703inline int udf_new_block(struct super_block *sb, 706inline udf_pblk_t udf_new_block(struct super_block *sb,
704 struct inode *inode, 707 struct inode *inode,
705 uint16_t partition, uint32_t goal, int *err) 708 uint16_t partition, uint32_t goal, int *err)
706{ 709{
707 struct udf_part_map *map = &UDF_SB(sb)->s_partmaps[partition]; 710 struct udf_part_map *map = &UDF_SB(sb)->s_partmaps[partition];
708 int block; 711 udf_pblk_t block;
709 712
710 if (map->s_partition_flags & UDF_PART_FLAG_UNALLOC_BITMAP) 713 if (map->s_partition_flags & UDF_PART_FLAG_UNALLOC_BITMAP)
711 block = udf_bitmap_new_block(sb, 714 block = udf_bitmap_new_block(sb,
diff --git a/fs/udf/dir.c b/fs/udf/dir.c
index 2d0e028067eb..c19dba45aa20 100644
--- a/fs/udf/dir.c
+++ b/fs/udf/dir.c
@@ -43,7 +43,7 @@ static int udf_readdir(struct file *file, struct dir_context *ctx)
43 struct udf_fileident_bh fibh = { .sbh = NULL, .ebh = NULL}; 43 struct udf_fileident_bh fibh = { .sbh = NULL, .ebh = NULL};
44 struct fileIdentDesc *fi = NULL; 44 struct fileIdentDesc *fi = NULL;
45 struct fileIdentDesc cfi; 45 struct fileIdentDesc cfi;
46 int block, iblock; 46 udf_pblk_t block, iblock;
47 loff_t nf_pos; 47 loff_t nf_pos;
48 int flen; 48 int flen;
49 unsigned char *fname = NULL, *copy_name = NULL; 49 unsigned char *fname = NULL, *copy_name = NULL;
diff --git a/fs/udf/directory.c b/fs/udf/directory.c
index 7aa48bd7cbaf..0a98a2369738 100644
--- a/fs/udf/directory.c
+++ b/fs/udf/directory.c
@@ -26,7 +26,8 @@ struct fileIdentDesc *udf_fileident_read(struct inode *dir, loff_t *nf_pos,
26 sector_t *offset) 26 sector_t *offset)
27{ 27{
28 struct fileIdentDesc *fi; 28 struct fileIdentDesc *fi;
29 int i, num, block; 29 int i, num;
30 udf_pblk_t block;
30 struct buffer_head *tmp, *bha[16]; 31 struct buffer_head *tmp, *bha[16];
31 struct udf_inode_info *iinfo = UDF_I(dir); 32 struct udf_inode_info *iinfo = UDF_I(dir);
32 33
@@ -51,7 +52,7 @@ struct fileIdentDesc *udf_fileident_read(struct inode *dir, loff_t *nf_pos,
51 } 52 }
52 53
53 if (fibh->eoffset == dir->i_sb->s_blocksize) { 54 if (fibh->eoffset == dir->i_sb->s_blocksize) {
54 int lextoffset = epos->offset; 55 uint32_t lextoffset = epos->offset;
55 unsigned char blocksize_bits = dir->i_sb->s_blocksize_bits; 56 unsigned char blocksize_bits = dir->i_sb->s_blocksize_bits;
56 57
57 if (udf_next_aext(dir, epos, eloc, elen, 1) != 58 if (udf_next_aext(dir, epos, eloc, elen, 1) !=
@@ -110,7 +111,7 @@ struct fileIdentDesc *udf_fileident_read(struct inode *dir, loff_t *nf_pos,
110 memcpy((uint8_t *)cfi, (uint8_t *)fi, 111 memcpy((uint8_t *)cfi, (uint8_t *)fi,
111 sizeof(struct fileIdentDesc)); 112 sizeof(struct fileIdentDesc));
112 } else if (fibh->eoffset > dir->i_sb->s_blocksize) { 113 } else if (fibh->eoffset > dir->i_sb->s_blocksize) {
113 int lextoffset = epos->offset; 114 uint32_t lextoffset = epos->offset;
114 115
115 if (udf_next_aext(dir, epos, eloc, elen, 1) != 116 if (udf_next_aext(dir, epos, eloc, elen, 1) !=
116 (EXT_RECORDED_ALLOCATED >> 30)) 117 (EXT_RECORDED_ALLOCATED >> 30))
@@ -175,7 +176,7 @@ struct fileIdentDesc *udf_get_fileident(void *buffer, int bufsize, int *offset)
175 if (fi->descTag.tagIdent != cpu_to_le16(TAG_IDENT_FID)) { 176 if (fi->descTag.tagIdent != cpu_to_le16(TAG_IDENT_FID)) {
176 udf_debug("0x%x != TAG_IDENT_FID\n", 177 udf_debug("0x%x != TAG_IDENT_FID\n",
177 le16_to_cpu(fi->descTag.tagIdent)); 178 le16_to_cpu(fi->descTag.tagIdent));
178 udf_debug("offset: %u sizeof: %lu bufsize: %u\n", 179 udf_debug("offset: %d sizeof: %lu bufsize: %d\n",
179 *offset, (unsigned long)sizeof(struct fileIdentDesc), 180 *offset, (unsigned long)sizeof(struct fileIdentDesc),
180 bufsize); 181 bufsize);
181 return NULL; 182 return NULL;
diff --git a/fs/udf/ialloc.c b/fs/udf/ialloc.c
index c1ed18a10ce4..b6e420c1bfeb 100644
--- a/fs/udf/ialloc.c
+++ b/fs/udf/ialloc.c
@@ -50,7 +50,7 @@ struct inode *udf_new_inode(struct inode *dir, umode_t mode)
50 struct super_block *sb = dir->i_sb; 50 struct super_block *sb = dir->i_sb;
51 struct udf_sb_info *sbi = UDF_SB(sb); 51 struct udf_sb_info *sbi = UDF_SB(sb);
52 struct inode *inode; 52 struct inode *inode;
53 int block; 53 udf_pblk_t block;
54 uint32_t start = UDF_I(dir)->i_location.logicalBlockNum; 54 uint32_t start = UDF_I(dir)->i_location.logicalBlockNum;
55 struct udf_inode_info *iinfo; 55 struct udf_inode_info *iinfo;
56 struct udf_inode_info *dinfo = UDF_I(dir); 56 struct udf_inode_info *dinfo = UDF_I(dir);
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index 8dacf4f57414..c23744d5ae5c 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -52,7 +52,7 @@ static int udf_alloc_i_data(struct inode *inode, size_t size);
52static sector_t inode_getblk(struct inode *, sector_t, int *, int *); 52static sector_t inode_getblk(struct inode *, sector_t, int *, int *);
53static int8_t udf_insert_aext(struct inode *, struct extent_position, 53static int8_t udf_insert_aext(struct inode *, struct extent_position,
54 struct kernel_lb_addr, uint32_t); 54 struct kernel_lb_addr, uint32_t);
55static void udf_split_extents(struct inode *, int *, int, int, 55static void udf_split_extents(struct inode *, int *, int, udf_pblk_t,
56 struct kernel_long_ad *, int *); 56 struct kernel_long_ad *, int *);
57static void udf_prealloc_extents(struct inode *, int, int, 57static void udf_prealloc_extents(struct inode *, int, int,
58 struct kernel_long_ad *, int *); 58 struct kernel_long_ad *, int *);
@@ -316,10 +316,10 @@ int udf_expand_file_adinicb(struct inode *inode)
316 return err; 316 return err;
317} 317}
318 318
319struct buffer_head *udf_expand_dir_adinicb(struct inode *inode, int *block, 319struct buffer_head *udf_expand_dir_adinicb(struct inode *inode,
320 int *err) 320 udf_pblk_t *block, int *err)
321{ 321{
322 int newblock; 322 udf_pblk_t newblock;
323 struct buffer_head *dbh = NULL; 323 struct buffer_head *dbh = NULL;
324 struct kernel_lb_addr eloc; 324 struct kernel_lb_addr eloc;
325 uint8_t alloctype; 325 uint8_t alloctype;
@@ -446,7 +446,7 @@ abort:
446 return err; 446 return err;
447} 447}
448 448
449static struct buffer_head *udf_getblk(struct inode *inode, long block, 449static struct buffer_head *udf_getblk(struct inode *inode, udf_pblk_t block,
450 int create, int *err) 450 int create, int *err)
451{ 451{
452 struct buffer_head *bh; 452 struct buffer_head *bh;
@@ -480,7 +480,7 @@ static int udf_do_extend_file(struct inode *inode,
480 int count = 0, fake = !(last_ext->extLength & UDF_EXTENT_LENGTH_MASK); 480 int count = 0, fake = !(last_ext->extLength & UDF_EXTENT_LENGTH_MASK);
481 struct super_block *sb = inode->i_sb; 481 struct super_block *sb = inode->i_sb;
482 struct kernel_lb_addr prealloc_loc = {}; 482 struct kernel_lb_addr prealloc_loc = {};
483 int prealloc_len = 0; 483 uint32_t prealloc_len = 0;
484 struct udf_inode_info *iinfo; 484 struct udf_inode_info *iinfo;
485 int err; 485 int err;
486 486
@@ -663,11 +663,11 @@ static sector_t inode_getblk(struct inode *inode, sector_t block,
663 struct kernel_lb_addr eloc, tmpeloc; 663 struct kernel_lb_addr eloc, tmpeloc;
664 int c = 1; 664 int c = 1;
665 loff_t lbcount = 0, b_off = 0; 665 loff_t lbcount = 0, b_off = 0;
666 uint32_t newblocknum, newblock; 666 udf_pblk_t newblocknum, newblock;
667 sector_t offset = 0; 667 sector_t offset = 0;
668 int8_t etype; 668 int8_t etype;
669 struct udf_inode_info *iinfo = UDF_I(inode); 669 struct udf_inode_info *iinfo = UDF_I(inode);
670 int goal = 0, pgoal = iinfo->i_location.logicalBlockNum; 670 udf_pblk_t goal = 0, pgoal = iinfo->i_location.logicalBlockNum;
671 int lastblock = 0; 671 int lastblock = 0;
672 bool isBeyondEOF; 672 bool isBeyondEOF;
673 673
@@ -879,8 +879,8 @@ out_free:
879} 879}
880 880
881static void udf_split_extents(struct inode *inode, int *c, int offset, 881static void udf_split_extents(struct inode *inode, int *c, int offset,
882 int newblocknum, struct kernel_long_ad *laarr, 882 udf_pblk_t newblocknum,
883 int *endnum) 883 struct kernel_long_ad *laarr, int *endnum)
884{ 884{
885 unsigned long blocksize = inode->i_sb->s_blocksize; 885 unsigned long blocksize = inode->i_sb->s_blocksize;
886 unsigned char blocksize_bits = inode->i_sb->s_blocksize_bits; 886 unsigned char blocksize_bits = inode->i_sb->s_blocksize_bits;
@@ -1166,7 +1166,7 @@ static void udf_update_extents(struct inode *inode, struct kernel_long_ad *laarr
1166 } 1166 }
1167} 1167}
1168 1168
1169struct buffer_head *udf_bread(struct inode *inode, int block, 1169struct buffer_head *udf_bread(struct inode *inode, udf_pblk_t block,
1170 int create, int *err) 1170 int create, int *err)
1171{ 1171{
1172 struct buffer_head *bh = NULL; 1172 struct buffer_head *bh = NULL;
@@ -1193,7 +1193,7 @@ int udf_setsize(struct inode *inode, loff_t newsize)
1193{ 1193{
1194 int err; 1194 int err;
1195 struct udf_inode_info *iinfo; 1195 struct udf_inode_info *iinfo;
1196 int bsize = i_blocksize(inode); 1196 unsigned int bsize = i_blocksize(inode);
1197 1197
1198 if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) || 1198 if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
1199 S_ISLNK(inode->i_mode))) 1199 S_ISLNK(inode->i_mode)))
@@ -1278,14 +1278,14 @@ static int udf_read_inode(struct inode *inode, bool hidden_inode)
1278 1278
1279reread: 1279reread:
1280 if (iloc->partitionReferenceNum >= sbi->s_partitions) { 1280 if (iloc->partitionReferenceNum >= sbi->s_partitions) {
1281 udf_debug("partition reference: %d > logical volume partitions: %d\n", 1281 udf_debug("partition reference: %u > logical volume partitions: %u\n",
1282 iloc->partitionReferenceNum, sbi->s_partitions); 1282 iloc->partitionReferenceNum, sbi->s_partitions);
1283 return -EIO; 1283 return -EIO;
1284 } 1284 }
1285 1285
1286 if (iloc->logicalBlockNum >= 1286 if (iloc->logicalBlockNum >=
1287 sbi->s_partmaps[iloc->partitionReferenceNum].s_partition_len) { 1287 sbi->s_partmaps[iloc->partitionReferenceNum].s_partition_len) {
1288 udf_debug("block=%d, partition=%d out of range\n", 1288 udf_debug("block=%u, partition=%u out of range\n",
1289 iloc->logicalBlockNum, iloc->partitionReferenceNum); 1289 iloc->logicalBlockNum, iloc->partitionReferenceNum);
1290 return -EIO; 1290 return -EIO;
1291 } 1291 }
@@ -1304,13 +1304,13 @@ reread:
1304 */ 1304 */
1305 bh = udf_read_ptagged(inode->i_sb, iloc, 0, &ident); 1305 bh = udf_read_ptagged(inode->i_sb, iloc, 0, &ident);
1306 if (!bh) { 1306 if (!bh) {
1307 udf_err(inode->i_sb, "(ino %ld) failed !bh\n", inode->i_ino); 1307 udf_err(inode->i_sb, "(ino %lu) failed !bh\n", inode->i_ino);
1308 return -EIO; 1308 return -EIO;
1309 } 1309 }
1310 1310
1311 if (ident != TAG_IDENT_FE && ident != TAG_IDENT_EFE && 1311 if (ident != TAG_IDENT_FE && ident != TAG_IDENT_EFE &&
1312 ident != TAG_IDENT_USE) { 1312 ident != TAG_IDENT_USE) {
1313 udf_err(inode->i_sb, "(ino %ld) failed ident=%d\n", 1313 udf_err(inode->i_sb, "(ino %lu) failed ident=%u\n",
1314 inode->i_ino, ident); 1314 inode->i_ino, ident);
1315 goto out; 1315 goto out;
1316 } 1316 }
@@ -1346,7 +1346,7 @@ reread:
1346 } 1346 }
1347 brelse(ibh); 1347 brelse(ibh);
1348 } else if (fe->icbTag.strategyType != cpu_to_le16(4)) { 1348 } else if (fe->icbTag.strategyType != cpu_to_le16(4)) {
1349 udf_err(inode->i_sb, "unsupported strategy type: %d\n", 1349 udf_err(inode->i_sb, "unsupported strategy type: %u\n",
1350 le16_to_cpu(fe->icbTag.strategyType)); 1350 le16_to_cpu(fe->icbTag.strategyType));
1351 goto out; 1351 goto out;
1352 } 1352 }
@@ -1547,7 +1547,7 @@ reread:
1547 udf_debug("METADATA BITMAP FILE-----\n"); 1547 udf_debug("METADATA BITMAP FILE-----\n");
1548 break; 1548 break;
1549 default: 1549 default:
1550 udf_err(inode->i_sb, "(ino %ld) failed unknown file type=%d\n", 1550 udf_err(inode->i_sb, "(ino %lu) failed unknown file type=%u\n",
1551 inode->i_ino, fe->icbTag.fileType); 1551 inode->i_ino, fe->icbTag.fileType);
1552 goto out; 1552 goto out;
1553 } 1553 }
@@ -1852,7 +1852,7 @@ struct inode *__udf_iget(struct super_block *sb, struct kernel_lb_addr *ino,
1852 return inode; 1852 return inode;
1853} 1853}
1854 1854
1855int udf_setup_indirect_aext(struct inode *inode, int block, 1855int udf_setup_indirect_aext(struct inode *inode, udf_pblk_t block,
1856 struct extent_position *epos) 1856 struct extent_position *epos)
1857{ 1857{
1858 struct super_block *sb = inode->i_sb; 1858 struct super_block *sb = inode->i_sb;
@@ -1994,7 +1994,7 @@ int udf_add_aext(struct inode *inode, struct extent_position *epos,
1994 1994
1995 if (epos->offset + (2 * adsize) > sb->s_blocksize) { 1995 if (epos->offset + (2 * adsize) > sb->s_blocksize) {
1996 int err; 1996 int err;
1997 int new_block; 1997 udf_pblk_t new_block;
1998 1998
1999 new_block = udf_new_block(sb, NULL, 1999 new_block = udf_new_block(sb, NULL,
2000 epos->block.partitionReferenceNum, 2000 epos->block.partitionReferenceNum,
@@ -2076,7 +2076,7 @@ int8_t udf_next_aext(struct inode *inode, struct extent_position *epos,
2076 2076
2077 while ((etype = udf_current_aext(inode, epos, eloc, elen, inc)) == 2077 while ((etype = udf_current_aext(inode, epos, eloc, elen, inc)) ==
2078 (EXT_NEXT_EXTENT_ALLOCDECS >> 30)) { 2078 (EXT_NEXT_EXTENT_ALLOCDECS >> 30)) {
2079 int block; 2079 udf_pblk_t block;
2080 2080
2081 if (++indirections > UDF_MAX_INDIR_EXTS) { 2081 if (++indirections > UDF_MAX_INDIR_EXTS) {
2082 udf_err(inode->i_sb, 2082 udf_err(inode->i_sb,
@@ -2091,7 +2091,7 @@ int8_t udf_next_aext(struct inode *inode, struct extent_position *epos,
2091 block = udf_get_lb_pblock(inode->i_sb, &epos->block, 0); 2091 block = udf_get_lb_pblock(inode->i_sb, &epos->block, 0);
2092 epos->bh = udf_tread(inode->i_sb, block); 2092 epos->bh = udf_tread(inode->i_sb, block);
2093 if (!epos->bh) { 2093 if (!epos->bh) {
2094 udf_debug("reading block %d failed!\n", block); 2094 udf_debug("reading block %u failed!\n", block);
2095 return -1; 2095 return -1;
2096 } 2096 }
2097 } 2097 }
@@ -2146,7 +2146,7 @@ int8_t udf_current_aext(struct inode *inode, struct extent_position *epos,
2146 *elen = le32_to_cpu(lad->extLength) & UDF_EXTENT_LENGTH_MASK; 2146 *elen = le32_to_cpu(lad->extLength) & UDF_EXTENT_LENGTH_MASK;
2147 break; 2147 break;
2148 default: 2148 default:
2149 udf_debug("alloc_type = %d unsupported\n", iinfo->i_alloc_type); 2149 udf_debug("alloc_type = %u unsupported\n", iinfo->i_alloc_type);
2150 return -1; 2150 return -1;
2151 } 2151 }
2152 2152
@@ -2289,13 +2289,13 @@ int8_t inode_bmap(struct inode *inode, sector_t block,
2289 return etype; 2289 return etype;
2290} 2290}
2291 2291
2292long udf_block_map(struct inode *inode, sector_t block) 2292udf_pblk_t udf_block_map(struct inode *inode, sector_t block)
2293{ 2293{
2294 struct kernel_lb_addr eloc; 2294 struct kernel_lb_addr eloc;
2295 uint32_t elen; 2295 uint32_t elen;
2296 sector_t offset; 2296 sector_t offset;
2297 struct extent_position epos = {}; 2297 struct extent_position epos = {};
2298 int ret; 2298 udf_pblk_t ret;
2299 2299
2300 down_read(&UDF_I(inode)->i_data_sem); 2300 down_read(&UDF_I(inode)->i_data_sem);
2301 2301
diff --git a/fs/udf/misc.c b/fs/udf/misc.c
index 3949c4bec3a3..401e64cde1be 100644
--- a/fs/udf/misc.c
+++ b/fs/udf/misc.c
@@ -28,7 +28,7 @@
28#include "udf_i.h" 28#include "udf_i.h"
29#include "udf_sb.h" 29#include "udf_sb.h"
30 30
31struct buffer_head *udf_tgetblk(struct super_block *sb, int block) 31struct buffer_head *udf_tgetblk(struct super_block *sb, udf_pblk_t block)
32{ 32{
33 if (UDF_QUERY_FLAG(sb, UDF_FLAG_VARCONV)) 33 if (UDF_QUERY_FLAG(sb, UDF_FLAG_VARCONV))
34 return sb_getblk(sb, udf_fixed_to_variable(block)); 34 return sb_getblk(sb, udf_fixed_to_variable(block));
@@ -36,7 +36,7 @@ struct buffer_head *udf_tgetblk(struct super_block *sb, int block)
36 return sb_getblk(sb, block); 36 return sb_getblk(sb, block);
37} 37}
38 38
39struct buffer_head *udf_tread(struct super_block *sb, int block) 39struct buffer_head *udf_tread(struct super_block *sb, udf_pblk_t block)
40{ 40{
41 if (UDF_QUERY_FLAG(sb, UDF_FLAG_VARCONV)) 41 if (UDF_QUERY_FLAG(sb, UDF_FLAG_VARCONV))
42 return sb_bread(sb, udf_fixed_to_variable(block)); 42 return sb_bread(sb, udf_fixed_to_variable(block));
@@ -209,7 +209,7 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block,
209 209
210 bh = udf_tread(sb, block); 210 bh = udf_tread(sb, block);
211 if (!bh) { 211 if (!bh) {
212 udf_err(sb, "read failed, block=%u, location=%d\n", 212 udf_err(sb, "read failed, block=%u, location=%u\n",
213 block, location); 213 block, location);
214 return NULL; 214 return NULL;
215 } 215 }
@@ -247,7 +247,7 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block,
247 le16_to_cpu(tag_p->descCRCLength))) 247 le16_to_cpu(tag_p->descCRCLength)))
248 return bh; 248 return bh;
249 249
250 udf_debug("Crc failure block %d: crc = %d, crclen = %d\n", block, 250 udf_debug("Crc failure block %u: crc = %u, crclen = %u\n", block,
251 le16_to_cpu(tag_p->descCRC), 251 le16_to_cpu(tag_p->descCRC),
252 le16_to_cpu(tag_p->descCRCLength)); 252 le16_to_cpu(tag_p->descCRCLength));
253error_out: 253error_out:
diff --git a/fs/udf/namei.c b/fs/udf/namei.c
index 885198dfd9f8..0458dd47e105 100644
--- a/fs/udf/namei.c
+++ b/fs/udf/namei.c
@@ -164,7 +164,8 @@ static struct fileIdentDesc *udf_find_entry(struct inode *dir,
164{ 164{
165 struct fileIdentDesc *fi = NULL; 165 struct fileIdentDesc *fi = NULL;
166 loff_t f_pos; 166 loff_t f_pos;
167 int block, flen; 167 udf_pblk_t block;
168 int flen;
168 unsigned char *fname = NULL, *copy_name = NULL; 169 unsigned char *fname = NULL, *copy_name = NULL;
169 unsigned char *nameptr; 170 unsigned char *nameptr;
170 uint8_t lfi; 171 uint8_t lfi;
@@ -352,7 +353,7 @@ static struct fileIdentDesc *udf_add_entry(struct inode *dir,
352 int nfidlen; 353 int nfidlen;
353 uint8_t lfi; 354 uint8_t lfi;
354 uint16_t liu; 355 uint16_t liu;
355 int block; 356 udf_pblk_t block;
356 struct kernel_lb_addr eloc; 357 struct kernel_lb_addr eloc;
357 uint32_t elen = 0; 358 uint32_t elen = 0;
358 sector_t offset; 359 sector_t offset;
@@ -749,7 +750,7 @@ static int empty_dir(struct inode *dir)
749 struct udf_fileident_bh fibh; 750 struct udf_fileident_bh fibh;
750 loff_t f_pos; 751 loff_t f_pos;
751 loff_t size = udf_ext0_offset(dir) + dir->i_size; 752 loff_t size = udf_ext0_offset(dir) + dir->i_size;
752 int block; 753 udf_pblk_t block;
753 struct kernel_lb_addr eloc; 754 struct kernel_lb_addr eloc;
754 uint32_t elen; 755 uint32_t elen;
755 sector_t offset; 756 sector_t offset;
@@ -839,7 +840,7 @@ static int udf_rmdir(struct inode *dir, struct dentry *dentry)
839 if (retval) 840 if (retval)
840 goto end_rmdir; 841 goto end_rmdir;
841 if (inode->i_nlink != 2) 842 if (inode->i_nlink != 2)
842 udf_warn(inode->i_sb, "empty directory has nlink != 2 (%d)\n", 843 udf_warn(inode->i_sb, "empty directory has nlink != 2 (%u)\n",
843 inode->i_nlink); 844 inode->i_nlink);
844 clear_nlink(inode); 845 clear_nlink(inode);
845 inode->i_size = 0; 846 inode->i_size = 0;
@@ -881,7 +882,7 @@ static int udf_unlink(struct inode *dir, struct dentry *dentry)
881 goto end_unlink; 882 goto end_unlink;
882 883
883 if (!inode->i_nlink) { 884 if (!inode->i_nlink) {
884 udf_debug("Deleting nonexistent file (%lu), %d\n", 885 udf_debug("Deleting nonexistent file (%lu), %u\n",
885 inode->i_ino, inode->i_nlink); 886 inode->i_ino, inode->i_nlink);
886 set_nlink(inode, 1); 887 set_nlink(inode, 1);
887 } 888 }
@@ -913,7 +914,7 @@ static int udf_symlink(struct inode *dir, struct dentry *dentry,
913 int eoffset, elen = 0; 914 int eoffset, elen = 0;
914 uint8_t *ea; 915 uint8_t *ea;
915 int err; 916 int err;
916 int block; 917 udf_pblk_t block;
917 unsigned char *name = NULL; 918 unsigned char *name = NULL;
918 int namelen; 919 int namelen;
919 struct udf_inode_info *iinfo; 920 struct udf_inode_info *iinfo;
diff --git a/fs/udf/partition.c b/fs/udf/partition.c
index 888c364b2fe9..090baff83990 100644
--- a/fs/udf/partition.c
+++ b/fs/udf/partition.c
@@ -32,7 +32,7 @@ uint32_t udf_get_pblock(struct super_block *sb, uint32_t block,
32 struct udf_sb_info *sbi = UDF_SB(sb); 32 struct udf_sb_info *sbi = UDF_SB(sb);
33 struct udf_part_map *map; 33 struct udf_part_map *map;
34 if (partition >= sbi->s_partitions) { 34 if (partition >= sbi->s_partitions) {
35 udf_debug("block=%d, partition=%d, offset=%d: invalid partition\n", 35 udf_debug("block=%u, partition=%u, offset=%u: invalid partition\n",
36 block, partition, offset); 36 block, partition, offset);
37 return 0xFFFFFFFF; 37 return 0xFFFFFFFF;
38 } 38 }
@@ -59,7 +59,7 @@ uint32_t udf_get_pblock_virt15(struct super_block *sb, uint32_t block,
59 vdata = &map->s_type_specific.s_virtual; 59 vdata = &map->s_type_specific.s_virtual;
60 60
61 if (block > vdata->s_num_entries) { 61 if (block > vdata->s_num_entries) {
62 udf_debug("Trying to access block beyond end of VAT (%d max %d)\n", 62 udf_debug("Trying to access block beyond end of VAT (%u max %u)\n",
63 block, vdata->s_num_entries); 63 block, vdata->s_num_entries);
64 return 0xFFFFFFFF; 64 return 0xFFFFFFFF;
65 } 65 }
@@ -83,7 +83,7 @@ uint32_t udf_get_pblock_virt15(struct super_block *sb, uint32_t block,
83 83
84 bh = sb_bread(sb, loc); 84 bh = sb_bread(sb, loc);
85 if (!bh) { 85 if (!bh) {
86 udf_debug("get_pblock(UDF_VIRTUAL_MAP:%p,%d,%d) VAT: %d[%d]\n", 86 udf_debug("get_pblock(UDF_VIRTUAL_MAP:%p,%u,%u) VAT: %u[%u]\n",
87 sb, block, partition, loc, index); 87 sb, block, partition, loc, index);
88 return 0xFFFFFFFF; 88 return 0xFFFFFFFF;
89 } 89 }
diff --git a/fs/udf/super.c b/fs/udf/super.c
index 99cb81d0077f..f80e0a0f24d3 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -366,7 +366,7 @@ static int udf_show_options(struct seq_file *seq, struct dentry *root)
366 if (sbi->s_dmode != UDF_INVALID_MODE) 366 if (sbi->s_dmode != UDF_INVALID_MODE)
367 seq_printf(seq, ",dmode=%ho", sbi->s_dmode); 367 seq_printf(seq, ",dmode=%ho", sbi->s_dmode);
368 if (UDF_QUERY_FLAG(sb, UDF_FLAG_SESSION_SET)) 368 if (UDF_QUERY_FLAG(sb, UDF_FLAG_SESSION_SET))
369 seq_printf(seq, ",session=%u", sbi->s_session); 369 seq_printf(seq, ",session=%d", sbi->s_session);
370 if (UDF_QUERY_FLAG(sb, UDF_FLAG_LASTBLOCK_SET)) 370 if (UDF_QUERY_FLAG(sb, UDF_FLAG_LASTBLOCK_SET))
371 seq_printf(seq, ",lastblock=%u", sbi->s_last_block); 371 seq_printf(seq, ",lastblock=%u", sbi->s_last_block);
372 if (sbi->s_anchor != 0) 372 if (sbi->s_anchor != 0)
@@ -703,9 +703,9 @@ static loff_t udf_check_vsd(struct super_block *sb)
703 else 703 else
704 sectorsize = sb->s_blocksize; 704 sectorsize = sb->s_blocksize;
705 705
706 sector += (sbi->s_session << sb->s_blocksize_bits); 706 sector += (((loff_t)sbi->s_session) << sb->s_blocksize_bits);
707 707
708 udf_debug("Starting at sector %u (%ld byte sectors)\n", 708 udf_debug("Starting at sector %u (%lu byte sectors)\n",
709 (unsigned int)(sector >> sb->s_blocksize_bits), 709 (unsigned int)(sector >> sb->s_blocksize_bits),
710 sb->s_blocksize); 710 sb->s_blocksize);
711 /* Process the sequence (if applicable). The hard limit on the sector 711 /* Process the sequence (if applicable). The hard limit on the sector
@@ -868,7 +868,7 @@ static int udf_find_fileset(struct super_block *sb,
868 868
869 if ((fileset->logicalBlockNum != 0xFFFFFFFF || 869 if ((fileset->logicalBlockNum != 0xFFFFFFFF ||
870 fileset->partitionReferenceNum != 0xFFFF) && bh) { 870 fileset->partitionReferenceNum != 0xFFFF) && bh) {
871 udf_debug("Fileset at block=%d, partition=%d\n", 871 udf_debug("Fileset at block=%u, partition=%u\n",
872 fileset->logicalBlockNum, 872 fileset->logicalBlockNum,
873 fileset->partitionReferenceNum); 873 fileset->partitionReferenceNum);
874 874
@@ -981,14 +981,14 @@ static int udf_load_metadata_files(struct super_block *sb, int partition,
981 mdata->s_phys_partition_ref = type1_index; 981 mdata->s_phys_partition_ref = type1_index;
982 982
983 /* metadata address */ 983 /* metadata address */
984 udf_debug("Metadata file location: block = %d part = %d\n", 984 udf_debug("Metadata file location: block = %u part = %u\n",
985 mdata->s_meta_file_loc, mdata->s_phys_partition_ref); 985 mdata->s_meta_file_loc, mdata->s_phys_partition_ref);
986 986
987 fe = udf_find_metadata_inode_efe(sb, mdata->s_meta_file_loc, 987 fe = udf_find_metadata_inode_efe(sb, mdata->s_meta_file_loc,
988 mdata->s_phys_partition_ref); 988 mdata->s_phys_partition_ref);
989 if (IS_ERR(fe)) { 989 if (IS_ERR(fe)) {
990 /* mirror file entry */ 990 /* mirror file entry */
991 udf_debug("Mirror metadata file location: block = %d part = %d\n", 991 udf_debug("Mirror metadata file location: block = %u part = %u\n",
992 mdata->s_mirror_file_loc, mdata->s_phys_partition_ref); 992 mdata->s_mirror_file_loc, mdata->s_phys_partition_ref);
993 993
994 fe = udf_find_metadata_inode_efe(sb, mdata->s_mirror_file_loc, 994 fe = udf_find_metadata_inode_efe(sb, mdata->s_mirror_file_loc,
@@ -1012,7 +1012,7 @@ static int udf_load_metadata_files(struct super_block *sb, int partition,
1012 addr.logicalBlockNum = mdata->s_bitmap_file_loc; 1012 addr.logicalBlockNum = mdata->s_bitmap_file_loc;
1013 addr.partitionReferenceNum = mdata->s_phys_partition_ref; 1013 addr.partitionReferenceNum = mdata->s_phys_partition_ref;
1014 1014
1015 udf_debug("Bitmap file location: block = %d part = %d\n", 1015 udf_debug("Bitmap file location: block = %u part = %u\n",
1016 addr.logicalBlockNum, addr.partitionReferenceNum); 1016 addr.logicalBlockNum, addr.partitionReferenceNum);
1017 1017
1018 fe = udf_iget_special(sb, &addr); 1018 fe = udf_iget_special(sb, &addr);
@@ -1042,7 +1042,7 @@ static void udf_load_fileset(struct super_block *sb, struct buffer_head *bh,
1042 1042
1043 UDF_SB(sb)->s_serial_number = le16_to_cpu(fset->descTag.tagSerialNum); 1043 UDF_SB(sb)->s_serial_number = le16_to_cpu(fset->descTag.tagSerialNum);
1044 1044
1045 udf_debug("Rootdir at block=%d, partition=%d\n", 1045 udf_debug("Rootdir at block=%u, partition=%u\n",
1046 root->logicalBlockNum, root->partitionReferenceNum); 1046 root->logicalBlockNum, root->partitionReferenceNum);
1047} 1047}
1048 1048
@@ -1097,7 +1097,7 @@ static int udf_fill_partdesc_info(struct super_block *sb,
1097 if (p->accessType == cpu_to_le32(PD_ACCESS_TYPE_OVERWRITABLE)) 1097 if (p->accessType == cpu_to_le32(PD_ACCESS_TYPE_OVERWRITABLE))
1098 map->s_partition_flags |= UDF_PART_FLAG_OVERWRITABLE; 1098 map->s_partition_flags |= UDF_PART_FLAG_OVERWRITABLE;
1099 1099
1100 udf_debug("Partition (%d type %x) starts at physical %d, block length %d\n", 1100 udf_debug("Partition (%d type %x) starts at physical %u, block length %u\n",
1101 p_index, map->s_partition_type, 1101 p_index, map->s_partition_type,
1102 map->s_partition_root, map->s_partition_len); 1102 map->s_partition_root, map->s_partition_len);
1103 1103
@@ -1122,7 +1122,7 @@ static int udf_fill_partdesc_info(struct super_block *sb,
1122 } 1122 }
1123 map->s_uspace.s_table = inode; 1123 map->s_uspace.s_table = inode;
1124 map->s_partition_flags |= UDF_PART_FLAG_UNALLOC_TABLE; 1124 map->s_partition_flags |= UDF_PART_FLAG_UNALLOC_TABLE;
1125 udf_debug("unallocSpaceTable (part %d) @ %ld\n", 1125 udf_debug("unallocSpaceTable (part %d) @ %lu\n",
1126 p_index, map->s_uspace.s_table->i_ino); 1126 p_index, map->s_uspace.s_table->i_ino);
1127 } 1127 }
1128 1128
@@ -1134,7 +1134,7 @@ static int udf_fill_partdesc_info(struct super_block *sb,
1134 bitmap->s_extPosition = le32_to_cpu( 1134 bitmap->s_extPosition = le32_to_cpu(
1135 phd->unallocSpaceBitmap.extPosition); 1135 phd->unallocSpaceBitmap.extPosition);
1136 map->s_partition_flags |= UDF_PART_FLAG_UNALLOC_BITMAP; 1136 map->s_partition_flags |= UDF_PART_FLAG_UNALLOC_BITMAP;
1137 udf_debug("unallocSpaceBitmap (part %d) @ %d\n", 1137 udf_debug("unallocSpaceBitmap (part %d) @ %u\n",
1138 p_index, bitmap->s_extPosition); 1138 p_index, bitmap->s_extPosition);
1139 } 1139 }
1140 1140
@@ -1157,7 +1157,7 @@ static int udf_fill_partdesc_info(struct super_block *sb,
1157 } 1157 }
1158 map->s_fspace.s_table = inode; 1158 map->s_fspace.s_table = inode;
1159 map->s_partition_flags |= UDF_PART_FLAG_FREED_TABLE; 1159 map->s_partition_flags |= UDF_PART_FLAG_FREED_TABLE;
1160 udf_debug("freedSpaceTable (part %d) @ %ld\n", 1160 udf_debug("freedSpaceTable (part %d) @ %lu\n",
1161 p_index, map->s_fspace.s_table->i_ino); 1161 p_index, map->s_fspace.s_table->i_ino);
1162 } 1162 }
1163 1163
@@ -1169,7 +1169,7 @@ static int udf_fill_partdesc_info(struct super_block *sb,
1169 bitmap->s_extPosition = le32_to_cpu( 1169 bitmap->s_extPosition = le32_to_cpu(
1170 phd->freedSpaceBitmap.extPosition); 1170 phd->freedSpaceBitmap.extPosition);
1171 map->s_partition_flags |= UDF_PART_FLAG_FREED_BITMAP; 1171 map->s_partition_flags |= UDF_PART_FLAG_FREED_BITMAP;
1172 udf_debug("freedSpaceBitmap (part %d) @ %d\n", 1172 udf_debug("freedSpaceBitmap (part %d) @ %u\n",
1173 p_index, bitmap->s_extPosition); 1173 p_index, bitmap->s_extPosition);
1174 } 1174 }
1175 return 0; 1175 return 0;
@@ -1282,7 +1282,7 @@ static int udf_load_partdesc(struct super_block *sb, sector_t block)
1282 /* First scan for TYPE1 and SPARABLE partitions */ 1282 /* First scan for TYPE1 and SPARABLE partitions */
1283 for (i = 0; i < sbi->s_partitions; i++) { 1283 for (i = 0; i < sbi->s_partitions; i++) {
1284 map = &sbi->s_partmaps[i]; 1284 map = &sbi->s_partmaps[i];
1285 udf_debug("Searching map: (%d == %d)\n", 1285 udf_debug("Searching map: (%u == %u)\n",
1286 map->s_partition_num, partitionNumber); 1286 map->s_partition_num, partitionNumber);
1287 if (map->s_partition_num == partitionNumber && 1287 if (map->s_partition_num == partitionNumber &&
1288 (map->s_partition_type == UDF_TYPE1_MAP15 || 1288 (map->s_partition_type == UDF_TYPE1_MAP15 ||
@@ -1291,7 +1291,7 @@ static int udf_load_partdesc(struct super_block *sb, sector_t block)
1291 } 1291 }
1292 1292
1293 if (i >= sbi->s_partitions) { 1293 if (i >= sbi->s_partitions) {
1294 udf_debug("Partition (%d) not found in partition map\n", 1294 udf_debug("Partition (%u) not found in partition map\n",
1295 partitionNumber); 1295 partitionNumber);
1296 ret = 0; 1296 ret = 0;
1297 goto out_bh; 1297 goto out_bh;
@@ -1483,7 +1483,7 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block,
1483 struct metadataPartitionMap *mdm = 1483 struct metadataPartitionMap *mdm =
1484 (struct metadataPartitionMap *) 1484 (struct metadataPartitionMap *)
1485 &(lvd->partitionMaps[offset]); 1485 &(lvd->partitionMaps[offset]);
1486 udf_debug("Parsing Logical vol part %d type %d id=%s\n", 1486 udf_debug("Parsing Logical vol part %d type %u id=%s\n",
1487 i, type, UDF_ID_METADATA); 1487 i, type, UDF_ID_METADATA);
1488 1488
1489 map->s_partition_type = UDF_METADATA_MAP25; 1489 map->s_partition_type = UDF_METADATA_MAP25;
@@ -1505,17 +1505,17 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block,
1505 udf_debug("Metadata Ident suffix=0x%x\n", 1505 udf_debug("Metadata Ident suffix=0x%x\n",
1506 le16_to_cpu(*(__le16 *) 1506 le16_to_cpu(*(__le16 *)
1507 mdm->partIdent.identSuffix)); 1507 mdm->partIdent.identSuffix));
1508 udf_debug("Metadata part num=%d\n", 1508 udf_debug("Metadata part num=%u\n",
1509 le16_to_cpu(mdm->partitionNum)); 1509 le16_to_cpu(mdm->partitionNum));
1510 udf_debug("Metadata part alloc unit size=%d\n", 1510 udf_debug("Metadata part alloc unit size=%u\n",
1511 le32_to_cpu(mdm->allocUnitSize)); 1511 le32_to_cpu(mdm->allocUnitSize));
1512 udf_debug("Metadata file loc=%d\n", 1512 udf_debug("Metadata file loc=%u\n",
1513 le32_to_cpu(mdm->metadataFileLoc)); 1513 le32_to_cpu(mdm->metadataFileLoc));
1514 udf_debug("Mirror file loc=%d\n", 1514 udf_debug("Mirror file loc=%u\n",
1515 le32_to_cpu(mdm->metadataMirrorFileLoc)); 1515 le32_to_cpu(mdm->metadataMirrorFileLoc));
1516 udf_debug("Bitmap file loc=%d\n", 1516 udf_debug("Bitmap file loc=%u\n",
1517 le32_to_cpu(mdm->metadataBitmapFileLoc)); 1517 le32_to_cpu(mdm->metadataBitmapFileLoc));
1518 udf_debug("Flags: %d %d\n", 1518 udf_debug("Flags: %d %u\n",
1519 mdata->s_flags, mdm->flags); 1519 mdata->s_flags, mdm->flags);
1520 } else { 1520 } else {
1521 udf_debug("Unknown ident: %s\n", 1521 udf_debug("Unknown ident: %s\n",
@@ -1525,7 +1525,7 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block,
1525 map->s_volumeseqnum = le16_to_cpu(upm2->volSeqNum); 1525 map->s_volumeseqnum = le16_to_cpu(upm2->volSeqNum);
1526 map->s_partition_num = le16_to_cpu(upm2->partitionNum); 1526 map->s_partition_num = le16_to_cpu(upm2->partitionNum);
1527 } 1527 }
1528 udf_debug("Partition (%d:%d) type %d on volume %d\n", 1528 udf_debug("Partition (%d:%u) type %u on volume %u\n",
1529 i, map->s_partition_num, type, map->s_volumeseqnum); 1529 i, map->s_partition_num, type, map->s_volumeseqnum);
1530 } 1530 }
1531 1531
@@ -1533,7 +1533,7 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block,
1533 struct long_ad *la = (struct long_ad *)&(lvd->logicalVolContentsUse[0]); 1533 struct long_ad *la = (struct long_ad *)&(lvd->logicalVolContentsUse[0]);
1534 1534
1535 *fileset = lelb_to_cpu(la->extLocation); 1535 *fileset = lelb_to_cpu(la->extLocation);
1536 udf_debug("FileSet found in LogicalVolDesc at block=%d, partition=%d\n", 1536 udf_debug("FileSet found in LogicalVolDesc at block=%u, partition=%u\n",
1537 fileset->logicalBlockNum, 1537 fileset->logicalBlockNum,
1538 fileset->partitionReferenceNum); 1538 fileset->partitionReferenceNum);
1539 } 1539 }
@@ -2159,7 +2159,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
2159 ret = udf_load_vrs(sb, &uopt, silent, &fileset); 2159 ret = udf_load_vrs(sb, &uopt, silent, &fileset);
2160 if (ret < 0) { 2160 if (ret < 0) {
2161 if (!silent && ret != -EACCES) { 2161 if (!silent && ret != -EACCES) {
2162 pr_notice("Scanning with blocksize %d failed\n", 2162 pr_notice("Scanning with blocksize %u failed\n",
2163 uopt.blocksize); 2163 uopt.blocksize);
2164 } 2164 }
2165 brelse(sbi->s_lvid_bh); 2165 brelse(sbi->s_lvid_bh);
@@ -2184,7 +2184,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
2184 goto error_out; 2184 goto error_out;
2185 } 2185 }
2186 2186
2187 udf_debug("Lastblock=%d\n", sbi->s_last_block); 2187 udf_debug("Lastblock=%u\n", sbi->s_last_block);
2188 2188
2189 if (sbi->s_lvid_bh) { 2189 if (sbi->s_lvid_bh) {
2190 struct logicalVolIntegrityDescImpUse *lvidiu = 2190 struct logicalVolIntegrityDescImpUse *lvidiu =
@@ -2255,7 +2255,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
2255 /* perhaps it's not extensible enough, but for now ... */ 2255 /* perhaps it's not extensible enough, but for now ... */
2256 inode = udf_iget(sb, &rootdir); 2256 inode = udf_iget(sb, &rootdir);
2257 if (IS_ERR(inode)) { 2257 if (IS_ERR(inode)) {
2258 udf_err(sb, "Error in udf_iget, block=%d, partition=%d\n", 2258 udf_err(sb, "Error in udf_iget, block=%u, partition=%u\n",
2259 rootdir.logicalBlockNum, rootdir.partitionReferenceNum); 2259 rootdir.logicalBlockNum, rootdir.partitionReferenceNum);
2260 ret = PTR_ERR(inode); 2260 ret = PTR_ERR(inode);
2261 goto error_out; 2261 goto error_out;
@@ -2389,7 +2389,7 @@ static unsigned int udf_count_free_bitmap(struct super_block *sb,
2389 struct buffer_head *bh = NULL; 2389 struct buffer_head *bh = NULL;
2390 unsigned int accum = 0; 2390 unsigned int accum = 0;
2391 int index; 2391 int index;
2392 int block = 0, newblock; 2392 udf_pblk_t block = 0, newblock;
2393 struct kernel_lb_addr loc; 2393 struct kernel_lb_addr loc;
2394 uint32_t bytes; 2394 uint32_t bytes;
2395 uint8_t *ptr; 2395 uint8_t *ptr;
diff --git a/fs/udf/truncate.c b/fs/udf/truncate.c
index 42b8c57795cb..b647f0bd150c 100644
--- a/fs/udf/truncate.c
+++ b/fs/udf/truncate.c
@@ -48,7 +48,7 @@ static void extent_trunc(struct inode *inode, struct extent_position *epos,
48 48
49 if (elen != nelen) { 49 if (elen != nelen) {
50 udf_write_aext(inode, epos, &neloc, nelen, 0); 50 udf_write_aext(inode, epos, &neloc, nelen, 0);
51 if (last_block - first_block > 0) { 51 if (last_block > first_block) {
52 if (etype == (EXT_RECORDED_ALLOCATED >> 30)) 52 if (etype == (EXT_RECORDED_ALLOCATED >> 30))
53 mark_inode_dirty(inode); 53 mark_inode_dirty(inode);
54 54
diff --git a/fs/udf/udfdecl.h b/fs/udf/udfdecl.h
index 63b034984378..8e51704fd75d 100644
--- a/fs/udf/udfdecl.h
+++ b/fs/udf/udfdecl.h
@@ -73,6 +73,8 @@ static inline size_t udf_ext0_offset(struct inode *inode)
73/* computes tag checksum */ 73/* computes tag checksum */
74u8 udf_tag_checksum(const struct tag *t); 74u8 udf_tag_checksum(const struct tag *t);
75 75
76typedef uint32_t udf_pblk_t;
77
76struct dentry; 78struct dentry;
77struct inode; 79struct inode;
78struct task_struct; 80struct task_struct;
@@ -144,15 +146,17 @@ static inline struct inode *udf_iget(struct super_block *sb,
144 return __udf_iget(sb, ino, false); 146 return __udf_iget(sb, ino, false);
145} 147}
146extern int udf_expand_file_adinicb(struct inode *); 148extern int udf_expand_file_adinicb(struct inode *);
147extern struct buffer_head *udf_expand_dir_adinicb(struct inode *, int *, int *); 149extern struct buffer_head *udf_expand_dir_adinicb(struct inode *inode,
148extern struct buffer_head *udf_bread(struct inode *, int, int, int *); 150 udf_pblk_t *block, int *err);
151extern struct buffer_head *udf_bread(struct inode *inode, udf_pblk_t block,
152 int create, int *err);
149extern int udf_setsize(struct inode *, loff_t); 153extern int udf_setsize(struct inode *, loff_t);
150extern void udf_evict_inode(struct inode *); 154extern void udf_evict_inode(struct inode *);
151extern int udf_write_inode(struct inode *, struct writeback_control *wbc); 155extern int udf_write_inode(struct inode *, struct writeback_control *wbc);
152extern long udf_block_map(struct inode *, sector_t); 156extern udf_pblk_t udf_block_map(struct inode *inode, sector_t block);
153extern int8_t inode_bmap(struct inode *, sector_t, struct extent_position *, 157extern int8_t inode_bmap(struct inode *, sector_t, struct extent_position *,
154 struct kernel_lb_addr *, uint32_t *, sector_t *); 158 struct kernel_lb_addr *, uint32_t *, sector_t *);
155extern int udf_setup_indirect_aext(struct inode *inode, int block, 159extern int udf_setup_indirect_aext(struct inode *inode, udf_pblk_t block,
156 struct extent_position *epos); 160 struct extent_position *epos);
157extern int __udf_add_aext(struct inode *inode, struct extent_position *epos, 161extern int __udf_add_aext(struct inode *inode, struct extent_position *epos,
158 struct kernel_lb_addr *eloc, uint32_t elen, int inc); 162 struct kernel_lb_addr *eloc, uint32_t elen, int inc);
@@ -168,8 +172,9 @@ extern int8_t udf_current_aext(struct inode *, struct extent_position *,
168 struct kernel_lb_addr *, uint32_t *, int); 172 struct kernel_lb_addr *, uint32_t *, int);
169 173
170/* misc.c */ 174/* misc.c */
171extern struct buffer_head *udf_tgetblk(struct super_block *, int); 175extern struct buffer_head *udf_tgetblk(struct super_block *sb,
172extern struct buffer_head *udf_tread(struct super_block *, int); 176 udf_pblk_t block);
177extern struct buffer_head *udf_tread(struct super_block *sb, udf_pblk_t block);
173extern struct genericFormat *udf_add_extendedattr(struct inode *, uint32_t, 178extern struct genericFormat *udf_add_extendedattr(struct inode *, uint32_t,
174 uint32_t, uint8_t); 179 uint32_t, uint8_t);
175extern struct genericFormat *udf_get_extendedattr(struct inode *, uint32_t, 180extern struct genericFormat *udf_get_extendedattr(struct inode *, uint32_t,
@@ -228,8 +233,8 @@ extern void udf_free_blocks(struct super_block *, struct inode *,
228 struct kernel_lb_addr *, uint32_t, uint32_t); 233 struct kernel_lb_addr *, uint32_t, uint32_t);
229extern int udf_prealloc_blocks(struct super_block *, struct inode *, uint16_t, 234extern int udf_prealloc_blocks(struct super_block *, struct inode *, uint16_t,
230 uint32_t, uint32_t); 235 uint32_t, uint32_t);
231extern int udf_new_block(struct super_block *, struct inode *, uint16_t, 236extern udf_pblk_t udf_new_block(struct super_block *sb, struct inode *inode,
232 uint32_t, int *); 237 uint16_t partition, uint32_t goal, int *err);
233 238
234/* directory.c */ 239/* directory.c */
235extern struct fileIdentDesc *udf_fileident_read(struct inode *, loff_t *, 240extern struct fileIdentDesc *udf_fileident_read(struct inode *, loff_t *,
diff --git a/fs/udf/unicode.c b/fs/udf/unicode.c
index 695389a4fc23..f897e55f2cd0 100644
--- a/fs/udf/unicode.c
+++ b/fs/udf/unicode.c
@@ -200,7 +200,7 @@ static int udf_name_from_CS0(uint8_t *str_o, int str_max_len,
200 cmp_id = ocu[0]; 200 cmp_id = ocu[0];
201 if (cmp_id != 8 && cmp_id != 16) { 201 if (cmp_id != 8 && cmp_id != 16) {
202 memset(str_o, 0, str_max_len); 202 memset(str_o, 0, str_max_len);
203 pr_err("unknown compression code (%d)\n", cmp_id); 203 pr_err("unknown compression code (%u)\n", cmp_id);
204 return -EINVAL; 204 return -EINVAL;
205 } 205 }
206 u_ch = cmp_id >> 3; 206 u_ch = cmp_id >> 3;
diff --git a/include/linux/audit.h b/include/linux/audit.h
index cb708eb8accc..d66220dac364 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -356,6 +356,7 @@ extern int __audit_log_bprm_fcaps(struct linux_binprm *bprm,
356extern void __audit_log_capset(const struct cred *new, const struct cred *old); 356extern void __audit_log_capset(const struct cred *new, const struct cred *old);
357extern void __audit_mmap_fd(int fd, int flags); 357extern void __audit_mmap_fd(int fd, int flags);
358extern void __audit_log_kern_module(char *name); 358extern void __audit_log_kern_module(char *name);
359extern void __audit_fanotify(unsigned int response);
359 360
360static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp) 361static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp)
361{ 362{
@@ -452,6 +453,12 @@ static inline void audit_log_kern_module(char *name)
452 __audit_log_kern_module(name); 453 __audit_log_kern_module(name);
453} 454}
454 455
456static inline void audit_fanotify(unsigned int response)
457{
458 if (!audit_dummy_context())
459 __audit_fanotify(response);
460}
461
455extern int audit_n_rules; 462extern int audit_n_rules;
456extern int audit_signals; 463extern int audit_signals;
457#else /* CONFIG_AUDITSYSCALL */ 464#else /* CONFIG_AUDITSYSCALL */
@@ -568,6 +575,9 @@ static inline void audit_log_kern_module(char *name)
568{ 575{
569} 576}
570 577
578static inline void audit_fanotify(unsigned int response)
579{ }
580
571static inline void audit_ptrace(struct task_struct *t) 581static inline void audit_ptrace(struct task_struct *t)
572{ } 582{ }
573#define audit_n_rules 0 583#define audit_n_rules 0
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h
index c6c69318752b..4a474f972910 100644
--- a/include/linux/fsnotify_backend.h
+++ b/include/linux/fsnotify_backend.h
@@ -190,6 +190,7 @@ struct fsnotify_group {
190 int f_flags; 190 int f_flags;
191 unsigned int max_marks; 191 unsigned int max_marks;
192 struct user_struct *user; 192 struct user_struct *user;
193 bool audit;
193 } fanotify_data; 194 } fanotify_data;
194#endif /* CONFIG_FANOTIFY */ 195#endif /* CONFIG_FANOTIFY */
195 }; 196 };
diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h
index 0714a66f0e0c..221f8b7f01b2 100644
--- a/include/uapi/linux/audit.h
+++ b/include/uapi/linux/audit.h
@@ -112,6 +112,7 @@
112#define AUDIT_FEATURE_CHANGE 1328 /* audit log listing feature changes */ 112#define AUDIT_FEATURE_CHANGE 1328 /* audit log listing feature changes */
113#define AUDIT_REPLACE 1329 /* Replace auditd if this packet unanswerd */ 113#define AUDIT_REPLACE 1329 /* Replace auditd if this packet unanswerd */
114#define AUDIT_KERN_MODULE 1330 /* Kernel Module events */ 114#define AUDIT_KERN_MODULE 1330 /* Kernel Module events */
115#define AUDIT_FANOTIFY 1331 /* Fanotify access decision */
115 116
116#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ 117#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */
117#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ 118#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */
diff --git a/include/uapi/linux/fanotify.h b/include/uapi/linux/fanotify.h
index 030508d195d3..5dda19a9a947 100644
--- a/include/uapi/linux/fanotify.h
+++ b/include/uapi/linux/fanotify.h
@@ -35,6 +35,7 @@
35 35
36#define FAN_UNLIMITED_QUEUE 0x00000010 36#define FAN_UNLIMITED_QUEUE 0x00000010
37#define FAN_UNLIMITED_MARKS 0x00000020 37#define FAN_UNLIMITED_MARKS 0x00000020
38#define FAN_ENABLE_AUDIT 0x00000040
38 39
39#define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | \ 40#define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | \
40 FAN_ALL_CLASS_BITS | FAN_UNLIMITED_QUEUE |\ 41 FAN_ALL_CLASS_BITS | FAN_UNLIMITED_QUEUE |\
@@ -99,6 +100,8 @@ struct fanotify_response {
99/* Legit userspace responses to a _PERM event */ 100/* Legit userspace responses to a _PERM event */
100#define FAN_ALLOW 0x01 101#define FAN_ALLOW 0x01
101#define FAN_DENY 0x02 102#define FAN_DENY 0x02
103#define FAN_AUDIT 0x10 /* Bit mask to create audit record for result */
104
102/* No fd set in event */ 105/* No fd set in event */
103#define FAN_NOFD -1 106#define FAN_NOFD -1
104 107
diff --git a/include/uapi/linux/iso_fs.h b/include/uapi/linux/iso_fs.h
index 4688ac4284e2..07c4c6405b3c 100644
--- a/include/uapi/linux/iso_fs.h
+++ b/include/uapi/linux/iso_fs.h
@@ -12,10 +12,10 @@
12#define ISODCL(from, to) (to - from + 1) 12#define ISODCL(from, to) (to - from + 1)
13 13
14struct iso_volume_descriptor { 14struct iso_volume_descriptor {
15 char type[ISODCL(1,1)]; /* 711 */ 15 __u8 type[ISODCL(1,1)]; /* 711 */
16 char id[ISODCL(2,6)]; 16 char id[ISODCL(2,6)];
17 char version[ISODCL(7,7)]; 17 __u8 version[ISODCL(7,7)];
18 char data[ISODCL(8,2048)]; 18 __u8 data[ISODCL(8,2048)];
19}; 19};
20 20
21/* volume descriptor types */ 21/* volume descriptor types */
@@ -26,24 +26,24 @@ struct iso_volume_descriptor {
26#define ISO_STANDARD_ID "CD001" 26#define ISO_STANDARD_ID "CD001"
27 27
28struct iso_primary_descriptor { 28struct iso_primary_descriptor {
29 char type [ISODCL ( 1, 1)]; /* 711 */ 29 __u8 type [ISODCL ( 1, 1)]; /* 711 */
30 char id [ISODCL ( 2, 6)]; 30 char id [ISODCL ( 2, 6)];
31 char version [ISODCL ( 7, 7)]; /* 711 */ 31 __u8 version [ISODCL ( 7, 7)]; /* 711 */
32 char unused1 [ISODCL ( 8, 8)]; 32 __u8 unused1 [ISODCL ( 8, 8)];
33 char system_id [ISODCL ( 9, 40)]; /* achars */ 33 char system_id [ISODCL ( 9, 40)]; /* achars */
34 char volume_id [ISODCL ( 41, 72)]; /* dchars */ 34 char volume_id [ISODCL ( 41, 72)]; /* dchars */
35 char unused2 [ISODCL ( 73, 80)]; 35 __u8 unused2 [ISODCL ( 73, 80)];
36 char volume_space_size [ISODCL ( 81, 88)]; /* 733 */ 36 __u8 volume_space_size [ISODCL ( 81, 88)]; /* 733 */
37 char unused3 [ISODCL ( 89, 120)]; 37 __u8 unused3 [ISODCL ( 89, 120)];
38 char volume_set_size [ISODCL (121, 124)]; /* 723 */ 38 __u8 volume_set_size [ISODCL (121, 124)]; /* 723 */
39 char volume_sequence_number [ISODCL (125, 128)]; /* 723 */ 39 __u8 volume_sequence_number [ISODCL (125, 128)]; /* 723 */
40 char logical_block_size [ISODCL (129, 132)]; /* 723 */ 40 __u8 logical_block_size [ISODCL (129, 132)]; /* 723 */
41 char path_table_size [ISODCL (133, 140)]; /* 733 */ 41 __u8 path_table_size [ISODCL (133, 140)]; /* 733 */
42 char type_l_path_table [ISODCL (141, 144)]; /* 731 */ 42 __u8 type_l_path_table [ISODCL (141, 144)]; /* 731 */
43 char opt_type_l_path_table [ISODCL (145, 148)]; /* 731 */ 43 __u8 opt_type_l_path_table [ISODCL (145, 148)]; /* 731 */
44 char type_m_path_table [ISODCL (149, 152)]; /* 732 */ 44 __u8 type_m_path_table [ISODCL (149, 152)]; /* 732 */
45 char opt_type_m_path_table [ISODCL (153, 156)]; /* 732 */ 45 __u8 opt_type_m_path_table [ISODCL (153, 156)]; /* 732 */
46 char root_directory_record [ISODCL (157, 190)]; /* 9.1 */ 46 __u8 root_directory_record [ISODCL (157, 190)]; /* 9.1 */
47 char volume_set_id [ISODCL (191, 318)]; /* dchars */ 47 char volume_set_id [ISODCL (191, 318)]; /* dchars */
48 char publisher_id [ISODCL (319, 446)]; /* achars */ 48 char publisher_id [ISODCL (319, 446)]; /* achars */
49 char preparer_id [ISODCL (447, 574)]; /* achars */ 49 char preparer_id [ISODCL (447, 574)]; /* achars */
@@ -51,36 +51,36 @@ struct iso_primary_descriptor {
51 char copyright_file_id [ISODCL (703, 739)]; /* 7.5 dchars */ 51 char copyright_file_id [ISODCL (703, 739)]; /* 7.5 dchars */
52 char abstract_file_id [ISODCL (740, 776)]; /* 7.5 dchars */ 52 char abstract_file_id [ISODCL (740, 776)]; /* 7.5 dchars */
53 char bibliographic_file_id [ISODCL (777, 813)]; /* 7.5 dchars */ 53 char bibliographic_file_id [ISODCL (777, 813)]; /* 7.5 dchars */
54 char creation_date [ISODCL (814, 830)]; /* 8.4.26.1 */ 54 __u8 creation_date [ISODCL (814, 830)]; /* 8.4.26.1 */
55 char modification_date [ISODCL (831, 847)]; /* 8.4.26.1 */ 55 __u8 modification_date [ISODCL (831, 847)]; /* 8.4.26.1 */
56 char expiration_date [ISODCL (848, 864)]; /* 8.4.26.1 */ 56 __u8 expiration_date [ISODCL (848, 864)]; /* 8.4.26.1 */
57 char effective_date [ISODCL (865, 881)]; /* 8.4.26.1 */ 57 __u8 effective_date [ISODCL (865, 881)]; /* 8.4.26.1 */
58 char file_structure_version [ISODCL (882, 882)]; /* 711 */ 58 __u8 file_structure_version [ISODCL (882, 882)]; /* 711 */
59 char unused4 [ISODCL (883, 883)]; 59 __u8 unused4 [ISODCL (883, 883)];
60 char application_data [ISODCL (884, 1395)]; 60 __u8 application_data [ISODCL (884, 1395)];
61 char unused5 [ISODCL (1396, 2048)]; 61 __u8 unused5 [ISODCL (1396, 2048)];
62}; 62};
63 63
64/* Almost the same as the primary descriptor but two fields are specified */ 64/* Almost the same as the primary descriptor but two fields are specified */
65struct iso_supplementary_descriptor { 65struct iso_supplementary_descriptor {
66 char type [ISODCL ( 1, 1)]; /* 711 */ 66 __u8 type [ISODCL ( 1, 1)]; /* 711 */
67 char id [ISODCL ( 2, 6)]; 67 char id [ISODCL ( 2, 6)];
68 char version [ISODCL ( 7, 7)]; /* 711 */ 68 __u8 version [ISODCL ( 7, 7)]; /* 711 */
69 char flags [ISODCL ( 8, 8)]; /* 853 */ 69 __u8 flags [ISODCL ( 8, 8)]; /* 853 */
70 char system_id [ISODCL ( 9, 40)]; /* achars */ 70 char system_id [ISODCL ( 9, 40)]; /* achars */
71 char volume_id [ISODCL ( 41, 72)]; /* dchars */ 71 char volume_id [ISODCL ( 41, 72)]; /* dchars */
72 char unused2 [ISODCL ( 73, 80)]; 72 __u8 unused2 [ISODCL ( 73, 80)];
73 char volume_space_size [ISODCL ( 81, 88)]; /* 733 */ 73 __u8 volume_space_size [ISODCL ( 81, 88)]; /* 733 */
74 char escape [ISODCL ( 89, 120)]; /* 856 */ 74 __u8 escape [ISODCL ( 89, 120)]; /* 856 */
75 char volume_set_size [ISODCL (121, 124)]; /* 723 */ 75 __u8 volume_set_size [ISODCL (121, 124)]; /* 723 */
76 char volume_sequence_number [ISODCL (125, 128)]; /* 723 */ 76 __u8 volume_sequence_number [ISODCL (125, 128)]; /* 723 */
77 char logical_block_size [ISODCL (129, 132)]; /* 723 */ 77 __u8 logical_block_size [ISODCL (129, 132)]; /* 723 */
78 char path_table_size [ISODCL (133, 140)]; /* 733 */ 78 __u8 path_table_size [ISODCL (133, 140)]; /* 733 */
79 char type_l_path_table [ISODCL (141, 144)]; /* 731 */ 79 __u8 type_l_path_table [ISODCL (141, 144)]; /* 731 */
80 char opt_type_l_path_table [ISODCL (145, 148)]; /* 731 */ 80 __u8 opt_type_l_path_table [ISODCL (145, 148)]; /* 731 */
81 char type_m_path_table [ISODCL (149, 152)]; /* 732 */ 81 __u8 type_m_path_table [ISODCL (149, 152)]; /* 732 */
82 char opt_type_m_path_table [ISODCL (153, 156)]; /* 732 */ 82 __u8 opt_type_m_path_table [ISODCL (153, 156)]; /* 732 */
83 char root_directory_record [ISODCL (157, 190)]; /* 9.1 */ 83 __u8 root_directory_record [ISODCL (157, 190)]; /* 9.1 */
84 char volume_set_id [ISODCL (191, 318)]; /* dchars */ 84 char volume_set_id [ISODCL (191, 318)]; /* dchars */
85 char publisher_id [ISODCL (319, 446)]; /* achars */ 85 char publisher_id [ISODCL (319, 446)]; /* achars */
86 char preparer_id [ISODCL (447, 574)]; /* achars */ 86 char preparer_id [ISODCL (447, 574)]; /* achars */
@@ -88,54 +88,54 @@ struct iso_supplementary_descriptor {
88 char copyright_file_id [ISODCL (703, 739)]; /* 7.5 dchars */ 88 char copyright_file_id [ISODCL (703, 739)]; /* 7.5 dchars */
89 char abstract_file_id [ISODCL (740, 776)]; /* 7.5 dchars */ 89 char abstract_file_id [ISODCL (740, 776)]; /* 7.5 dchars */
90 char bibliographic_file_id [ISODCL (777, 813)]; /* 7.5 dchars */ 90 char bibliographic_file_id [ISODCL (777, 813)]; /* 7.5 dchars */
91 char creation_date [ISODCL (814, 830)]; /* 8.4.26.1 */ 91 __u8 creation_date [ISODCL (814, 830)]; /* 8.4.26.1 */
92 char modification_date [ISODCL (831, 847)]; /* 8.4.26.1 */ 92 __u8 modification_date [ISODCL (831, 847)]; /* 8.4.26.1 */
93 char expiration_date [ISODCL (848, 864)]; /* 8.4.26.1 */ 93 __u8 expiration_date [ISODCL (848, 864)]; /* 8.4.26.1 */
94 char effective_date [ISODCL (865, 881)]; /* 8.4.26.1 */ 94 __u8 effective_date [ISODCL (865, 881)]; /* 8.4.26.1 */
95 char file_structure_version [ISODCL (882, 882)]; /* 711 */ 95 __u8 file_structure_version [ISODCL (882, 882)]; /* 711 */
96 char unused4 [ISODCL (883, 883)]; 96 __u8 unused4 [ISODCL (883, 883)];
97 char application_data [ISODCL (884, 1395)]; 97 __u8 application_data [ISODCL (884, 1395)];
98 char unused5 [ISODCL (1396, 2048)]; 98 __u8 unused5 [ISODCL (1396, 2048)];
99}; 99};
100 100
101 101
102#define HS_STANDARD_ID "CDROM" 102#define HS_STANDARD_ID "CDROM"
103 103
104struct hs_volume_descriptor { 104struct hs_volume_descriptor {
105 char foo [ISODCL ( 1, 8)]; /* 733 */ 105 __u8 foo [ISODCL ( 1, 8)]; /* 733 */
106 char type [ISODCL ( 9, 9)]; /* 711 */ 106 __u8 type [ISODCL ( 9, 9)]; /* 711 */
107 char id [ISODCL ( 10, 14)]; 107 char id [ISODCL ( 10, 14)];
108 char version [ISODCL ( 15, 15)]; /* 711 */ 108 __u8 version [ISODCL ( 15, 15)]; /* 711 */
109 char data[ISODCL(16,2048)]; 109 __u8 data[ISODCL(16,2048)];
110}; 110};
111 111
112 112
113struct hs_primary_descriptor { 113struct hs_primary_descriptor {
114 char foo [ISODCL ( 1, 8)]; /* 733 */ 114 __u8 foo [ISODCL ( 1, 8)]; /* 733 */
115 char type [ISODCL ( 9, 9)]; /* 711 */ 115 __u8 type [ISODCL ( 9, 9)]; /* 711 */
116 char id [ISODCL ( 10, 14)]; 116 __u8 id [ISODCL ( 10, 14)];
117 char version [ISODCL ( 15, 15)]; /* 711 */ 117 __u8 version [ISODCL ( 15, 15)]; /* 711 */
118 char unused1 [ISODCL ( 16, 16)]; /* 711 */ 118 __u8 unused1 [ISODCL ( 16, 16)]; /* 711 */
119 char system_id [ISODCL ( 17, 48)]; /* achars */ 119 char system_id [ISODCL ( 17, 48)]; /* achars */
120 char volume_id [ISODCL ( 49, 80)]; /* dchars */ 120 char volume_id [ISODCL ( 49, 80)]; /* dchars */
121 char unused2 [ISODCL ( 81, 88)]; /* 733 */ 121 __u8 unused2 [ISODCL ( 81, 88)]; /* 733 */
122 char volume_space_size [ISODCL ( 89, 96)]; /* 733 */ 122 __u8 volume_space_size [ISODCL ( 89, 96)]; /* 733 */
123 char unused3 [ISODCL ( 97, 128)]; /* 733 */ 123 __u8 unused3 [ISODCL ( 97, 128)]; /* 733 */
124 char volume_set_size [ISODCL (129, 132)]; /* 723 */ 124 __u8 volume_set_size [ISODCL (129, 132)]; /* 723 */
125 char volume_sequence_number [ISODCL (133, 136)]; /* 723 */ 125 __u8 volume_sequence_number [ISODCL (133, 136)]; /* 723 */
126 char logical_block_size [ISODCL (137, 140)]; /* 723 */ 126 __u8 logical_block_size [ISODCL (137, 140)]; /* 723 */
127 char path_table_size [ISODCL (141, 148)]; /* 733 */ 127 __u8 path_table_size [ISODCL (141, 148)]; /* 733 */
128 char type_l_path_table [ISODCL (149, 152)]; /* 731 */ 128 __u8 type_l_path_table [ISODCL (149, 152)]; /* 731 */
129 char unused4 [ISODCL (153, 180)]; /* 733 */ 129 __u8 unused4 [ISODCL (153, 180)]; /* 733 */
130 char root_directory_record [ISODCL (181, 214)]; /* 9.1 */ 130 __u8 root_directory_record [ISODCL (181, 214)]; /* 9.1 */
131}; 131};
132 132
133/* We use this to help us look up the parent inode numbers. */ 133/* We use this to help us look up the parent inode numbers. */
134 134
135struct iso_path_table{ 135struct iso_path_table{
136 unsigned char name_len[2]; /* 721 */ 136 __u8 name_len[2]; /* 721 */
137 char extent[4]; /* 731 */ 137 __u8 extent[4]; /* 731 */
138 char parent[2]; /* 721 */ 138 __u8 parent[2]; /* 721 */
139 char name[0]; 139 char name[0];
140} __attribute__((packed)); 140} __attribute__((packed));
141 141
@@ -143,16 +143,16 @@ struct iso_path_table{
143 there is an extra reserved byte after the flags */ 143 there is an extra reserved byte after the flags */
144 144
145struct iso_directory_record { 145struct iso_directory_record {
146 char length [ISODCL (1, 1)]; /* 711 */ 146 __u8 length [ISODCL (1, 1)]; /* 711 */
147 char ext_attr_length [ISODCL (2, 2)]; /* 711 */ 147 __u8 ext_attr_length [ISODCL (2, 2)]; /* 711 */
148 char extent [ISODCL (3, 10)]; /* 733 */ 148 __u8 extent [ISODCL (3, 10)]; /* 733 */
149 char size [ISODCL (11, 18)]; /* 733 */ 149 __u8 size [ISODCL (11, 18)]; /* 733 */
150 char date [ISODCL (19, 25)]; /* 7 by 711 */ 150 __u8 date [ISODCL (19, 25)]; /* 7 by 711 */
151 char flags [ISODCL (26, 26)]; 151 __u8 flags [ISODCL (26, 26)];
152 char file_unit_size [ISODCL (27, 27)]; /* 711 */ 152 __u8 file_unit_size [ISODCL (27, 27)]; /* 711 */
153 char interleave [ISODCL (28, 28)]; /* 711 */ 153 __u8 interleave [ISODCL (28, 28)]; /* 711 */
154 char volume_sequence_number [ISODCL (29, 32)]; /* 723 */ 154 __u8 volume_sequence_number [ISODCL (29, 32)]; /* 723 */
155 unsigned char name_len [ISODCL (33, 33)]; /* 711 */ 155 __u8 name_len [ISODCL (33, 33)]; /* 711 */
156 char name [0]; 156 char name [0];
157} __attribute__((packed)); 157} __attribute__((packed));
158 158
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index ecc23e25c9eb..9c723e978245 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -2390,6 +2390,12 @@ void __audit_log_kern_module(char *name)
2390 context->type = AUDIT_KERN_MODULE; 2390 context->type = AUDIT_KERN_MODULE;
2391} 2391}
2392 2392
2393void __audit_fanotify(unsigned int response)
2394{
2395 audit_log(current->audit_context, GFP_KERNEL,
2396 AUDIT_FANOTIFY, "resp=%u", response);
2397}
2398
2393static void audit_log_task(struct audit_buffer *ab) 2399static void audit_log_task(struct audit_buffer *ab)
2394{ 2400{
2395 kuid_t auid, uid; 2401 kuid_t auid, uid;