From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DDD61279DAB for ; Sat, 7 Feb 2026 07:59:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770451201; cv=none; b=oAVgIJpPhSQhPnZu8MjPBNPOtERq3Zu6qtPs9OZvuVhO9FIO1kbZBRi2k4fI+3eDomTvsmQrl1UKz3hNYkI16ggSBTSHu1ACK1CO0HRuysu9BROvCkoytROTf8kX8HAPjqWFdCsGKeizieD5jvewo2hrpQNFZNfAPEFDuJ+pcq0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770451201; c=relaxed/simple; bh=uzbDowtU3uAhAaR4DcradKqzdUW4CtEqgUlCTDkLDms=; h=Subject:To:CC:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=iPoI4KSpgp8CviY1yGR9829ABvyAXsogI4zmQjhsNfp332lLaVfTRd5tsdt48NcBlkRM6Iu1aqpSYa3erBHsWo5e+xd4RSwK9CW0Rfv7pysSvjTtd6q1xpoXbxD5XGCv6QgD6LB8BRzvBDIq05KQMtUEd1yRzAnm1pA8VG8GlIs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=N6LFfqul; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=N6LFfqul; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="N6LFfqul"; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="N6LFfqul" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=ck6XkZNOCX8yHIJxvxMlr2RiEQH4smBz5FbWUWkcWmA=; b=N6LFfqul0VJYjj7DOr5R1AY3Cr4F343xtdUklMYI3t+V2Q8nuYUd2PV1e0ysBH4NEkYqjZBvw M3KzR7FdAsrZmfugE0Q5DS/gXKLlBIKjgFpOUXhYxzvVj6Sl93vchGCWB3bes2/iyIhUgyl5TZu J7Pf+RYHlo9nka/5uFsTQjE= Received: from canpmsgout12.his.huawei.com (unknown [172.19.92.144]) by szxga01-in.huawei.com (SkyGuard) with ESMTPS id 4f7NdS2FqQz1BFPF for ; Sat, 7 Feb 2026 15:59:08 +0800 (CST) dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=ck6XkZNOCX8yHIJxvxMlr2RiEQH4smBz5FbWUWkcWmA=; b=N6LFfqul0VJYjj7DOr5R1AY3Cr4F343xtdUklMYI3t+V2Q8nuYUd2PV1e0ysBH4NEkYqjZBvw M3KzR7FdAsrZmfugE0Q5DS/gXKLlBIKjgFpOUXhYxzvVj6Sl93vchGCWB3bes2/iyIhUgyl5TZu J7Pf+RYHlo9nka/5uFsTQjE= Received: from mail.maildlp.com (unknown [172.19.162.92]) by canpmsgout12.his.huawei.com (SkyGuard) with ESMTPS id 4f7NYp5dFBznTbf; Sat, 7 Feb 2026 15:55:58 +0800 (CST) Received: from kwepemk500005.china.huawei.com (unknown [7.202.194.90]) by mail.maildlp.com (Postfix) with ESMTPS id DF4A740562; Sat, 7 Feb 2026 15:59:46 +0800 (CST) Received: from [10.174.178.46] (10.174.178.46) by kwepemk500005.china.huawei.com (7.202.194.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Sat, 7 Feb 2026 15:59:46 +0800 Subject: Re: [PATCH] jffs2: use fs_umode_to_dtype() for dirent type To: Adarsh Das CC: , , , References: <134dec36-3bcf-89a4-2817-a880afa4280f@huawei.com> <20260207073948.48144-1-adarshdas950@gmail.com> From: Zhihao Cheng Message-ID: <6fed1bb5-7d9a-c60d-f243-4e06d29c8af8@huawei.com> Date: Sat, 7 Feb 2026 15:59:44 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <20260207073948.48144-1-adarshdas950@gmail.com> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: kwepems500001.china.huawei.com (7.221.188.70) To kwepemk500005.china.huawei.com (7.202.194.90) ÔÚ 2026/2/7 15:39, Adarsh Das дµÀ: > Hi Zhihao, > > Thank you for taking the time to review my patch! > > I'm trying to understand the issue you've identified. I looked at the > fs_umode_to_dtype() implementation in fs/fs_types.c: > > unsigned char fs_umode_to_dtype(umode_t mode) { > return fs_ftype_to_dtype(fs_umode_to_ftype(mode)); > } > >>>From what I can see, it seems like the function does produce FT_FIFO (5) > as an intermediate value, but then converts it back before returning. > Here's what I think happens for S_IFIFO (0010000): > > Old bit-shift code: > type = (mode & S_IFMT) >> 12 > = (0010000 & 00170000) >> 12 > = 0010000 >> 12 > = 1 (DT_FIFO) > > New fs_umode_to_dtype() code: > Step 1: fs_umode_to_ftype(0010000) > = fs_ftype_by_dtype[S_DT(0010000)] > = fs_ftype_by_dtype[1] > = FT_FIFO = 5 > > Step 2: fs_ftype_to_dtype(5) > = fs_dtype_by_ftype[5] > = DT_FIFO = 1 > Oh, that's fs_umode_to_dtype, sorry for the mistake, I saw it as 'fs_umode_to_ftype'. > I'm not sure how FT_FIFO (5) would remain after the function returns, since > it seems to get converted back to DT_FIFO (1) in step 2. > > If there's an issue with this approach, I can edit my patch and keep changes in only jffs2_mknod. > . >