Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp1851247imi; Sat, 23 Jul 2022 21:05:58 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sPYxYVdcQm2o5QOpPQasnZODqaZtSoI1jrcj8HSFuhGze0udGtqkW9PP7uyKxthSuRoM1n X-Received: by 2002:a17:907:2808:b0:72b:4d49:b2e9 with SMTP id eb8-20020a170907280800b0072b4d49b2e9mr5513823ejc.176.1658635558764; Sat, 23 Jul 2022 21:05:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1658635558; cv=pass; d=google.com; s=arc-20160816; b=oZsBv7ixt83zbCl4FWIM4RNprNTJsAJYylqniBRhh0GaQiPq0hgLVuYXsqy5RxuZlZ Y7g6KCIc7C6bJmCmHLcG6K15qH8+QvcVeXD540mCvSrYDRFC895DDjwlKz1ZL5zpMoc4 zO0f5ZU48q0rAzxskE57uUkAA8tTj5F9edSU8JhZZ9pOw95LMT53g59wFFJsjeCvW16A OG0zAg3/jGXu4yae4HnPPA/Fe7l9OTmMO/5yRv9XnjDtXoH9CtGRymeWATLONzklYZqt 07rI5mJl/EZR3nhR4VzoHkvfyUnclnT5wOw8fJtEOhUh5p+vUDjfGQshNmkViyWvd4mZ 1RsA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:importance:content-transfer-encoding :mime-version:subject:references:in-reply-to:message-id:cc:to:from :date:dkim-signature; bh=ZsIO24j3JVV1dGHrjewZL3uR5Q3eQ+kXFdkNGODCBfw=; b=LiYId2Avskkfq7EKgmRxgfVKPEAPvXEIAJU2Jzo60lQqSUPR02ygHQSe1SfwGm4rd5 lRpv2ydyMcdFTr78P+IO0scdNMVr6gzr7JFtKjHSjNdMp2ZiWUrP82hqVzc5W364IZh5 oz2tAx6wiaFo03fjrA7zXS5QFH3ffCxjOWA3fBphQK1fiNBr2sEqti9Oem9lyfDwTsnK 1sBoMDLWdV17FSXEUsFW1yRGVVncYnXwjCcNV6ifOlvzyWWnJUnKuDnhq+3O7XBVEzhN 0uYfK7QRdIqNwbpBr8digNGm4yygP3iGvns0cXlFbSrWgX6aW+sxwXh90SNzyCDBjI2W J0WA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=ByFyVWEX; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); 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=REJECT sp=REJECT dis=NONE) header.from=siddh.me Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sg12-20020a170907a40c00b0072b5adee784si12061768ejc.529.2022.07.23.21.05.33; Sat, 23 Jul 2022 21:05:58 -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=@siddh.me header.s=zmail header.b=ByFyVWEX; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); 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=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230421AbiGXECw (ORCPT + 99 others); Sun, 24 Jul 2022 00:02:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229445AbiGXECt (ORCPT ); Sun, 24 Jul 2022 00:02:49 -0400 Received: from sender-of-o53.zoho.in (sender-of-o53.zoho.in [103.117.158.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEE2EE0DA; Sat, 23 Jul 2022 21:02:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658635334; cv=none; d=zohomail.in; s=zohoarc; b=FKgmmK4qST/lw4r8NbvBMwkC47maL+Vn68jcKSRRTr9yN5eVH4djyiPYot/BeAWI7wD+EDBi9zGwVl/SkkKMoqlVSAguglKUp6BsMNpx5QM/DI2mApiid5zHu5I+T1MLb8QTXwTMQ1SoFBbLyKb0/EB/4gF4ywkRVjOmCMBQWuU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.in; s=zohoarc; t=1658635334; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=ZsIO24j3JVV1dGHrjewZL3uR5Q3eQ+kXFdkNGODCBfw=; b=A59IBYy8EidnQCVDDH7KxoNqOBZ9Q+XVz8nTwAhv90pXatlvgF+kE4wvy+CQ1Rsas5pKchSzux0yU4vcY3nHW2XjhtaUf84fCLONRthl/TUI7839DZfPqFOdaBH2kEh59xjt5vx0+T0m0cWtGvLXFcJVuHFyV93l5kR3qcit1Qw= ARC-Authentication-Results: i=1; mx.zohomail.in; dkim=pass header.i=siddh.me; spf=pass smtp.mailfrom=code@siddh.me; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1658635334; s=zmail; d=siddh.me; i=code@siddh.me; h=Date:Date:From:From:To:To:Cc:Cc:Message-ID:In-Reply-To:References:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=ZsIO24j3JVV1dGHrjewZL3uR5Q3eQ+kXFdkNGODCBfw=; b=ByFyVWEXVlIkXz4FEwz3wvsZXLYNGsn1uC9hrdpSw2a7Bnw0Gwvy5h3jGPDjGQs0 AYebS12UWXLtXXZJB2Qv2PiSPDnIODcoFj8g/KtpZ81TMsYFDZEmOSQ2AG6oJxQ4tEy 0RbilO/qxVyAlqRZN7ZdzUrIuIVIewzV0MxahS74= Received: from mail.zoho.in by mx.zoho.in with SMTP id 1658635323452803.7680563486452; Sun, 24 Jul 2022 09:32:03 +0530 (IST) Date: Sun, 24 Jul 2022 09:32:03 +0530 From: Siddh Raman Pant To: "Khalid Masum" Cc: "Greg KH" , "syzbot+c70d87ac1d001f29a058" , "linux-kernel-mentees" , "linux-security-modules" , "linux-kernel" , "David Howells" , "Eric Dumazet" , "Christophe JAILLET" , "Fabio M. De Francesco" Message-ID: <1822e5e8826.6da46246626262.8013427986163664185@siddh.me> In-Reply-To: References: <20220723135447.199557-1-code@siddh.me> <1822b76775c.69c52873236056.4849193904753307696@siddh.me> Subject: Re: [PATCH] kernel/watch_queue: Make pipe NULL while clearing watch_queue MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Importance: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_RED 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 Sun, 24 Jul 2022 09:15:27 +0530 Khalid Masum wrote: > On Sat, Jul 23, 2022 at 8:29 PM Siddh Raman Pant via > Linux-kernel-mentees > wrote: > > > > On Sat, 23 Jul 2022 19:33:33 +0530 Greg KH wrote: > > > You should not use #ifdef in .c files, it's unmaintainable over time. > > > > > > thanks, > > > > > > greg k-h > > > > > > > I used it because it is used in the same way in fs/pipe.c too (please check the > > stated line number). > > > > That, in turn, is because `watch_queue` member in the `pipe_inode_info` struct > > is defined that way (see line 80 of include/linux/pipe_fs_i.h), so I am forced > > to use the ifdef guard. > > > Maybe, we can use the IS_ENABLED macro here to avoid ifdef in the .c file as > suggested here: > https://www.kernel.org/doc/html/v4.10/process/coding-style.html#conditional-compilation > > if(IS_ENABLED(CONFIG_WATCH_QUEUE)){ > ... > } > > > Thanks, > > Siddh > > Thanks, > -- Khalid Masum I have looked at it again. The guard is superfluous in watch_queue.c (don't need it since we are already in watch queue), hence I am sending v2 with it removed. Thanks, Siddh