Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp512845lqb; Thu, 14 Mar 2024 19:42:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW6SygTmWfvHEzCJIeOssqSsvkRgQEVxUYn666iTiTOY+J/zGDKtYpF/CCtEvHNeA4zBKAuOhagmxkm6Df7DRIREgV7kPcQDNyDYZ0Ekg== X-Google-Smtp-Source: AGHT+IFr7k4jvy9iEDWWIUORQTNCEMY7kbANw/aO+AHc3w9wYx4qL7M146wWNl32ABUpTYhYxbrE X-Received: by 2002:a05:6870:3312:b0:222:7193:f1d2 with SMTP id x18-20020a056870331200b002227193f1d2mr2583829oae.13.1710470550818; Thu, 14 Mar 2024 19:42:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710470550; cv=pass; d=google.com; s=arc-20160816; b=d2+TRmse4AVBTD6UfnqvyVlUH9v1YHNW4wcLD9fvxxMmfDNCV74+2N+CBbB7GBeppT pBJjRHwOnC173LOTIBSOLG426l/Z0ph6WTLWXc+IuhCYbriJwygeHY4Qo3gVXBDPzOvi c4zrEA03Loi3R2nyeQRnFFw1xwnf+3TpEJmom4TQkXGD99Iso9M0C+5DVSEYQyR6o/bl pS6c+G0OVEaGO6Qrc8nCXw3UnVqBvrO701jxMZfJUMBBm8RJ8RjoQsvX3uP7FRRRFkYd EaIObzkgjIvGnsKCT8owopzi+myktDPBzuHg66IISGKZAokn7TJouC5Z268oxZyCVcJj HTdQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:cc:to:from; bh=OTrwa8OSb0vsQyXkNljgbJHGNZj7dUBT5BD6eUkwxmQ=; fh=O9mlSf3GDB5hUi3cJOlXGWwDLAbrCBYw+T9s0E+gJOU=; b=lZcFViT/Bfn2hU3BNNerk6ramEBrJ6cmfrQH0zj7eW2NscB5NwEmqt04sHRBQK+ebK q2YQ80KT3f7c96eMMyWroaSGc3aYS0PV/6DzRcPIDTQJoiCPXUOBWV75+Hvdb2MNztYn JEarNKHzyYIHLxrcUiiOtuKQxfC1dS7fwcEG/5IJoUwexJ0SmgusRBqCYdDPgDDJf5iI qo9pmtJHFvFHohV5UT91JtTCHacTp99HXASa1hJHlDTZeL5rAfW8wnxlJ9G6JMgsy3de Je8cTwLtQ3c92WZSZ92rrEEuncfQj2P2xmKs+4oYu65+DAxo+HyJASUZ+/DfFoH2iAw/ v4bA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=h3c.com); spf=pass (google.com: domain of linux-kernel+bounces-103993-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103993-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id c19-20020aa78813000000b006e6b6887211si2595913pfo.377.2024.03.14.19.42.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 19:42:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-103993-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=h3c.com); spf=pass (google.com: domain of linux-kernel+bounces-103993-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103993-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id D29FAB21750 for ; Fri, 15 Mar 2024 02:42:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7CBA28F6D; Fri, 15 Mar 2024 02:42:20 +0000 (UTC) Received: from h3cspam02-ex.h3c.com (smtp.h3c.com [60.191.123.50]) (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 D4EE179D3 for ; Fri, 15 Mar 2024 02:42:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=60.191.123.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710470540; cv=none; b=HBRQM8Qqg5EckHHL4orHCNM4o/HXjaY6PKA4k6cB0d/dKb/2Mkh/HXytu20huUaUrKv9Y3uVrpSLLFNZrwe4q25vwdxSMGKT4ZnYO35gJ25HeFgwA70ygZYiOoYgdkH9Fx38B3/ms7pZEynjfBarVdEf0SR/wvJAz48/50zW/k0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710470540; c=relaxed/simple; bh=l1mMy7rRIxNkKbnKRRRtolYc6FP57KEmiWYFu1gsGJU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XElC+nYHLvhyB9oum25dWkulhlHR3wXrh7UUDbKCyAsKDP9jzXBKJKmBMQA1MBODXlv00TMqThre63SZ8CppHbovyK5keSQVgqN+FPmB9CvBRyKCqH4yQWG6mFcuwom8EIcvlrp2sWRQN7CdmrCxigw0FdQkRYTPyRP3IM4+eho= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=h3c.com; spf=pass smtp.mailfrom=h3c.com; arc=none smtp.client-ip=60.191.123.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=h3c.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=h3c.com Received: from mail.maildlp.com ([172.25.15.154]) by h3cspam02-ex.h3c.com with ESMTP id 42F2fj51077124; Fri, 15 Mar 2024 10:41:45 +0800 (GMT-8) (envelope-from zhang.zhengming@h3c.com) Received: from DAG6EX01-IMDC.srv.huawei-3com.com (unknown [10.62.14.10]) by mail.maildlp.com (Postfix) with ESMTP id 3026E2004BB3; Fri, 15 Mar 2024 10:43:17 +0800 (CST) Received: from localhost.localdomain (10.99.206.12) by DAG6EX01-IMDC.srv.huawei-3com.com (10.62.14.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.1258.27; Fri, 15 Mar 2024 10:41:46 +0800 From: zhangzhengming To: CC: , , , , , , , , , , , , Subject: Re: [PATCH] relay: avoid relay_open_buf inproperly fails in buffer-only mode Date: Fri, 15 Mar 2024 10:39:12 +0800 Message-ID: <20240315023912.13390-1-zhang.zhengming@h3c.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240220105836.15815-1-lulie@linux.alibaba.com> References: <20240220105836.15815-1-lulie@linux.alibaba.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: BJSMTP01-EX.srv.huawei-3com.com (10.63.20.132) To DAG6EX01-IMDC.srv.huawei-3com.com (10.62.14.10) X-DNSRBL: X-SPAM-SOURCE-CHECK: pass X-MAIL:h3cspam02-ex.h3c.com 42F2fj51077124 > diff --git a/kernel/relay.c b/kernel/relay.c > index a8e90e98bf2c..0d8b8325530a 100644 > --- a/kernel/relay.c > +++ b/kernel/relay.c > @@ -391,12 +391,13 @@ static struct rchan_buf *relay_open_buf(struct rchan *chan, unsigned int cpu) > goto free_buf; > relay_set_buf_dentry(buf, dentry); > } else { > - /* Only retrieve global info, nothing more, nothing less */ > + /* In buffer-only mode, relay_open_buf is called with > + * filename=NULL, but create_buf_file is still needed to > + * retrieve is_global info. So dentry should be NULL here. > + */ > dentry = chan->cb->create_buf_file(NULL, NULL, > S_IRUSR, buf, > &chan->is_global); > - if (IS_ERR_OR_NULL(dentry)) > - goto free_buf; > } > > buf->cpu = cpu; I suggest replacing IS_ERR_OR_NULL with IS_ERR instead of removing it due to the possibility of create_buf_file callback returning an error.