Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp1845188imi; Sat, 23 Jul 2022 20:48:07 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tL00+rbTpxg0zLRLBw3lop1zkv8iuXVGw7QYPTmARg0kvRtch+RFZRV6zH7L61aNS2lqai X-Received: by 2002:a05:6a00:27a1:b0:52b:a08:fe02 with SMTP id bd33-20020a056a0027a100b0052b0a08fe02mr7108984pfb.75.1658634486880; Sat, 23 Jul 2022 20:48:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658634486; cv=none; d=google.com; s=arc-20160816; b=hWCFiMNEoLbEL4soZZeOxpXZ+Ym+ALMUPl8cCIUmky0nNJelpg52S70Nae7xlEf/Ue +fAc1OMQctLwrpBCAgDsuPct9Kt55efrllpa62umQJkBpJseFPMa8I5z5/Mavwvfp8Cx J/5QVEV+BlghfWeT+zPUKORLKVxpwpyV5nHbfQcpSNLNYrb32ITFe8Q/Azsv8C/01d3i 9u1YcUoi6dJqPzNtAyOSKBZ0PSKpzaIdNawRr2DVCLC0+NphpXyoqqFIlMZkrd0DKypD 89GumAvolTIk0ZhehRFOEUE7ggDG+XbFlwkXPUpOFVdrhYTMAGVCHOH8SDIsokni0dOj 474g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=urdOpy9asLw3Y6MlWSHoFWdbz6150EOdUC7TdYBaBuE=; b=XCbJ3olFQSETsSZqFBZPwmFIWF8xV/KQEIAlRA8+8PaqA9fGzvdRXmtkOjZZAugwkN /G9OCjb69FiYbRVWpkdrfB+0Xqs9Q998yvNdIXB9+cilz3eiwU4DIijhqRosTrEyinO3 Ac3DRH+UYeoEOtJoSHevK5WtsPkvdQHia6AR+gk/ekJCNhf1mpdpsnCPE7bXJICxeqkM 3Mue9+5IIv1e3mSX6CDF5w2Zwy9TdAL+7hbL7TSyZbA1jqV32lx9tY5be42g/iKko3Od MWJbeMna2lZmkxZ3Fp1w4KwujHCCPwHa94/23gEV8JWoxU1y9EpEBdiLPXM2qbWtwxLx OQXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=LsldSwyv; 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 u10-20020a056a00158a00b005283cff6868si12066094pfk.6.2022.07.23.20.47.51; Sat, 23 Jul 2022 20:48:06 -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=LsldSwyv; 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 S239604AbiGXDpm (ORCPT + 99 others); Sat, 23 Jul 2022 23:45:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229528AbiGXDpj (ORCPT ); Sat, 23 Jul 2022 23:45:39 -0400 Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D8A1EE06; Sat, 23 Jul 2022 20:45:38 -0700 (PDT) Received: by mail-io1-xd32.google.com with SMTP id h145so6392705iof.9; Sat, 23 Jul 2022 20:45:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=urdOpy9asLw3Y6MlWSHoFWdbz6150EOdUC7TdYBaBuE=; b=LsldSwyvy+YhsmguyJks6+5wlPrp4WItiFSfIL1Vjp+D33iw4UekGa9I/D+fSLB4VG j7jPHJWrjbxipCBmPxShuRBFINBE24/iMBsIIoA/aMLAPPpNjasZJu3rrVMdIfmqQ6L8 ZY5llKN3UaNPFBeyfnQsPIgcvNlI81fippMTadgMZfNySakXYqLrIxGKvK6WJqcemNoJ Cv8vJx6gqiyrZQGVvoL2Bo4jyRbF9l77M0ODMLcGu4lUhYKu5CnRgutqt3bkYpG0kwTx Ed6NoKFDzuim6Lu4/f2/fAQM16/I0181UQy/0NdSi74OmhhB0K/DzZx2V/DvHtD9ohCQ jcqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=urdOpy9asLw3Y6MlWSHoFWdbz6150EOdUC7TdYBaBuE=; b=mqBQfX+ccdDAHQC1X5SqQWk7ZyTme0Fus2OMk8YGnukKxm2XqO4q+CI9JPdac1ZUB5 A59aoTsD18U7U9w4Qxfw7/X8Kt9G4j3rGWakt3ANSZLaI0cXq92/tjK2aVXOD5+ehGrA KiCpfg7xYFewiZWrt4hJICDG+gvuLOuwulbnIeSbi8CqN+cOSq25Q/FJSOwOkmeXIICa MERFxgchX3iexxmYmR4AV+O27dFmozLsZq3RqL0CCviw+O6aBNCU0nZmSKEa/P/vmbPc JUZH0Vp/o4k1Tb0Ht/EYZEEz6dnlAlIxc5FqPySMEoM3PoaOSxpM3kE1WOW0Avz8YX6b ooGg== X-Gm-Message-State: AJIora/TAjMIjDXqAR+/ggO3D8ptbW1GIq+NmmJHhZzf86ZQUVmhxyhd zZnxhemWJ95Oqln2948qZQaDBgmG2Hq1Juers4o= X-Received: by 2002:a05:6638:16cb:b0:33f:8871:1b5c with SMTP id g11-20020a05663816cb00b0033f88711b5cmr2717685jat.11.1658634338052; Sat, 23 Jul 2022 20:45:38 -0700 (PDT) MIME-Version: 1.0 References: <20220723135447.199557-1-code@siddh.me> <1822b76775c.69c52873236056.4849193904753307696@siddh.me> In-Reply-To: <1822b76775c.69c52873236056.4849193904753307696@siddh.me> From: Khalid Masum Date: Sun, 24 Jul 2022 09:45:27 +0600 Message-ID: Subject: Re: [PATCH] kernel/watch_queue: Make pipe NULL while clearing watch_queue To: Siddh Raman Pant Cc: Greg KH , "syzbot+c70d87ac1d001f29a058" , linux-kernel-mentees , linux-security-modules , linux-kernel , David Howells , Eric Dumazet , Christophe JAILLET , "Fabio M. De Francesco" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,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 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