Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp163481rwb; Fri, 19 Aug 2022 19:32:48 -0700 (PDT) X-Google-Smtp-Source: AA6agR5icMiiE3jTBH55UUorUGLzHQzravej0MjhyX5Xcoit5sc0pnAl//m46YUxOIIiGHJYbH+n X-Received: by 2002:a17:907:3f12:b0:731:559c:b57b with SMTP id hq18-20020a1709073f1200b00731559cb57bmr6505483ejc.712.1660962768523; Fri, 19 Aug 2022 19:32:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660962768; cv=none; d=google.com; s=arc-20160816; b=vRApjNklORCZrK9+Fp9/6mHjU+tsfE+qFFgLe9e+7DVlLK0BfIiRWvqd3nsYqaM3ei mJdBGQ9af4DfaBxdO9rPQAQd1AhVzZ+dF1Ea7pDB25E1Elw0IhOxGs8dPsF2GEd+VZo7 9YIvGWGRK1UGszp74hojWhvVJqV1CQDl0OMAj+1a1tqLAkaRYAqqjWVnA6i8xCARw+JZ OjvgHOzQ1OKrIJxr0LCmgU/65UXt7bBAGLSN/lzpR8K0W0vcQPCUSAoTJZnqETisdNN3 u6ef+4Q36fCTn2mchpz9+WSewV1jbkpaHAwxBFkf04G2eLbM90glO2ZpNZbFw6J1W7PE SpgQ== 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:dkim-signature; bh=h/HJ65cb2+nIGwhv5QH5QTgJ4jWxy0giXVXsSHB7yko=; b=ldygE0ODgofOQyFDPPGhbdlzGG1K8uFGk4AyVg3V8OBI28h0QxdlSfd9xbDic14mRk qiF75Z6wruJbjSgbv9UTcstxvhYV2+l7u308DAntyyTLcMUe6BwWOmnEEBlpg0hO2qaN Ud0g8hcus7d+gHs55FSqVC/0f+dY/qXQgYkWciGYsxGNeuSlDTwK3XHK04Nosb+yjIpP tzy1xhv/ywghm9zIrq+uDo5biBdZsMTmw7LMLo3cYdaqc68vDtn5rU+6wsImZR7elun5 rqUOpL60JIjHSrdtpVWTMheZ7pp8m9yODm+peowuH22xRFnrlQwHrQP89wFrWR8bnNTj ziHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=iuCRhwHv; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y21-20020a170906071500b00734be0ce328si3496134ejb.498.2022.08.19.19.31.49; Fri, 19 Aug 2022 19:32:48 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=iuCRhwHv; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239003AbiHTC3f (ORCPT + 99 others); Fri, 19 Aug 2022 22:29:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235135AbiHTC3c (ORCPT ); Fri, 19 Aug 2022 22:29:32 -0400 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB7C89A983; Fri, 19 Aug 2022 19:29:29 -0700 (PDT) Received: by mail-pj1-x1036.google.com with SMTP id e19so4952730pju.1; Fri, 19 Aug 2022 19:29:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc; bh=h/HJ65cb2+nIGwhv5QH5QTgJ4jWxy0giXVXsSHB7yko=; b=iuCRhwHvRBHWpZ+AfOlPMiIE4kR6hweHfR1SBEN6YW20gjBM2ixZbR8hui4zb1FfIH KONz0WtxxHeYRsbXWN+bjJviEfSFdSqRGJdlYqSqh5cRn/Px1liqn3nUwC/MUpWEDAEN WlbKswo9JvZGBBdDfcbkhIz9dANcSE7v1j1JETjYFPobMcWHjdOPimg+iKnFUaGrIEgX vtxMk8zhKjKbYER1nFnXhJikpbg6sBLINjhe6EkPkFRBJsyYXLaD+70sjpXYUbpihqFO deEFYRZKvN3dcYDAA4FHkW7+m5urs0X7b06MlsxndKKUnI27es9IuyGrEWZ22Fw4uaIR 6hEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=h/HJ65cb2+nIGwhv5QH5QTgJ4jWxy0giXVXsSHB7yko=; b=XhgXjcXJsXyQAqflS5yS9pdNI9rNlKFJYFTx7eoOr7GXIBiyTLujLHBAtBRPYFN7uF yjTjCdL6ipVk9g8V1G1k4kJhDYzzxuR0pkKkbDRyN2BmLfbSPOyoH/iiExwG5UJsLwqE jjskp4dkGAwnx5Cem3hviRfu1H/NOwO7c6vl67Ebqv9n2DYRwWrM5nEMQlr1ylbnro7x 8/r0d0jgA264KJ9S/w4bFPPI9UqWh6y3HuWkiW78jUqukJUxKLBnIwWhTBDVaN51WbL1 7o3SBVqgdrNMnuz4OysoJAPh1XPBJVaugqDbfA36kY4Xgi4dXhas2rhzptfSdw/h7uJj OAFA== X-Gm-Message-State: ACgBeo3q4z0boSiHYrBvCGWnJaJ6CLUS8gqfrzcbLuOS2YLkDsUzvmdI 5/vOW2N/tOkQItv9KW+31PsyG0qZ+eg= X-Received: by 2002:a17:902:ef96:b0:172:abb9:657e with SMTP id iz22-20020a170902ef9600b00172abb9657emr10056786plb.48.1660962569323; Fri, 19 Aug 2022 19:29:29 -0700 (PDT) Received: from [192.168.43.80] (subs02-180-214-232-69.three.co.id. [180.214.232.69]) by smtp.gmail.com with ESMTPSA id u6-20020a170902e5c600b0016d88dc7745sm3793478plf.259.2022.08.19.19.29.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Aug 2022 19:29:28 -0700 (PDT) Message-ID: <69366c8b-9bbb-7d4c-4d0d-4948d04e71bb@gmail.com> Date: Sat, 20 Aug 2022 09:29:24 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH v2] mm/damon/dbgfs: avoid duplicate context directory creation Content-Language: en-US To: SeongJae Park , akpm@linux-foundation.org Cc: badari.pulavarty@intel.com, damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20220819171930.16166-1-sj@kernel.org> From: Bagas Sanjaya In-Reply-To: <20220819171930.16166-1-sj@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_WEB,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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 8/20/22 00:19, SeongJae Park wrote: > From: Badari Pulavarty > > When user tries to create a DAMON context via the DAMON debugfs > interface with a name of an already existing context, the context > directory creation silently fails but the context is added in the > internal data structure. As a result, memory could leak and DAMON > cannot be turned on. An example test case is as below: > > # cd /sys/kernel/debug/damon/ > # echo "off" > monitor_on > # echo paddr > target_ids > # echo "abc" > mk_context > # echo "abc" > mk_context > # echo $$ > abc/target_ids > # echo "on" > monitor_on <<< fails > > This commit fixes the issue by checking if the name already exist and > immediately returning '-EEXIST' in the case. > Meh... SJ, I have seen most (if not all of) your patches uses descriptive mood instead of imperative. Better say "Fix the issue by checking ...". -- An old man doll... just what I always wanted! - Clara