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

Configure Feed

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

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

Pull exfat fixes from Namjae Jeon:

- Fix use of uninitialized spinlock on error path

- Fix missing err assignment in exfat_build_inode()

* tag 'exfat-for-5.9-rc9' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat:
exfat: fix use of uninitialized spinlock on error path
exfat: fix pointer error checking

+12 -22
-11
fs/exfat/cache.c
··· 17 17 #include "exfat_raw.h" 18 18 #include "exfat_fs.h" 19 19 20 - #define EXFAT_CACHE_VALID 0 21 20 #define EXFAT_MAX_CACHE 16 22 21 23 22 struct exfat_cache { ··· 58 59 if (!exfat_cachep) 59 60 return; 60 61 kmem_cache_destroy(exfat_cachep); 61 - } 62 - 63 - void exfat_cache_init_inode(struct inode *inode) 64 - { 65 - struct exfat_inode_info *ei = EXFAT_I(inode); 66 - 67 - spin_lock_init(&ei->cache_lru_lock); 68 - ei->nr_caches = 0; 69 - ei->cache_valid_id = EXFAT_CACHE_VALID + 1; 70 - INIT_LIST_HEAD(&ei->cache_lru); 71 62 } 72 63 73 64 static inline struct exfat_cache *exfat_cache_alloc(void)
+2 -1
fs/exfat/exfat_fs.h
··· 248 248 struct rcu_head rcu; 249 249 }; 250 250 251 + #define EXFAT_CACHE_VALID 0 252 + 251 253 /* 252 254 * EXFAT file system inode in-memory data 253 255 */ ··· 430 428 /* cache.c */ 431 429 int exfat_cache_init(void); 432 430 void exfat_cache_shutdown(void); 433 - void exfat_cache_init_inode(struct inode *inode); 434 431 void exfat_cache_inval_inode(struct inode *inode); 435 432 int exfat_get_cluster(struct inode *inode, unsigned int cluster, 436 433 unsigned int *fclus, unsigned int *dclus,
-2
fs/exfat/inode.c
··· 611 611 ei->i_crtime = info->crtime; 612 612 inode->i_atime = info->atime; 613 613 614 - exfat_cache_init_inode(inode); 615 - 616 614 return 0; 617 615 } 618 616
+6 -7
fs/exfat/namei.c
··· 578 578 579 579 i_pos = exfat_make_i_pos(&info); 580 580 inode = exfat_build_inode(sb, &info, i_pos); 581 - if (IS_ERR(inode)) 581 + err = PTR_ERR_OR_ZERO(inode); 582 + if (err) 582 583 goto unlock; 583 584 584 585 inode_inc_iversion(inode); ··· 746 745 747 746 i_pos = exfat_make_i_pos(&info); 748 747 inode = exfat_build_inode(sb, &info, i_pos); 749 - if (IS_ERR(inode)) { 750 - err = PTR_ERR(inode); 748 + err = PTR_ERR_OR_ZERO(inode); 749 + if (err) 751 750 goto unlock; 752 - } 753 751 754 752 i_mode = inode->i_mode; 755 753 alias = d_find_alias(inode); ··· 890 890 891 891 i_pos = exfat_make_i_pos(&info); 892 892 inode = exfat_build_inode(sb, &info, i_pos); 893 - if (IS_ERR(inode)) { 894 - err = PTR_ERR(inode); 893 + err = PTR_ERR_OR_ZERO(inode); 894 + if (err) 895 895 goto unlock; 896 - } 897 896 898 897 inode_inc_iversion(inode); 899 898 inode->i_mtime = inode->i_atime = inode->i_ctime =
+4 -1
fs/exfat/super.c
··· 376 376 inode->i_mtime = inode->i_atime = inode->i_ctime = ei->i_crtime = 377 377 current_time(inode); 378 378 exfat_truncate_atime(&inode->i_atime); 379 - exfat_cache_init_inode(inode); 380 379 return 0; 381 380 } 382 381 ··· 762 763 { 763 764 struct exfat_inode_info *ei = (struct exfat_inode_info *)foo; 764 765 766 + spin_lock_init(&ei->cache_lru_lock); 767 + ei->nr_caches = 0; 768 + ei->cache_valid_id = EXFAT_CACHE_VALID + 1; 769 + INIT_LIST_HEAD(&ei->cache_lru); 765 770 INIT_HLIST_NODE(&ei->i_hash_fat); 766 771 inode_init_once(&ei->vfs_inode); 767 772 }