Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp91957ybt; Mon, 6 Jul 2020 04:56:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2fZsnW92AZb4p3xE2r9ujGRlS6Y5kbyEbdXYBKQDwGFFs2exLHpHxhYKM0nX6B825F42E X-Received: by 2002:a05:6402:354:: with SMTP id r20mr56516421edw.32.1594036562205; Mon, 06 Jul 2020 04:56:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594036562; cv=none; d=google.com; s=arc-20160816; b=FBiSbaWprEPqOCc6CEfxlnwBjea1PZBrvTZ8KiliEmHxJuv8k43p8+gGFfVjwYFvGT SiOIKo4Gwc43KIIdnihD8biEbm8Z2CNJXUV/68sF3RXNS7eQpwJ2zgpaFuJIXcYmSh9O Y/jzOC2vSzN+tTge29SMtNqnQKhmkRwIBx31ZYO+HTyeT1o1l3BAQgnAWiwa4Pn7Fhvn WnfDp5Q9lIfGM028IgdU1WFoRHw4wAo0k9HGH+OgYWnxK+v7ynKFrcCOCEQN9aweovEJ zZsFZlzFvhqs+24LO3PSPrmBdv2aG6qJN6O8MuWT6LDGkugfB7W7eGkxEgEGcdLhOmcx IxsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type :content-transfer-encoding:date:message-id:in-reply-to:cc:to:from :reply-to:subject:mime-version:dkim-signature:dkim-filter; bh=YWg4luROLP4xBfYG4qczq7X6qEYCnDiWFsPOOppQygw=; b=0+/Cz/fEWyjjmwzxGF8z0E7gT0G+Vjk2ilrkDOVBYIe83AeMgthwQkk0GaX9YNV7o6 ICtR2Uqfn4VaH7u25olTiLT5nxAKJbibx5rl7XLOaeMc57vG8e0upNYeVUx1rh4c4cKP dLuwrAS+wLTzQwzqPde9EMuvdy9ATCN885X0vX9wGIdfwyITuitKs91A/Jntt8a7vz5i 9uv3eK2atOfCGSN+3nQm1pZ49y/cjEb0JEGx9BZlAiImLE0DMfJ2v7fPSboxHZ0wKGkC vnq3U3ZA/QnM2vCbaw4beYh8YN5JnZ4+FbmwEGJgCza2uhd5jCGcNG9s3i+BLkFYa4pU bphg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=CoLuSu+I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gs7si13260201ejb.262.2020.07.06.04.55.39; Mon, 06 Jul 2020 04:56:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=CoLuSu+I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729011AbgGFLxZ (ORCPT + 99 others); Mon, 6 Jul 2020 07:53:25 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:54675 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728945AbgGFLxZ (ORCPT ); Mon, 6 Jul 2020 07:53:25 -0400 Received: from epcas5p2.samsung.com (unknown [182.195.41.40]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20200706115321epoutp031b11f6797596bb9140452bfaeea91262~fJ6l66Gef1566215662epoutp03e for ; Mon, 6 Jul 2020 11:53:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20200706115321epoutp031b11f6797596bb9140452bfaeea91262~fJ6l66Gef1566215662epoutp03e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594036402; bh=YWg4luROLP4xBfYG4qczq7X6qEYCnDiWFsPOOppQygw=; h=Subject:Reply-To:From:To:CC:In-Reply-To:Date:References:From; b=CoLuSu+Iat8YGHYQl9Z7e8HOUhi39FwXRvzXs+ldki0N8IgxaVmD2ck7SX2i3+CKa XFFTM9c3JafdNcrSDkgU+RXP3T7OQTXpyeT/0bXaHWzT043U/dc7WfpEDfVLsk7sdy Zw3G/33/0PmSJXiVKfnSWoeRHE6RagWJdYZDdWwQ= Received: from epsmges5p2new.samsung.com (unknown [182.195.42.74]) by epcas5p4.samsung.com (KnoxPortal) with ESMTP id 20200706115321epcas5p491b6d727c6a794a976ed928f07e07263~fJ6lBgaDw2065120651epcas5p4F; Mon, 6 Jul 2020 11:53:21 +0000 (GMT) X-AuditID: b6c32a4a-4cbff700000025e7-ba-5f0310b00d30 Received: from epcas5p2.samsung.com ( [182.195.41.40]) by epsmges5p2new.samsung.com (Symantec Messaging Gateway) with SMTP id D5.18.09703.0B0130F5; Mon, 6 Jul 2020 20:53:20 +0900 (KST) Mime-Version: 1.0 Subject: RE: [PATCH] fs: fat: add check for dir size in fat_calc_dir_size Reply-To: anupam.al@samsung.com From: Anupam Aggarwal To: OGAWA Hirofumi CC: AMIT SAHRAWAT , VIVEK TRIVEDI , "linux-kernel@vger.kernel.org" X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: <87zh8gct29.fsf@mail.parknet.co.jp> X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20200706115303epcms5p262a630cd1517632c48e4f72a68d98b0c@epcms5p2> Date: Mon, 06 Jul 2020 17:23:03 +0530 X-CMS-MailID: 20200706115303epcms5p262a630cd1517632c48e4f72a68d98b0c Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: REQ_APPROV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x12BUYinOSDTUYi4qTgQAXp0twooDAAA= X-CMS-RootMailID: 20200629110320epcas5p34ccccc7c293f077b34b350935c328215 References: <87zh8gct29.fsf@mail.parknet.co.jp> <20200630170748epcms5p87fa9b4348c1448d2d5a5f6cdddbc021e@epcms5p8> <875zb8o6zh.fsf@mail.parknet.co.jp> <87ftacolpf.fsf@mail.parknet.co.jp> <1593428559-13920-1-git-send-email-anupam.al@samsung.com> <20200630123355epcms5p602efe0e4ceedcfe11eae2153c8466678@epcms5p6> <20200703142939epcms5p1440ec65f7e8a3e4741ade2496135d747@epcms5p1> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ogawa, >Anyway, fsck would be main way. And on other hand, if we want to add >mitigation for corruption, we would have to see much more details of >this corruption. Can you put somewhere to access the corrupted image >(need the only metadata) to reproduce? Sorry, uploading of any file not allowed from within. So, metadata image is not possible to be shared via. upload. Can try to arrange few more logs via. fsck. >What happens if you recursively traversed directories on Windows? This >issue happens on Windows too? After connecting USB to windows 10, when corrupted dir(\CorruptedDIR) is browsed, it shows 2623 number of files and directories, without delay. Name and timestamps of those file/directories are garbage values. Further if we browse these sub-directories and open files of corrupted dir(\CorruptedDIR) following popups are coming on Windows 10: 1. The filename, directory name, or volume label syntax is incorrect 2. Specified path does not exist. Check the path and try again So issue of un-ending browsing(ls -lR) of corrupted USB is not coming on windows 10, it lists limited number of files/directories, of corrupted dir(\CorruptedDIR) without delay. >BTW, if you run fsck, the corrupted directories and issue are gone at >least? Yes, issues are gone, after running "chkdsk /f" on USB, on Windows 10 PC, corrupted directory(\CorruptedDIR) is converted to file of 1.06 GB, so issues are not coming further. Following is the output of chkdsk write only mode. -------------------------------------------------------------------------------------- chkdsk /f e: The type of the file system is FAT32. Volume AAA created 12/28/2018 3:15 PM Volume Serial Number is 1606-72DC Windows is verifying files and folders... The \$TXRAJNL.DAT entry contains a nonvalid link. The size of the \$TXRAJNL.DAT entry is not valid. Unrecoverable error in folder \CorruptedDIR. Convert folder to file (Y/N)? Y \DDD\file.txt is cross-linked on allocation unit 736512. Cross link resolved by copying. \BBB\file1.txt is cross-linked on allocation unit 433153. Cross link resolved by copying. \System Volume Information\LightningSand.CFD is cross-linked on allocation unit 1114114. Cross link resolved by copying. \CCC\file1.txt is cross-linked on allocation unit 179989. Cross link resolved by copying. File and folder verification is complete. Convert lost chains to files (Y/N)? Y 3531520 KB in 31 recovered files. Windows has made corrections to the file system. No further action is required. 30,015,472 KB total disk space. 400 KB in 2 hidden files. 2,816 KB in 49 folders. 23,470,800 KB in 7,616 files. 6,539,408 KB are available. 16,384 bytes in each allocation unit. 1,875,967 total allocation units on disk. 408,713 allocation units available on disk. -------------------------------------------------------------------------------------- Thanks, Anupam