Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3915525pxf; Mon, 22 Mar 2021 20:03:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIxDz+On5TcR2iqLp+m0uj8vQHJGHrra0DxIbwF+M/nEXQ5tqsAfsPqjX9IZf5b5+lIDi/ X-Received: by 2002:a17:906:68c5:: with SMTP id y5mr2717711ejr.371.1616468583805; Mon, 22 Mar 2021 20:03:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616468583; cv=none; d=google.com; s=arc-20160816; b=YTLXy9Vec0zUPArinh/iuPBD2vo/v5TU9FrDWRG4osVcj26YK1Vrtl8MMQunBtGw98 1VDKolh6WNolOsDg7kIQz2JQ/YC8raf8Zvl2nFuUIBjRzwL+nGCckgkBFtDC62q058rF fcc/DUHUKbgi3cL+qGTvh1AWn/krnPeF1i8m8/Pj70uXy7YM/o+31StUu7cqsRoeyX+2 lG7rHGkrwJAWME87kFWAuelpDAL4H/eUtrTmUcYTEVH3LiF/6vLoY/xAOZuPRvEy3tQT EY0pZVlp0rZGcPik3+mvjGOUUku9Sh+0zIdmpOYiTCWQ7CWWo0Ccw7XLXNp/pLIggdBE /psw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type:content-language :thread-index:content-transfer-encoding:mime-version:message-id:date :subject:in-reply-to:cc:to:from:dkim-signature:dkim-filter; bh=zBS8pwQVYwk/Dc+dG60rDT0FuBHEKko+RRMZ08todfw=; b=nxYUK0gRcJUGInc9hJp7NVDRz7LH3ArAT0sgnZMxhuWjZ5kj2msVJ8WG8XG+ruYc7D l5FBJrMVmhXfLJRlAVtseN/DkCiugPSRSTDYzlO8/CzcMhaGIX11Zfz8k+wMtKYLzBbx dl/HWuprk14GaeGunlAC/2odMUdaOrKsPV9ax+GmC2hNRvhv/9Uqg60AT1wv+ZWGVBOy Q0VktvU5OzIseS0RZ758xvsDkE/6DooMwLtlf80QB2fDpXdoS6AaZylfYXINHInkdTvA yV8t8b+JUa26VRirzdOggNCZilRv5Ia4pJx2nfQux0wG3gU8Fpy4NG3xvkiguBGjgXHR eNUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=GtCUyKg4; 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 f6si12292718edq.600.2021.03.22.20.02.41; Mon, 22 Mar 2021 20:03:03 -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=GtCUyKg4; 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 S229898AbhCWDBj (ORCPT + 99 others); Mon, 22 Mar 2021 23:01:39 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:56792 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229508AbhCWDB0 (ORCPT ); Mon, 22 Mar 2021 23:01:26 -0400 Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20210323030124epoutp03f21d5d1766a2fc875e82632cbb264f30~u2YWtVvvx1038810388epoutp03C for ; Tue, 23 Mar 2021 03:01:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20210323030124epoutp03f21d5d1766a2fc875e82632cbb264f30~u2YWtVvvx1038810388epoutp03C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1616468484; bh=zBS8pwQVYwk/Dc+dG60rDT0FuBHEKko+RRMZ08todfw=; h=From:To:Cc:In-Reply-To:Subject:Date:References:From; b=GtCUyKg4rS67yZeQQvZcmr3BK3HaRW/6X06eRDKA79+VX9jWot6gpogiO9NyjGGDY LpnXsa6HmahUz+coj7nlPSy6E4nhxdUoAnxYHyUMOtkLPqA0I00jZjTZD7EpK8OSSF AswXHUGSVSsmes+L+1i+vtwgLnevyY8DQmTNbM2U= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20210323030123epcas1p283ad5d568f2a1e6a2220b1eee9c252fc~u2YWLLu_j0184801848epcas1p23; Tue, 23 Mar 2021 03:01:23 +0000 (GMT) Received: from epsmges1p2.samsung.com (unknown [182.195.40.160]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4F4GNL60P2z4x9QF; Tue, 23 Mar 2021 03:01:22 +0000 (GMT) Received: from epcas1p3.samsung.com ( [182.195.41.47]) by epsmges1p2.samsung.com (Symantec Messaging Gateway) with SMTP id EF.12.63458.20A59506; Tue, 23 Mar 2021 12:01:22 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas1p1.samsung.com (KnoxPortal) with ESMTPA id 20210323030122epcas1p147f5f0b852da3e35e928496737b85f0e~u2YUpHm2t2478424784epcas1p1o; Tue, 23 Mar 2021 03:01:22 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20210323030122epsmtrp285c519b915fdba75e16667736fb75baa~u2YUn8Ryl1483914839epsmtrp2T; Tue, 23 Mar 2021 03:01:22 +0000 (GMT) X-AuditID: b6c32a36-6dfff7000000f7e2-bb-60595a021871 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 67.C4.08745.10A59506; Tue, 23 Mar 2021 12:01:22 +0900 (KST) Received: from namjaejeon01 (unknown [10.88.104.63]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210323030121epsmtip27f30b5160f4fafe3846d6e38d6f83351~u2YUTe8JZ0545905459epsmtip2_; Tue, 23 Mar 2021 03:01:21 +0000 (GMT) From: "Namjae Jeon" To: "'Matthew Wilcox'" Cc: , , , , , , , , , , , , , , , , , "'Sergey Senozhatsky'" , "'Steve French'" In-Reply-To: <20210322221816.GW1719932@casper.infradead.org> Subject: RE: [PATCH 1/5] cifsd: add server handler and tranport layers Date: Tue, 23 Mar 2021 12:01:22 +0900 Message-ID: <00d901d71f90$cdfd24f0$69f76ed0$@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQGKnGOaYF8FWW41Vo1OapoCvoUV0QMoPiJ6Am1CcOcBjsy+tqrwuGGg Content-Language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA01Ta0xTZxjO6Tk9LbK6Y6n4BRctx7Eh49JSWz9MIWRTdhLIJMFFxrK0BzgD RmlrC9ucP1Y3biIwL3NoQYY4uYwtXETAIkPLEFxhCooJTBQjZLBSJ3RTLgIrPZrx73mf93ne N8/35eWjwgXch5+mzWQMWlpD4uuwlq7tIUGchA/UksojQfCww4bBHvsSDy7WFeHQvlyCQdux Sg6srevmwLsP/ubByRULCudXniHwSscNDN62lOHQcc+lKyqe5cKcOwGwvbEShz87H/Hg9GQX DkeOf4/Dm0s9XLg4V4ZHiiizqQinSk0DGHXZPMqjLtYEUO0VTg7VPmzCqZy2JR41MzGCUc3n H3Ko+uYhjHI2baGaxh2c2FcSNMpUhk5mDGJGm6RLTtOmhJPRcap3VHKFRBokDYM7SbGWzmDC yd0xsUFRaRpXUFL8Ka3JclGxtNFIhkQoDbqsTEacqjNmhpOMPlmjl0r0wUY6w5ilTQlO0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A/Sh E5WpnFopT5ZQnrDCKvELIGJ2yBbm5AN82NYEcUO/XYh/F+so3D92DuKmEwUELiquI/DLzq9C 3Oe4TeIRx0+Aa+40QvzitpHCtnd/OV3OdwHOapXi6tICCt8c+ijEA31WCrfnXqJwi71BgH// MlKrxaxeo6NYg+YZZKv0HUK27JqUrb48RLDVbzQUm2W2C9nBnnbIll/pItiS8jbIDplmsqZu GxExKcYzJJ5LTkzn1EGhMs/dOfd7SNVR0b7CvItQA85N1gKaRswSNDDoqwUetIgxA/TIscup EeOL6h82k27EG1mtvBZ4/kU+AXS2tYRyMhQTgMZG77q0mPFH2s+VAidEMo8gKtXlC9wJG0Bl OjvhpDyYEGT50eHS3kw4qrh3ypWGzBw00Fzk8r2Y5ai/4wh06ymo8UI3dK4gmUCUXQqcNsn4 oUqbkXQPnYVGeq4K3CPCUUGbhnQzYmQ4lk2eAN76cU36/036cU36cYnLAF4H0zkVn5KQwger Fim5vYG8PIVPUyYE7tyTYgKuN5BKzaDm+rdACyBoYAGIJiVir8zt0TKRV7x8/wFOvSdOnZbM 8RbgS0PJNK+n2sY4EZMgT+WSOE7Fqf9dCdrDR0PcDPXfpihjorLIN4+XtphiM6ZGLltYbMge nvDF//2EZR8z2Lolrb31qLf4U6lmUJl/6rlE/Hb2ytCuysW5W+cmyw6uMZkjU/POrCtve0nX rnQYkqy3cgq3RAY/2OSYZd9qXV4Y3Lq+6bNwwX4F96HXGkJXmTMVe8M21E/NCDqba8x6/7oQ vFKkvz1pJA0+Y7wKRm+e0RT25NtoXqwcFlV0+9mj1tb6xJqj4rsqRu6FHFgw/xBuXH+8Pb2v xOZ9fnje6KQH0uakfXTcxB2W8PCamLSGNdaJYZ1gMC5US4fJthgd0fIBwK2KiJg9xtM/9Z2b YKbwxQqwserG6VHFsFoC+d3yYCmp5uV/AB1dI011AwAA X-CMS-MailID: 20210323030122epcas1p147f5f0b852da3e35e928496737b85f0e X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210322052204epcas1p1382cadbfe958d156c0ad9f7fcb8532b7 References: <20210322051344.1706-1-namjae.jeon@samsung.com> <20210322051344.1706-2-namjae.jeon@samsung.com> <20210322221816.GW1719932@casper.infradead.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Mon, Mar 22, 2021 at 02:13:40PM +0900, Namjae Jeon wrote: > > +#define RESPONSE_BUF(w) ((void *)(w)->response_buf) > > +#define REQUEST_BUF(w) ((void *)(w)->request_buf) > > Why do you do this obfuscation? I don't remember exactly, but back then, It looked easier... > > > +#define RESPONSE_BUF_NEXT(w) \ > > + ((void *)((w)->response_buf + (w)->next_smb2_rsp_hdr_off)) > > +#define REQUEST_BUF_NEXT(w) \ > > + ((void *)((w)->request_buf + (w)->next_smb2_rcv_hdr_off)) > > These obfuscations aren't even used; delete them They are used in many place. ./smb2pdu.c: *rsp = RESPONSE_BUF_NEXT(work); ./smb2pdu.c: err_rsp = RESPONSE_BUF_NEXT(work); ./smb2pdu.c: rsp_hdr = RESPONSE_BUF_NEXT(work); ./smb2pdu.c: struct smb2_hdr *hdr = RESPONSE_BUF_NEXT(work); ./smb2pdu.c: struct smb2_hdr *rsp = RESPONSE_BUF_NEXT(work); ./smb2pdu.c: rsp_hdr = RESPONSE_BUF_NEXT(work); ./smb2pdu.c: rsp = RESPONSE_BUF_NEXT(work); ./smb2pdu.c: rsp = RESPONSE_BUF_NEXT(work); ./smb2pdu.c: hdr = RESPONSE_BUF_NEXT(work); ./smb2pdu.c: hdr = RESPONSE_BUF_NEXT(work); ./smb2pdu.c: rsp = RESPONSE_BUF_NEXT(work); ./smb2pdu.c: *req = REQUEST_BUF_NEXT(work); ./smb2pdu.c: rcv_hdr = REQUEST_BUF_NEXT(work); ./smb2pdu.c: struct smb2_hdr *req_hdr = REQUEST_BUF_NEXT(work); ./smb2pdu.c: struct smb2_hdr *req = REQUEST_BUF_NEXT(work); ./smb2pdu.c: rcv_hdr = REQUEST_BUF_NEXT(work); ./smb2pdu.c: hdr = REQUEST_BUF_NEXT(work); ./smb2pdu.c: req = REQUEST_BUF_NEXT(work); ./smb2pdu.c: req = REQUEST_BUF_NEXT(work); ./smb2pdu.c: hdr = REQUEST_BUF_NEXT(work); ./smb2pdu.c: req_hdr = REQUEST_BUF_NEXT(work); ./smb2pdu.c: hdr = REQUEST_BUF_NEXT(work); ./smb2pdu.c: req_hdr = REQUEST_BUF_NEXT(work); > > > +#define RESPONSE_SZ(w) ((w)->response_sz) > > + > > +#define INIT_AUX_PAYLOAD(w) ((w)->aux_payload_buf = NULL) > > +#define HAS_AUX_PAYLOAD(w) ((w)->aux_payload_sz != 0) > > I mean, do you really find it clearer to write: > > if (HAS_AUX_PAYLOAD(work)) > than > if (work->aux_payload_sz) > > The unobfuscated version is actually shorter! Yep, looks better, Will fix it. Thanks for your review!