Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3638979rwb; Fri, 16 Dec 2022 19:10:08 -0800 (PST) X-Google-Smtp-Source: AMrXdXuAL0EPLM7nGwxHftJ0hWDAYERnNPWcZ/6+vf0Kd2AfBmgwE8QC2YwTKpc/ljIRtIhWs97c X-Received: by 2002:aa7:9e02:0:b0:57f:7d69:8d94 with SMTP id y2-20020aa79e02000000b0057f7d698d94mr2452955pfq.22.1671246608014; Fri, 16 Dec 2022 19:10:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671246608; cv=none; d=google.com; s=arc-20160816; b=rdhq7pTgiD1sYa64J9MHB4dv006TPu35tlYAhdKMHbv8hd/NuQg2eVnVmuYDPPfgE3 75xIC2RZY5ii6TGsOotxOF+tv0O8zZcGfIMGmnHHDHPYdEZxo7ud5oYaTliwPfYTTxCA 9u1NFOd3PFEcYPdaPsPuQVJpzmK3kAF6Y5XrbWHYKfaLKmmGUtnQG7yyWWVKkkMwbe3D VMwJPgNyZzEFE9kqnRWfHxxGC2JTjGyRyukyxZb9Brb9sn+lPTz0wcNSdVLdSNV1+wdX FII/cCmhC4LiKxIxeZ079v1NyAccRJ24TJhi1vOHH26kqGV0p0a+uGGeaK7MqFKtwpfE rKaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=rDL8tnitaQywuK8uK+qrOsqs8vWLvH4RSUerBnYD0Hg=; b=hzc06M2t7fYRoXOfzBHbemz91mbsoOS4jrMZnSDGl2PYlSHrVV9SPqa09L61n5Cc9B tuaRTWWpCsraPj+dTXoup0/OvRnbm3udrEDBF58I04n74ibv01Esh+UKAdKbg0Yxqhz8 Xa513s0slMcQm6Rgdrynb7La1rFhZaEWasjlILmle5ojQjYBNBR0GhWzYW55wG/gqGNW /ARlsVj1YqaQJIdwokHq6LS4l6RkXjfh+K8F6xYdEPDE7PIAgjjUdNFF9xQgHI5EjcCA dEf+9gASFOVynNuLMgRC4JZT1Nd37k1Cmi2jPNvWtDDWCUZOLQhKh2ULw6cSGUwU3iWy 7qDA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k6-20020a056a00134600b0056cb8f6f027si4402423pfu.357.2022.12.16.19.09.58; Fri, 16 Dec 2022 19:10:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230078AbiLQCUr (ORCPT + 69 others); Fri, 16 Dec 2022 21:20:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbiLQCUp (ORCPT ); Fri, 16 Dec 2022 21:20:45 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7D4D2DEE; Fri, 16 Dec 2022 18:20:42 -0800 (PST) Received: from kwepemm600015.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NYqRX0pdvzRq6D; Sat, 17 Dec 2022 10:19:36 +0800 (CST) Received: from [10.174.176.52] (10.174.176.52) by kwepemm600015.china.huawei.com (7.193.23.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Sat, 17 Dec 2022 10:20:40 +0800 Message-ID: Date: Sat, 17 Dec 2022 10:20:39 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: [PATCH v2 2/2] hfsplus: fix uninit-value in hfsplus_delete_cat() To: Viacheslav Dubeyko CC: Bart Van Assche , Andrew Morton , Aditya Garg , Jens Axboe , "Matthew Wilcox (Oracle)" , Damien Le Moal , Jeff Layton , , "Theodore Y . Ts'o" , , Linux FS Devel , References: <20221215081820.948990-1-chenxiaosong2@huawei.com> <20221215081820.948990-3-chenxiaosong2@huawei.com> <6258B9FC-0A00-46BC-9C6C-720963D58A06@dubeyko.com> <946950be-482c-ef9f-404c-2ce758ba175d@huawei.com> <6B5CECB6-C620-479A-A8EC-817CCCD9ECBB@dubeyko.com> From: ChenXiaoSong In-Reply-To: <6B5CECB6-C620-479A-A8EC-817CCCD9ECBB@dubeyko.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.176.52] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemm600015.china.huawei.com (7.193.23.52) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 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; ... ```