From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6873C433EF for ; Wed, 19 Jan 2022 22:10:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1EF746B0071; Wed, 19 Jan 2022 17:10:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1798E6B0073; Wed, 19 Jan 2022 17:10:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F334F6B0074; Wed, 19 Jan 2022 17:10:17 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0063.hostedemail.com [216.40.44.63]) by kanga.kvack.org (Postfix) with ESMTP id DE51D6B0071 for ; Wed, 19 Jan 2022 17:10:17 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 82D1F181CBDA2 for ; Wed, 19 Jan 2022 22:10:17 +0000 (UTC) X-FDA: 79048430874.21.7C4E798 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by imf22.hostedemail.com (Postfix) with ESMTP id 34D40C000D for ; Wed, 19 Jan 2022 22:10:17 +0000 (UTC) Received: by mail-wm1-f52.google.com with SMTP id e9-20020a05600c4e4900b0034d23cae3f0so8797201wmq.2 for ; Wed, 19 Jan 2022 14:10:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=szrglUOKoAQRQL02i1H7q+pkp1ayvzmklTL6wOVwT/s=; b=b/pjhf7Ufhd6sE/TL9wGfVLA8ZUgCb4fxEU2pBxi6qcW+J9nNVdu+RuhHHHS5i8zun 0UzK40qMKlHBZtAEIq9sg4hml/8YIpHn0e8JZDScCaLTNbdSCLGQ2iFy32/ieCbO3Ygy 846sJwvKK8FsuQcPKxqLm9pu97Hp0MfAr+/xPs78yE9QJvES1YAq6zHnNv9wbcihgrmx yyRcyZP2qObq1RATKm9rENCkHWmMySdaL9h9rQQKhlXItbHbwr+Or24AxSo2ulouHhG2 PZZkeFn/JlxaTyP8JF31uB3fthgI/3V4qWIpBikxYCpnkcbBu7lnEaZaMTkLfTEecZnk Lpww== 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=szrglUOKoAQRQL02i1H7q+pkp1ayvzmklTL6wOVwT/s=; b=Mszq9s1FLeeaSSkYyJ2U6GKX8hKBzjKMtqUCn+yK862bewg8jNXX+OrJXZEqvvpt2V Tun5lp5M4QnzN2wAi1JxhWJ/MEUMxp+0ozjgYj2VKHSTNjwzSjk466uO35/AIuG3yrfI t7LmQdXnJi8H17rEMf4cTu5uLpoONHTz3XZo5sUlBU8ziZkzrafJCBhL71hsqzj9D1CV vprcPsntyQzJEPzNQGZwyg2AiwcljGtss/f8rTtBo2FPHUYpiXTBHHsJFfY49K4w1Hya FJ8udMPj6r/kTdcrTLF4D0OkfbjxKVF67M8NfiFDTifuuNi3//QRyyBcGelcg6xnVMNl 5+vw== X-Gm-Message-State: AOAM533Cxb4A5Z1pwptAQGuvgU2oij2hBSpwPkyhJQuBOSrFZd5fGz4M Yk+3XXs+wumND+K/fCj5GygIlJaKwV6SzC6e6IGRXA== X-Google-Smtp-Source: ABdhPJzGbBUyj7EUYRylWYsQVSn/4u8jYvtro1LgzSOuaaZyieN2jbCY5DvUbQg+W+oh8ulm700AcEz33UFd0c0H6BI= X-Received: by 2002:a05:6000:1569:: with SMTP id 9mr20621093wrz.500.1642630215593; Wed, 19 Jan 2022 14:10:15 -0800 (PST) MIME-Version: 1.0 References: <202201170247.Cir3moOM-lkp@intel.com> In-Reply-To: From: Kalesh Singh Date: Wed, 19 Jan 2022 14:10:04 -0800 Message-ID: Subject: Re: [ammarfaizi2-block:google/android/kernel/common/android12-5.4 6517/9999] fs/userfaultfd.c:1519:9: warning: variable 'ioctls_out' set but not used To: Axel Rasmussen Cc: Suren Baghdasaryan , kernel test robot , llvm@lists.linux.dev, kbuild-all@lists.01.org, "GNU/Weeb Mailing List" , LKML , Todd Kjos , Peter Xu , Andrew Morton , Linux Memory Management List , Lokesh Gidra Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 34D40C000D X-Stat-Signature: tto5o8i5bzuktjfekktx39rooo7btccq Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b="b/pjhf7U"; spf=pass (imf22.hostedemail.com: domain of kaleshsingh@google.com designates 209.85.128.52 as permitted sender) smtp.mailfrom=kaleshsingh@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspamd-Server: rspam07 X-HE-Tag: 1642630217-187190 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000891, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Jan 19, 2022 at 2:03 PM Axel Rasmussen wrote: > > On Wed, Jan 19, 2022 at 1:19 PM Suren Baghdasaryan wrote: > > > > On Wed, Jan 19, 2022 at 12:39 PM Axel Rasmussen > > wrote: > > > > > > Lokesh, I only spent a few moments looking, but my suspicion is that > > > this is the result of an incomplete backport of these patches to the > > > Android kernel? > > > > > > The UFFDIO_CONTINUE patches introduced ioctls_out since the > > > computation of it got more complicated, and those same patches also > > > modified the put_user() on line 1533 here to use ioctls_out. I think > > > Android backported the first part, but left out the second? > > > > The backport https://android-review.googlesource.com/c/kernel/common/+/1652718 > > looks like a mixture of > > 14819305e09fe4 ("userfaultfd: wp: declare _UFFDIO_WRITEPROTECT > > conditionally") and f619147104c8 ("userfaultfd: add UFFDIO_CONTINUE > > ioctl"). > > Not sure why it was done this way, maybe to minimize code changes > > while backporting. > > Simplest fix is probably to add __maybe_unused to ioctls_out declaration. > > Unfortunately, that doesn't quite do it. That would fix the warning, > but the code in the original e-mail is still wrong: we incorrectly > don't report the _UFFDIO_CONTINUE bit, unless we use the value we > computed in ioctls_out. I think what happened is that Axel's patch [1] depends on the patch from Peter [2]. [1] was backported without the dependency and the conflict resolutions aren't quite correct. [1] https://lore.kernel.org/lkml/20210301222728.176417-5-axelrasmussen@google.com/ [2] https://lore.kernel.org/lkml/20200220163112.11409-18-peterx@redhat.com/ - Kalesh