Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8903717rwb; Thu, 24 Nov 2022 05:49:02 -0800 (PST) X-Google-Smtp-Source: AA0mqf4xyIVXViIsLy2KwGAYJnl438Kl+3C5ox3lpLcYMTEce0lvjM+62q3be8KZK41pqk2bGEey X-Received: by 2002:a17:902:efcf:b0:186:ba54:f340 with SMTP id ja15-20020a170902efcf00b00186ba54f340mr22864752plb.119.1669297741896; Thu, 24 Nov 2022 05:49:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669297741; cv=none; d=google.com; s=arc-20160816; b=JmqmA+WBHa0Vb+N2uPXd0a2Ce5ayF9QxG33SIKZ/SUcCHLvod5pJvv20xotYs6s4kX ngrwX+pGrRzziCFyYX2rj1sUnUQh57pV2nGrn7/EV6VGOO3YiswQW46ed2xs+XOpDpF9 /CjU7mdDflcfxp2gc+ZlqC6uR4FS4Jdg9QCni+67vzc8pHPFmggkGOakX/tfu2tBtjyk VkR9rPb4mre8PgLMMng6M0UT5z4cpDYgsesnJ5eLaVH8JK/iarzk3E5VkbezWXgVowGj 2BGKW7u92+BNzuNOI41DaB34o5UyxTy/o6Agjovo8QIOe97ZCFD/usGZHRfel6yk2JLa rTNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=nTxEUY6lNA3+qUesqa+OZE4c2rfpFZIhGhxwCSJdlBQ=; b=f1LeikgtOsVzxZOmO116HuVuD+19c8fygZT+w1WRxVY11p2O2cPHZ9fLoOkgTYXPAO Mazq+wx0hRLI8OYb3IHR3wqR8ywZMTt8b/Y5ugPuZ7+U2dsfHxVVCMzu/fuy5TLsWo3t bEz7tgAC2oq3c9bvbm+XyjzxZM/pnpes617UC4qoloTC2wypBkzyLc7m0f9a4JphFYUj l+T4juAJbEswfZ3TrqGitkGeukyGq6zjraDzPDbnTK2AiZvhRM0Nb5LwuBbztc41GCDC ARgg9dFUGuzzuVkhTTZwq0bNQmjr+pvUh5T7VOBIwUt+FCE8wG2m3AOo7zP+/91n+RIZ ehbw== 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i13-20020aa78d8d000000b00572698b413esi144813pfr.195.2022.11.24.05.48.50; Thu, 24 Nov 2022 05:49:01 -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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229728AbiKXNEN (ORCPT + 86 others); Thu, 24 Nov 2022 08:04:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229499AbiKXNEL (ORCPT ); Thu, 24 Nov 2022 08:04:11 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B03B385A30 for ; Thu, 24 Nov 2022 05:04:10 -0800 (PST) Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NHylH3Ky6zqSgh; Thu, 24 Nov 2022 21:00:11 +0800 (CST) Received: from kwepemm600003.china.huawei.com (7.193.23.202) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 24 Nov 2022 21:04:07 +0800 Received: from [10.67.111.205] (10.67.111.205) by kwepemm600003.china.huawei.com (7.193.23.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 24 Nov 2022 21:04:07 +0800 Subject: Re: [PATCH] tracing: Fix infinite loop in tracing_read_pipe on overflowed print_trace_line To: Steven Rostedt CC: , References: <20221114022946.66255-1-yangjihong1@huawei.com> <20221117164003.6e655615@gandalf.local.home> <188a48b7-f426-6348-086e-22e56bb07206@huawei.com> <20221120144956.30bb1725@rorschach.local.home> From: Yang Jihong Message-ID: <894153aa-0dab-dc26-7c31-2bdda7c665b4@huawei.com> Date: Thu, 24 Nov 2022 21:04:06 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20221120144956.30bb1725@rorschach.local.home> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.111.205] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600003.china.huawei.com (7.193.23.202) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS 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 Hello, On 2022/11/21 3:49, Steven Rostedt wrote: > On Fri, 18 Nov 2022 18:21:12 +0800 > Yang Jihong wrote: > >>> That way we can see the broken trace event and not just silently drop it. >>> >> Ok, will change in next version.(Because iter->seq.seq.len may be >> smaller than strlen(dots), direct subtraction here may not be appropriate.) > > We should only need to do this if the len is maxed out. > > Hmm, len is only updated if it did actually copy it. > > Perhaps we could just add: > > trace_seq_puts(&iter->seq, "[LINE TOO BIG]\n"); > The v3 patch has been sent according to this solution. Thanks, Yang