lkml.org 
[lkml]   [2022]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 2/2] hfsplus: fix uninit-value in hfsplus_delete_cat()
From
在 2022/12/16 3:03, Viacheslav Dubeyko 写道:
>
> Maybe, I am missing something. But where in the second version of the patch
> initialization of subfolders?
>

The first patch of the patchset factor out hfsplus_init_inode() from
hfsplus_new_inode():

void hfsplus_init_inode(struct hfsplus_inode_info *hip)
{
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;
}

\
 
 \ /
  Last update: 2022-12-16 02:17    [W:0.143 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site