diff options
| -rw-r--r-- | fs/ext4/block_validity.c | 8 | ||||
| -rw-r--r-- | fs/ext4/extents.c | 17 | ||||
| -rw-r--r-- | fs/ext4/file.c | 7 | ||||
| -rw-r--r-- | fs/ext4/fsmap.c | 2 | ||||
| -rw-r--r-- | fs/ext4/ioctl.c | 2 | ||||
| -rw-r--r-- | fs/ext4/namei.c | 5 | ||||
| -rw-r--r-- | fs/ext4/super.c | 4 | ||||
| -rw-r--r-- | fs/jbd2/journal.c | 49 | ||||
| -rw-r--r-- | fs/jbd2/revoke.c | 32 | ||||
| -rw-r--r-- | fs/jbd2/transaction.c | 8 | ||||
| -rw-r--r-- | fs/unicode/README.utf8data | 28 | ||||
| -rw-r--r-- | fs/unicode/utf8-norm.c | 2 | ||||
| -rw-r--r-- | include/linux/jbd2.h | 8 |
13 files changed, 107 insertions, 65 deletions
diff --git a/fs/ext4/block_validity.c b/fs/ext4/block_validity.c index 968f163b5feb..8e83741b02e0 100644 --- a/fs/ext4/block_validity.c +++ b/fs/ext4/block_validity.c | |||
| @@ -142,7 +142,8 @@ static int ext4_protect_reserved_inode(struct super_block *sb, u32 ino) | |||
| 142 | struct inode *inode; | 142 | struct inode *inode; |
| 143 | struct ext4_sb_info *sbi = EXT4_SB(sb); | 143 | struct ext4_sb_info *sbi = EXT4_SB(sb); |
| 144 | struct ext4_map_blocks map; | 144 | struct ext4_map_blocks map; |
| 145 | u32 i = 0, err = 0, num, n; | 145 | u32 i = 0, num; |
| 146 | int err = 0, n; | ||
| 146 | 147 | ||
| 147 | if ((ino < EXT4_ROOT_INO) || | 148 | if ((ino < EXT4_ROOT_INO) || |
| 148 | (ino > le32_to_cpu(sbi->s_es->s_inodes_count))) | 149 | (ino > le32_to_cpu(sbi->s_es->s_inodes_count))) |
| @@ -276,6 +277,11 @@ int ext4_check_blockref(const char *function, unsigned int line, | |||
| 276 | __le32 *bref = p; | 277 | __le32 *bref = p; |
| 277 | unsigned int blk; | 278 | unsigned int blk; |
| 278 | 279 | ||
| 280 | if (ext4_has_feature_journal(inode->i_sb) && | ||
| 281 | (inode->i_ino == | ||
| 282 | le32_to_cpu(EXT4_SB(inode->i_sb)->s_es->s_journal_inum))) | ||
| 283 | return 0; | ||
| 284 | |||
| 279 | while (bref < p+max) { | 285 | while (bref < p+max) { |
| 280 | blk = le32_to_cpu(*bref++); | 286 | blk = le32_to_cpu(*bref++); |
| 281 | if (blk && | 287 | if (blk && |
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 0f89f5190cd7..f2c62e2a0c98 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c | |||
| @@ -1035,6 +1035,7 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode, | |||
| 1035 | __le32 border; | 1035 | __le32 border; |
| 1036 | ext4_fsblk_t *ablocks = NULL; /* array of allocated blocks */ | 1036 | ext4_fsblk_t *ablocks = NULL; /* array of allocated blocks */ |
| 1037 | int err = 0; | 1037 | int err = 0; |
| 1038 | size_t ext_size = 0; | ||
| 1038 | 1039 | ||
| 1039 | /* make decision: where to split? */ | 1040 | /* make decision: where to split? */ |
| 1040 | /* FIXME: now decision is simplest: at current extent */ | 1041 | /* FIXME: now decision is simplest: at current extent */ |
| @@ -1126,6 +1127,10 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode, | |||
| 1126 | le16_add_cpu(&neh->eh_entries, m); | 1127 | le16_add_cpu(&neh->eh_entries, m); |
| 1127 | } | 1128 | } |
| 1128 | 1129 | ||
| 1130 | /* zero out unused area in the extent block */ | ||
| 1131 | ext_size = sizeof(struct ext4_extent_header) + | ||
| 1132 | sizeof(struct ext4_extent) * le16_to_cpu(neh->eh_entries); | ||
| 1133 | memset(bh->b_data + ext_size, 0, inode->i_sb->s_blocksize - ext_size); | ||
| 1129 | ext4_extent_block_csum_set(inode, neh); | 1134 | ext4_extent_block_csum_set(inode, neh); |
| 1130 | set_buffer_uptodate(bh); | 1135 | set_buffer_uptodate(bh); |
| 1131 | unlock_buffer(bh); | 1136 | unlock_buffer(bh); |
| @@ -1205,6 +1210,11 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode, | |||
| 1205 | sizeof(struct ext4_extent_idx) * m); | 1210 | sizeof(struct ext4_extent_idx) * m); |
| 1206 | le16_add_cpu(&neh->eh_entries, m); | 1211 | le16_add_cpu(&neh->eh_entries, m); |
| 1207 | } | 1212 | } |
| 1213 | /* zero out unused area in the extent block */ | ||
| 1214 | ext_size = sizeof(struct ext4_extent_header) + | ||
| 1215 | (sizeof(struct ext4_extent) * le16_to_cpu(neh->eh_entries)); | ||
| 1216 | memset(bh->b_data + ext_size, 0, | ||
| 1217 | inode->i_sb->s_blocksize - ext_size); | ||
| 1208 | ext4_extent_block_csum_set(inode, neh); | 1218 | ext4_extent_block_csum_set(inode, neh); |
| 1209 | set_buffer_uptodate(bh); | 1219 | set_buffer_uptodate(bh); |
| 1210 | unlock_buffer(bh); | 1220 | unlock_buffer(bh); |
| @@ -1270,6 +1280,7 @@ static int ext4_ext_grow_indepth(handle_t *handle, struct inode *inode, | |||
| 1270 | ext4_fsblk_t newblock, goal = 0; | 1280 | ext4_fsblk_t newblock, goal = 0; |
| 1271 | struct ext4_super_block *es = EXT4_SB(inode->i_sb)->s_es; | 1281 | struct ext4_super_block *es = EXT4_SB(inode->i_sb)->s_es; |
| 1272 | int err = 0; | 1282 | int err = 0; |
| 1283 | size_t ext_size = 0; | ||
| 1273 | 1284 | ||
| 1274 | /* Try to prepend new index to old one */ | 1285 | /* Try to prepend new index to old one */ |
| 1275 | if (ext_depth(inode)) | 1286 | if (ext_depth(inode)) |
| @@ -1295,9 +1306,11 @@ static int ext4_ext_grow_indepth(handle_t *handle, struct inode *inode, | |||
| 1295 | goto out; | 1306 | goto out; |
| 1296 | } | 1307 | } |
| 1297 | 1308 | ||
| 1309 | ext_size = sizeof(EXT4_I(inode)->i_data); | ||
| 1298 | /* move top-level index/leaf into new block */ | 1310 | /* move top-level index/leaf into new block */ |
| 1299 | memmove(bh->b_data, EXT4_I(inode)->i_data, | 1311 | memmove(bh->b_data, EXT4_I(inode)->i_data, ext_size); |
| 1300 | sizeof(EXT4_I(inode)->i_data)); | 1312 | /* zero out unused area in the extent block */ |
| 1313 | memset(bh->b_data + ext_size, 0, inode->i_sb->s_blocksize - ext_size); | ||
| 1301 | 1314 | ||
| 1302 | /* set size of new block */ | 1315 | /* set size of new block */ |
| 1303 | neh = ext_block_hdr(bh); | 1316 | neh = ext_block_hdr(bh); |
diff --git a/fs/ext4/file.c b/fs/ext4/file.c index 98ec11f69cd4..2c5baa5e8291 100644 --- a/fs/ext4/file.c +++ b/fs/ext4/file.c | |||
| @@ -264,6 +264,13 @@ ext4_file_write_iter(struct kiocb *iocb, struct iov_iter *from) | |||
| 264 | } | 264 | } |
| 265 | 265 | ||
| 266 | ret = __generic_file_write_iter(iocb, from); | 266 | ret = __generic_file_write_iter(iocb, from); |
| 267 | /* | ||
| 268 | * Unaligned direct AIO must be the only IO in flight. Otherwise | ||
| 269 | * overlapping aligned IO after unaligned might result in data | ||
| 270 | * corruption. | ||
| 271 | */ | ||
| 272 | if (ret == -EIOCBQUEUED && unaligned_aio) | ||
| 273 | ext4_unwritten_wait(inode); | ||
| 267 | inode_unlock(inode); | 274 | inode_unlock(inode); |
| 268 | 275 | ||
| 269 | if (ret > 0) | 276 | if (ret > 0) |
diff --git a/fs/ext4/fsmap.c b/fs/ext4/fsmap.c index 4b99e2db95b8..dbccf46f1770 100644 --- a/fs/ext4/fsmap.c +++ b/fs/ext4/fsmap.c | |||
| @@ -626,7 +626,7 @@ int ext4_getfsmap(struct super_block *sb, struct ext4_fsmap_head *head, | |||
| 626 | { | 626 | { |
| 627 | struct ext4_fsmap dkeys[2]; /* per-dev keys */ | 627 | struct ext4_fsmap dkeys[2]; /* per-dev keys */ |
| 628 | struct ext4_getfsmap_dev handlers[EXT4_GETFSMAP_DEVS]; | 628 | struct ext4_getfsmap_dev handlers[EXT4_GETFSMAP_DEVS]; |
| 629 | struct ext4_getfsmap_info info = {0}; | 629 | struct ext4_getfsmap_info info = { NULL }; |
| 630 | int i; | 630 | int i; |
| 631 | int error = 0; | 631 | int error = 0; |
| 632 | 632 | ||
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index 7e85ecf0b849..e486e49b31ed 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c | |||
| @@ -608,7 +608,7 @@ static int ext4_getfsmap_format(struct ext4_fsmap *xfm, void *priv) | |||
| 608 | static int ext4_ioc_getfsmap(struct super_block *sb, | 608 | static int ext4_ioc_getfsmap(struct super_block *sb, |
| 609 | struct fsmap_head __user *arg) | 609 | struct fsmap_head __user *arg) |
| 610 | { | 610 | { |
| 611 | struct getfsmap_info info = {0}; | 611 | struct getfsmap_info info = { NULL }; |
| 612 | struct ext4_fsmap_head xhead = {0}; | 612 | struct ext4_fsmap_head xhead = {0}; |
| 613 | struct fsmap_head head; | 613 | struct fsmap_head head; |
| 614 | bool aborted = false; | 614 | bool aborted = false; |
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 6d50f53b7a15..cd01c4a67ffb 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c | |||
| @@ -872,12 +872,15 @@ static void dx_release(struct dx_frame *frames) | |||
| 872 | { | 872 | { |
| 873 | struct dx_root_info *info; | 873 | struct dx_root_info *info; |
| 874 | int i; | 874 | int i; |
| 875 | unsigned int indirect_levels; | ||
| 875 | 876 | ||
| 876 | if (frames[0].bh == NULL) | 877 | if (frames[0].bh == NULL) |
| 877 | return; | 878 | return; |
| 878 | 879 | ||
| 879 | info = &((struct dx_root *)frames[0].bh->b_data)->info; | 880 | info = &((struct dx_root *)frames[0].bh->b_data)->info; |
| 880 | for (i = 0; i <= info->indirect_levels; i++) { | 881 | /* save local copy, "info" may be freed after brelse() */ |
| 882 | indirect_levels = info->indirect_levels; | ||
| 883 | for (i = 0; i <= indirect_levels; i++) { | ||
| 881 | if (frames[i].bh == NULL) | 884 | if (frames[i].bh == NULL) |
| 882 | break; | 885 | break; |
| 883 | brelse(frames[i].bh); | 886 | brelse(frames[i].bh); |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index f71b5254a990..4079605d437a 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
| @@ -699,7 +699,7 @@ void __ext4_abort(struct super_block *sb, const char *function, | |||
| 699 | jbd2_journal_abort(EXT4_SB(sb)->s_journal, -EIO); | 699 | jbd2_journal_abort(EXT4_SB(sb)->s_journal, -EIO); |
| 700 | save_error_info(sb, function, line); | 700 | save_error_info(sb, function, line); |
| 701 | } | 701 | } |
| 702 | if (test_opt(sb, ERRORS_PANIC)) { | 702 | if (test_opt(sb, ERRORS_PANIC) && !system_going_down()) { |
| 703 | if (EXT4_SB(sb)->s_journal && | 703 | if (EXT4_SB(sb)->s_journal && |
| 704 | !(EXT4_SB(sb)->s_journal->j_flags & JBD2_REC_ERR)) | 704 | !(EXT4_SB(sb)->s_journal->j_flags & JBD2_REC_ERR)) |
| 705 | return; | 705 | return; |
| @@ -4661,7 +4661,7 @@ failed_mount: | |||
| 4661 | 4661 | ||
| 4662 | #ifdef CONFIG_QUOTA | 4662 | #ifdef CONFIG_QUOTA |
| 4663 | for (i = 0; i < EXT4_MAXQUOTAS; i++) | 4663 | for (i = 0; i < EXT4_MAXQUOTAS; i++) |
| 4664 | kfree(sbi->s_qf_names[i]); | 4664 | kfree(get_qf_name(sb, sbi, i)); |
| 4665 | #endif | 4665 | #endif |
| 4666 | ext4_blkdev_remove(sbi); | 4666 | ext4_blkdev_remove(sbi); |
| 4667 | brelse(bh); | 4667 | brelse(bh); |
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 37e16d969925..43df0c943229 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c | |||
| @@ -2375,22 +2375,19 @@ static struct kmem_cache *jbd2_journal_head_cache; | |||
| 2375 | static atomic_t nr_journal_heads = ATOMIC_INIT(0); | 2375 | static atomic_t nr_journal_heads = ATOMIC_INIT(0); |
| 2376 | #endif | 2376 | #endif |
| 2377 | 2377 | ||
| 2378 | static int jbd2_journal_init_journal_head_cache(void) | 2378 | static int __init jbd2_journal_init_journal_head_cache(void) |
| 2379 | { | 2379 | { |
| 2380 | int retval; | 2380 | J_ASSERT(!jbd2_journal_head_cache); |
| 2381 | |||
| 2382 | J_ASSERT(jbd2_journal_head_cache == NULL); | ||
| 2383 | jbd2_journal_head_cache = kmem_cache_create("jbd2_journal_head", | 2381 | jbd2_journal_head_cache = kmem_cache_create("jbd2_journal_head", |
| 2384 | sizeof(struct journal_head), | 2382 | sizeof(struct journal_head), |
| 2385 | 0, /* offset */ | 2383 | 0, /* offset */ |
| 2386 | SLAB_TEMPORARY | SLAB_TYPESAFE_BY_RCU, | 2384 | SLAB_TEMPORARY | SLAB_TYPESAFE_BY_RCU, |
| 2387 | NULL); /* ctor */ | 2385 | NULL); /* ctor */ |
| 2388 | retval = 0; | ||
| 2389 | if (!jbd2_journal_head_cache) { | 2386 | if (!jbd2_journal_head_cache) { |
| 2390 | retval = -ENOMEM; | ||
| 2391 | printk(KERN_EMERG "JBD2: no memory for journal_head cache\n"); | 2387 | printk(KERN_EMERG "JBD2: no memory for journal_head cache\n"); |
| 2388 | return -ENOMEM; | ||
| 2392 | } | 2389 | } |
| 2393 | return retval; | 2390 | return 0; |
| 2394 | } | 2391 | } |
| 2395 | 2392 | ||
| 2396 | static void jbd2_journal_destroy_journal_head_cache(void) | 2393 | static void jbd2_journal_destroy_journal_head_cache(void) |
| @@ -2636,28 +2633,38 @@ static void __exit jbd2_remove_jbd_stats_proc_entry(void) | |||
| 2636 | 2633 | ||
| 2637 | struct kmem_cache *jbd2_handle_cache, *jbd2_inode_cache; | 2634 | struct kmem_cache *jbd2_handle_cache, *jbd2_inode_cache; |
| 2638 | 2635 | ||
| 2636 | static int __init jbd2_journal_init_inode_cache(void) | ||
| 2637 | { | ||
| 2638 | J_ASSERT(!jbd2_inode_cache); | ||
| 2639 | jbd2_inode_cache = KMEM_CACHE(jbd2_inode, 0); | ||
| 2640 | if (!jbd2_inode_cache) { | ||
| 2641 | pr_emerg("JBD2: failed to create inode cache\n"); | ||
| 2642 | return -ENOMEM; | ||
| 2643 | } | ||
| 2644 | return 0; | ||
| 2645 | } | ||
| 2646 | |||
| 2639 | static int __init jbd2_journal_init_handle_cache(void) | 2647 | static int __init jbd2_journal_init_handle_cache(void) |
| 2640 | { | 2648 | { |
| 2649 | J_ASSERT(!jbd2_handle_cache); | ||
| 2641 | jbd2_handle_cache = KMEM_CACHE(jbd2_journal_handle, SLAB_TEMPORARY); | 2650 | jbd2_handle_cache = KMEM_CACHE(jbd2_journal_handle, SLAB_TEMPORARY); |
| 2642 | if (jbd2_handle_cache == NULL) { | 2651 | if (!jbd2_handle_cache) { |
| 2643 | printk(KERN_EMERG "JBD2: failed to create handle cache\n"); | 2652 | printk(KERN_EMERG "JBD2: failed to create handle cache\n"); |
| 2644 | return -ENOMEM; | 2653 | return -ENOMEM; |
| 2645 | } | 2654 | } |
| 2646 | jbd2_inode_cache = KMEM_CACHE(jbd2_inode, 0); | ||
| 2647 | if (jbd2_inode_cache == NULL) { | ||
| 2648 | printk(KERN_EMERG "JBD2: failed to create inode cache\n"); | ||
| 2649 | kmem_cache_destroy(jbd2_handle_cache); | ||
| 2650 | return -ENOMEM; | ||
| 2651 | } | ||
| 2652 | return 0; | 2655 | return 0; |
| 2653 | } | 2656 | } |
| 2654 | 2657 | ||
| 2658 | static void jbd2_journal_destroy_inode_cache(void) | ||
| 2659 | { | ||
| 2660 | kmem_cache_destroy(jbd2_inode_cache); | ||
| 2661 | jbd2_inode_cache = NULL; | ||
| 2662 | } | ||
| 2663 | |||
| 2655 | static void jbd2_journal_destroy_handle_cache(void) | 2664 | static void jbd2_journal_destroy_handle_cache(void) |
| 2656 | { | 2665 | { |
| 2657 | kmem_cache_destroy(jbd2_handle_cache); | 2666 | kmem_cache_destroy(jbd2_handle_cache); |
| 2658 | jbd2_handle_cache = NULL; | 2667 | jbd2_handle_cache = NULL; |
| 2659 | kmem_cache_destroy(jbd2_inode_cache); | ||
| 2660 | jbd2_inode_cache = NULL; | ||
| 2661 | } | 2668 | } |
| 2662 | 2669 | ||
| 2663 | /* | 2670 | /* |
| @@ -2668,21 +2675,27 @@ static int __init journal_init_caches(void) | |||
| 2668 | { | 2675 | { |
| 2669 | int ret; | 2676 | int ret; |
| 2670 | 2677 | ||
| 2671 | ret = jbd2_journal_init_revoke_caches(); | 2678 | ret = jbd2_journal_init_revoke_record_cache(); |
| 2679 | if (ret == 0) | ||
| 2680 | ret = jbd2_journal_init_revoke_table_cache(); | ||
| 2672 | if (ret == 0) | 2681 | if (ret == 0) |
| 2673 | ret = jbd2_journal_init_journal_head_cache(); | 2682 | ret = jbd2_journal_init_journal_head_cache(); |
| 2674 | if (ret == 0) | 2683 | if (ret == 0) |
| 2675 | ret = jbd2_journal_init_handle_cache(); | 2684 | ret = jbd2_journal_init_handle_cache(); |
| 2676 | if (ret == 0) | 2685 | if (ret == 0) |
| 2686 | ret = jbd2_journal_init_inode_cache(); | ||
| 2687 | if (ret == 0) | ||
| 2677 | ret = jbd2_journal_init_transaction_cache(); | 2688 | ret = jbd2_journal_init_transaction_cache(); |
| 2678 | return ret; | 2689 | return ret; |
| 2679 | } | 2690 | } |
| 2680 | 2691 | ||
| 2681 | static void jbd2_journal_destroy_caches(void) | 2692 | static void jbd2_journal_destroy_caches(void) |
| 2682 | { | 2693 | { |
| 2683 | jbd2_journal_destroy_revoke_caches(); | 2694 | jbd2_journal_destroy_revoke_record_cache(); |
| 2695 | jbd2_journal_destroy_revoke_table_cache(); | ||
| 2684 | jbd2_journal_destroy_journal_head_cache(); | 2696 | jbd2_journal_destroy_journal_head_cache(); |
| 2685 | jbd2_journal_destroy_handle_cache(); | 2697 | jbd2_journal_destroy_handle_cache(); |
| 2698 | jbd2_journal_destroy_inode_cache(); | ||
| 2686 | jbd2_journal_destroy_transaction_cache(); | 2699 | jbd2_journal_destroy_transaction_cache(); |
| 2687 | jbd2_journal_destroy_slabs(); | 2700 | jbd2_journal_destroy_slabs(); |
| 2688 | } | 2701 | } |
diff --git a/fs/jbd2/revoke.c b/fs/jbd2/revoke.c index a1143e57a718..69b9bc329964 100644 --- a/fs/jbd2/revoke.c +++ b/fs/jbd2/revoke.c | |||
| @@ -178,33 +178,41 @@ static struct jbd2_revoke_record_s *find_revoke_record(journal_t *journal, | |||
| 178 | return NULL; | 178 | return NULL; |
| 179 | } | 179 | } |
| 180 | 180 | ||
| 181 | void jbd2_journal_destroy_revoke_caches(void) | 181 | void jbd2_journal_destroy_revoke_record_cache(void) |
| 182 | { | 182 | { |
| 183 | kmem_cache_destroy(jbd2_revoke_record_cache); | 183 | kmem_cache_destroy(jbd2_revoke_record_cache); |
| 184 | jbd2_revoke_record_cache = NULL; | 184 | jbd2_revoke_record_cache = NULL; |
| 185 | } | ||
| 186 | |||
| 187 | void jbd2_journal_destroy_revoke_table_cache(void) | ||
| 188 | { | ||
| 185 | kmem_cache_destroy(jbd2_revoke_table_cache); | 189 | kmem_cache_destroy(jbd2_revoke_table_cache); |
| 186 | jbd2_revoke_table_cache = NULL; | 190 | jbd2_revoke_table_cache = NULL; |
| 187 | } | 191 | } |
| 188 | 192 | ||
| 189 | int __init jbd2_journal_init_revoke_caches(void) | 193 | int __init jbd2_journal_init_revoke_record_cache(void) |
| 190 | { | 194 | { |
| 191 | J_ASSERT(!jbd2_revoke_record_cache); | 195 | J_ASSERT(!jbd2_revoke_record_cache); |
| 192 | J_ASSERT(!jbd2_revoke_table_cache); | ||
| 193 | |||
| 194 | jbd2_revoke_record_cache = KMEM_CACHE(jbd2_revoke_record_s, | 196 | jbd2_revoke_record_cache = KMEM_CACHE(jbd2_revoke_record_s, |
| 195 | SLAB_HWCACHE_ALIGN|SLAB_TEMPORARY); | 197 | SLAB_HWCACHE_ALIGN|SLAB_TEMPORARY); |
| 196 | if (!jbd2_revoke_record_cache) | ||
| 197 | goto record_cache_failure; | ||
| 198 | 198 | ||
| 199 | if (!jbd2_revoke_record_cache) { | ||
| 200 | pr_emerg("JBD2: failed to create revoke_record cache\n"); | ||
| 201 | return -ENOMEM; | ||
| 202 | } | ||
| 203 | return 0; | ||
| 204 | } | ||
| 205 | |||
| 206 | int __init jbd2_journal_init_revoke_table_cache(void) | ||
| 207 | { | ||
| 208 | J_ASSERT(!jbd2_revoke_table_cache); | ||
| 199 | jbd2_revoke_table_cache = KMEM_CACHE(jbd2_revoke_table_s, | 209 | jbd2_revoke_table_cache = KMEM_CACHE(jbd2_revoke_table_s, |
| 200 | SLAB_TEMPORARY); | 210 | SLAB_TEMPORARY); |
| 201 | if (!jbd2_revoke_table_cache) | 211 | if (!jbd2_revoke_table_cache) { |
| 202 | goto table_cache_failure; | 212 | pr_emerg("JBD2: failed to create revoke_table cache\n"); |
| 203 | return 0; | ||
| 204 | table_cache_failure: | ||
| 205 | jbd2_journal_destroy_revoke_caches(); | ||
| 206 | record_cache_failure: | ||
| 207 | return -ENOMEM; | 213 | return -ENOMEM; |
| 214 | } | ||
| 215 | return 0; | ||
| 208 | } | 216 | } |
| 209 | 217 | ||
| 210 | static struct jbd2_revoke_table_s *jbd2_journal_init_revoke_table(int hash_size) | 218 | static struct jbd2_revoke_table_s *jbd2_journal_init_revoke_table(int hash_size) |
diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c index f940d31c2adc..8ca4fddc705f 100644 --- a/fs/jbd2/transaction.c +++ b/fs/jbd2/transaction.c | |||
| @@ -42,9 +42,11 @@ int __init jbd2_journal_init_transaction_cache(void) | |||
| 42 | 0, | 42 | 0, |
| 43 | SLAB_HWCACHE_ALIGN|SLAB_TEMPORARY, | 43 | SLAB_HWCACHE_ALIGN|SLAB_TEMPORARY, |
| 44 | NULL); | 44 | NULL); |
| 45 | if (transaction_cache) | 45 | if (!transaction_cache) { |
| 46 | return 0; | 46 | pr_emerg("JBD2: failed to create transaction cache\n"); |
| 47 | return -ENOMEM; | 47 | return -ENOMEM; |
| 48 | } | ||
| 49 | return 0; | ||
| 48 | } | 50 | } |
| 49 | 51 | ||
| 50 | void jbd2_journal_destroy_transaction_cache(void) | 52 | void jbd2_journal_destroy_transaction_cache(void) |
diff --git a/fs/unicode/README.utf8data b/fs/unicode/README.utf8data index 9307cf0727de..c73786807d3b 100644 --- a/fs/unicode/README.utf8data +++ b/fs/unicode/README.utf8data | |||
| @@ -5,29 +5,15 @@ The full set of files can be found here: | |||
| 5 | 5 | ||
| 6 | http://www.unicode.org/Public/12.1.0/ucd/ | 6 | http://www.unicode.org/Public/12.1.0/ucd/ |
| 7 | 7 | ||
| 8 | Note! | ||
| 9 | |||
| 10 | The URL's listed below are not stable. That's because Unicode 12.1.0 | ||
| 11 | has not been officially released yet; it is scheduled to be released | ||
| 12 | on May 8, 2019. We taking Unicode 12.1.0 a few weeks early because it | ||
| 13 | contains a new Japanese character which is required in order to | ||
| 14 | specify Japenese dates after May 1, 2019, when Crown Prince Naruhito | ||
| 15 | ascends to the Chrysanthemum Throne. (Isn't internationalization fun? | ||
| 16 | The abdication of Emperor Akihito of Japan is requiring dozens of | ||
| 17 | software packages to be updated with only a month's notice. :-) | ||
| 18 | |||
| 19 | We will update the URL's (and any needed changes to the checksums) | ||
| 20 | after the final Unicode 12.1.0 is released. | ||
| 21 | |||
| 22 | Individual source links: | 8 | Individual source links: |
| 23 | 9 | ||
| 24 | https://www.unicode.org/Public/12.1.0/ucd/CaseFolding-12.1.0d2.txt | 10 | https://www.unicode.org/Public/12.1.0/ucd/CaseFolding.txt |
| 25 | https://www.unicode.org/Public/12.1.0/ucd/DerivedAge-12.1.0d3.txt | 11 | https://www.unicode.org/Public/12.1.0/ucd/DerivedAge.txt |
| 26 | https://www.unicode.org/Public/12.1.0/ucd/extracted/DerivedCombiningClass-12.1.0d2.txt | 12 | https://www.unicode.org/Public/12.1.0/ucd/extracted/DerivedCombiningClass.txt |
| 27 | https://www.unicode.org/Public/12.1.0/ucd/DerivedCoreProperties-12.1.0d2.txt | 13 | https://www.unicode.org/Public/12.1.0/ucd/DerivedCoreProperties.txt |
| 28 | https://www.unicode.org/Public/12.1.0/ucd/NormalizationCorrections-12.1.0d1.txt | 14 | https://www.unicode.org/Public/12.1.0/ucd/NormalizationCorrections.txt |
| 29 | https://www.unicode.org/Public/12.1.0/ucd/NormalizationTest-12.1.0d3.txt | 15 | https://www.unicode.org/Public/12.1.0/ucd/NormalizationTest.txt |
| 30 | https://www.unicode.org/Public/12.1.0/ucd/UnicodeData-12.1.0d2.txt | 16 | https://www.unicode.org/Public/12.1.0/ucd/UnicodeData.txt |
| 31 | 17 | ||
| 32 | md5sums (verify by running "md5sum -c README.utf8data"): | 18 | md5sums (verify by running "md5sum -c README.utf8data"): |
| 33 | 19 | ||
diff --git a/fs/unicode/utf8-norm.c b/fs/unicode/utf8-norm.c index 20d440c3f2db..801ed6d2ea37 100644 --- a/fs/unicode/utf8-norm.c +++ b/fs/unicode/utf8-norm.c | |||
| @@ -714,6 +714,8 @@ int utf8byte(struct utf8cursor *u8c) | |||
| 714 | } | 714 | } |
| 715 | 715 | ||
| 716 | leaf = utf8lookup(u8c->data, u8c->hangul, u8c->s); | 716 | leaf = utf8lookup(u8c->data, u8c->hangul, u8c->s); |
| 717 | if (!leaf) | ||
| 718 | return -1; | ||
| 717 | ccc = LEAF_CCC(leaf); | 719 | ccc = LEAF_CCC(leaf); |
| 718 | } | 720 | } |
| 719 | 721 | ||
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index c2ffff5f9ae2..6c9870e16b19 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
| @@ -1318,7 +1318,7 @@ extern void __wait_on_journal (journal_t *); | |||
| 1318 | 1318 | ||
| 1319 | /* Transaction cache support */ | 1319 | /* Transaction cache support */ |
| 1320 | extern void jbd2_journal_destroy_transaction_cache(void); | 1320 | extern void jbd2_journal_destroy_transaction_cache(void); |
| 1321 | extern int jbd2_journal_init_transaction_cache(void); | 1321 | extern int __init jbd2_journal_init_transaction_cache(void); |
| 1322 | extern void jbd2_journal_free_transaction(transaction_t *); | 1322 | extern void jbd2_journal_free_transaction(transaction_t *); |
| 1323 | 1323 | ||
| 1324 | /* | 1324 | /* |
| @@ -1446,8 +1446,10 @@ static inline void jbd2_free_inode(struct jbd2_inode *jinode) | |||
| 1446 | /* Primary revoke support */ | 1446 | /* Primary revoke support */ |
| 1447 | #define JOURNAL_REVOKE_DEFAULT_HASH 256 | 1447 | #define JOURNAL_REVOKE_DEFAULT_HASH 256 |
| 1448 | extern int jbd2_journal_init_revoke(journal_t *, int); | 1448 | extern int jbd2_journal_init_revoke(journal_t *, int); |
| 1449 | extern void jbd2_journal_destroy_revoke_caches(void); | 1449 | extern void jbd2_journal_destroy_revoke_record_cache(void); |
| 1450 | extern int jbd2_journal_init_revoke_caches(void); | 1450 | extern void jbd2_journal_destroy_revoke_table_cache(void); |
| 1451 | extern int __init jbd2_journal_init_revoke_record_cache(void); | ||
| 1452 | extern int __init jbd2_journal_init_revoke_table_cache(void); | ||
| 1451 | 1453 | ||
| 1452 | extern void jbd2_journal_destroy_revoke(journal_t *); | 1454 | extern void jbd2_journal_destroy_revoke(journal_t *); |
| 1453 | extern int jbd2_journal_revoke (handle_t *, unsigned long long, struct buffer_head *); | 1455 | extern int jbd2_journal_revoke (handle_t *, unsigned long long, struct buffer_head *); |
