Re: [PATCH v2 2/2] hfsplus: fix uninit-value in hfsplus_delete_cat()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



在 2022/12/17 2:09, Viacheslav Dubeyko 写道>
So, where is here hip->subfolders = 0; /* I am here */? Sorry, maybe I missed some email.


1/2 patch do not show more detail about 'hip->subfolders ', you can apply the patchset to baseline and use '--unified' option to 'git show' more detail:

```shell
git am '1/2 of the patchset' # to baseline
git show 'commit of 1/2 patch' --unified=16 # specify 16 lines of context instead of the default 3 lines
```

then you can see more detail as follows:

```shell
...
-struct inode *hfsplus_new_inode(struct super_block *sb, struct inode *dir,
-                               umode_t mode)
+void hfsplus_init_inode(struct hfsplus_inode_info *hip)
 {
-       struct hfsplus_sb_info *sbi = HFSPLUS_SB(sb);
-       struct inode *inode = new_inode(sb);
-       struct hfsplus_inode_info *hip;
-
-       if (!inode)
-               return NULL;
-
-       inode->i_ino = sbi->next_cnid++;
-       inode_init_owner(&init_user_ns, inode, dir, mode);
-       set_nlink(inode, 1);
- inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
-
-       hip = HFSPLUS_I(inode);
        INIT_LIST_HEAD(&hip->open_dir_list);
        spin_lock_init(&hip->open_dir_lock);
        mutex_init(&hip->extents_lock);
        atomic_set(&hip->opencnt, 0);
        hip->extent_state = 0;
        hip->flags = 0;
        hip->userflags = 0;
        hip->subfolders = 0; /********* I am here *****************/
        memset(hip->first_extents, 0, sizeof(hfsplus_extent_rec));
        memset(hip->cached_extents, 0, sizeof(hfsplus_extent_rec));
        hip->alloc_blocks = 0;
        hip->first_blocks = 0;
        hip->cached_start = 0;
        hip->cached_blocks = 0;
        hip->phys_size = 0;
        hip->fs_blocks = 0;
        hip->rsrc_inode = NULL;
+}
+
+struct inode *hfsplus_new_inode(struct super_block *sb, struct inode *dir,
+                               umode_t mode)
+{
+       struct hfsplus_sb_info *sbi = HFSPLUS_SB(sb);
+       struct inode *inode = new_inode(sb);
+       struct hfsplus_inode_info *hip;
+
+       if (!inode)
+               return NULL;
+
+       inode->i_ino = sbi->next_cnid++;
+       inode_init_owner(&init_user_ns, inode, dir, mode);
+       set_nlink(inode, 1);
+ inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
+
+       hip = HFSPLUS_I(inode);
+       hfsplus_init_inode(hip);
        if (S_ISDIR(inode->i_mode)) {
                inode->i_size = 2;
                sbi->folder_count++;
                inode->i_op = &hfsplus_dir_inode_operations;
...
```



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux