From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935688AbdADIwL (ORCPT ); Wed, 4 Jan 2017 03:52:11 -0500 Received: from szxga01-in.huawei.com ([58.251.152.64]:37215 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758329AbdADIwB (ORCPT ); Wed, 4 Jan 2017 03:52:01 -0500 Subject: Re: [RFC PATCH] ext4: increase the protection of drop nlink and ext4 inode destroy To: References: <1482755657-28791-1-git-send-email-yi.zhang@huawei.com> <141922.1483225153@turing-police.cc.vt.edu> CC: , , , , From: "zhangyi (F)" Message-ID: <10c6fa5d-a7bb-a87c-11ad-8d30230a6075@huawei.com> Date: Wed, 4 Jan 2017 16:29:33 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <141922.1483225153@turing-police.cc.vt.edu> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.244.145] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020205.586CB72E.02BC,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: a7049b29909c18362f0ee5c22844f0b9 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017/1/1 6:59, Valdis.Kletnieks@vt.edu said: > On Mon, 26 Dec 2016 20:34:17 +0800, yi zhang said: >> Because of the disk and hardware issue, the ext4 filesystem have >> many errors, the inode->i_nlink of ext4 becomes zero abnormally >> but the dentry is still positive, it will cause memory corruption >> after the following process: >> >> 1) Due to the inode->i_nlink is 0, this inode will be added into >> the orhpan list, > >> + if (WARN(inode->i_nlink == 0, "inode %lu nlink" >> + " is already 0", inode->i_ino)) > > Can we get the filesystem? Or at least the device major/minor? If a system > has multiple large ext4 filesystems, it would be helpful to know which > one is having the problem. > if (WARN(inode->i_nlink == 0, - "inode %lu nlink is already 0", inode->i_ino)) + "inode %lu nlink is already 0, dev=%u:%u", + inode->i_ino, MAJOR(inode->i_sb->s_dev), MINOR(inode->i_sb->s_dev))) return; We can modify as above, it's enough to know which filesystem is having the problem, what do you think? yi zhang