Received: by 2002:ac2:5a04:0:0:0:0:0 with SMTP id q4csp99776lfn; Wed, 16 Feb 2022 19:22:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJzHfaj3IWDVZt84M5cFqFhOo0TlTWfXlCYgmCHwAQsif17kqs5D1vrksU/nKSMHkowGmtjA X-Received: by 2002:a17:902:ecc6:b0:14e:f2f5:8e9 with SMTP id a6-20020a170902ecc600b0014ef2f508e9mr1006911plh.24.1645068143445; Wed, 16 Feb 2022 19:22:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645068143; cv=none; d=google.com; s=arc-20160816; b=AdK1Gy5grg4d60ZU+3/ZgEnoHkYBUQu5VltbzV/q/fa17/mMki7zAyA2Z95XYWcMMM QGwaqXMNd/ptQQ0DKYNKkGjOKY0gTDCzGaCbOQ+hfqvsf3CH1fdGDsBZ6x8UYvqIroop ksb8KZqlB+ksgimc1cdjI3GBWRkASExge4pjqhaR2mG1HTlqRwZrK+b+b6na6Db8xQKX Tm7kAbLCQSUURP1Klme69XYtYC4cDjv3087MOXBvIxA8h3JEzbirQt8W9f813uI1lDdB hnBrf7XOKdAN0otsnoHwaYnzeQTodewy5nDnfgihXb7mnMd+FyerUCBBZIxUDiCjPorr afmQ== 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:content-language:subject:user-agent:mime-version :date:message-id; bh=2cAycWa0E6UnmwgnJgFsLmlcNwyh3Rs4eKtG7Oe3qhM=; b=Q0U0ucxPbhk8pgh9mUuxMfGcz3tki5/BOKY3hf98t5CKAuAS0twvmxKlKMFZ5xKN79 f3jP4iZaV2hd0pxqHfpKFV/IBx+1OOao22bJF75rs8jp54dV4C16TFjaIThOX//+Abjf /m2a7nMVZ9ODTOpdIJBFWgMjB5jUvEQujN05fFCXQvWzD5jePzRS3rZTPUGc4W+XoM4y 5tdFyUfvkf3rlAQNFRAw8wNCkDqagABY+KYKtpI1yUz/bceo4noRJIT+FrBBd7obaFRe BMvoEhluvy3W4q2dGTYh4qt96LBORyrvRz4wrkiRTmcfLqJcb9HXk+kkJwVPViJ4M0EX gO+Q== 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=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e9si22053017plh.450.2022.02.16.19.21.44; Wed, 16 Feb 2022 19:22:23 -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=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231271AbiBQBtu (ORCPT + 99 others); Wed, 16 Feb 2022 20:49:50 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:46392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229714AbiBQBtt (ORCPT ); Wed, 16 Feb 2022 20:49:49 -0500 Received: from out30-130.freemail.mail.aliyun.com (out30-130.freemail.mail.aliyun.com [115.124.30.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 266B2DB48C; Wed, 16 Feb 2022 17:49:30 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R271e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04407;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=15;SR=0;TI=SMTPD_---0V4fQwYM_1645062566; Received: from 30.225.24.49(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0V4fQwYM_1645062566) by smtp.aliyun-inc.com(127.0.0.1); Thu, 17 Feb 2022 09:49:27 +0800 Message-ID: Date: Thu, 17 Feb 2022 09:49:26 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: [PATCH v4 05/23] cachefiles: introduce new devnode for on-demand read mode Content-Language: en-US To: Greg KH Cc: dhowells@redhat.com, linux-cachefs@redhat.com, xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org, torvalds@linux-foundation.org, willy@infradead.org, linux-fsdevel@vger.kernel.org, joseph.qi@linux.alibaba.com, bo.liu@linux.alibaba.com, tao.peng@linux.alibaba.com, gerry@linux.alibaba.com, eguan@linux.alibaba.com, linux-kernel@vger.kernel.org References: <20220215111335.123528-1-jefflexu@linux.alibaba.com> From: JeffleXu In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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 On 2/17/22 1:48 AM, Greg KH wrote: > On Wed, Feb 16, 2022 at 08:49:35PM +0800, JeffleXu wrote: >>>> +struct cachefiles_req_in { >>>> + uint64_t id; >>>> + uint64_t off; >>>> + uint64_t len; >>> >>> For structures that cross the user/kernel boundry, you have to use the >>> correct types. For this it would be __u64. >> >> OK I will change to __xx style in the next version. >> >> By the way, I can't understand the disadvantage of uintxx_t style. > > The "uint*" types are not valid kernel types. They are userspace types > and do not transfer properly in all arches and situations when crossing > the user/kernel boundry. They are also in a different C "namespace", so > should not even be used in kernel code, although a lot of people do > because they are used to writing userspace C code :( OK. "uint*" types are defined in ISO C library, while it seems that linux kernel doesn't expect any C library [1]. [1] https://kernelnewbies.org/FAQ/LibraryFunctionsInKernel Thanks for explaining it. -- Thanks, Jeffle