Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1200860pxb; Fri, 21 Jan 2022 12:07:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJyRnFYLPH4GQzUYrIcmwt1EEYge5LO3otV6DR//xJSgbbh7Wkva2c0vyucDAg/dnFBDreXx X-Received: by 2002:aa7:8190:0:b0:4c0:1332:4c8f with SMTP id g16-20020aa78190000000b004c013324c8fmr5084084pfi.23.1642795622969; Fri, 21 Jan 2022 12:07:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642795622; cv=none; d=google.com; s=arc-20160816; b=DrZ2foOM9hCbUSnELlv9/XmQvotASy+yOyn08tmaNy41v05xspRtBiaS5hn60OAaYX qNq7j7NtWxnN1bHYvsn65GYUpPMz70YBjH0HiMJCNM464s4wKgF5IpzPEIlv5gReJiwK 3M/jf4jz+biIdzETouu4t4zY69hu9Ryx3yeVjF1qLSeUd36DptJgcPIh6pAmX0Us4npK hoSd/IRAEiQsSn2nuIIpFy61pBvAlEX6j7wOC+SwFxhdoLAnipBJuzqSEBYNKMv1xFUR iHxtPj0VYrwyHdQ25v4Z915OmARGX5vKz3W8KzZmCjb/ACYx0DgAmE9Zi/yx++cJUhew Mghw== 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=szrglUOKoAQRQL02i1H7q+pkp1ayvzmklTL6wOVwT/s=; b=IGhL09fmMLVWOi367W9EnLlr5e+Q6OpfjMNmDdSz/ROuiemVeg59QOM2VTvliQ95B1 MjNSkXe8I3C9GyD2YoZkqWgtZu7TihQQA6CIVnn0gORCVFwq8rz6UA884RW7+ln9HpUU 5TG3OtfSpqP1wjkNp3Sxh6HV7ezGfyQEtR23AhddCsXGILGTV4TN7X0le7IlsmkuxNR1 G40wBo0aaqsZWylYPzs4Heqxg7EmckcK8EO3waVmtKHExQZqQiPlhUy+NASHoKXXVQZd dusuWsSQJbQFjdsv+zwSex3CaAZ7yDqtfBVi3Rbpo+rH2WkNS2V5X+ulDBMw+9HalH3B /lGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="b/pjhf7U"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v24si12316947pjg.92.2022.01.21.12.06.51; Fri, 21 Jan 2022 12:07:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="b/pjhf7U"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357527AbiASWKS (ORCPT + 99 others); Wed, 19 Jan 2022 17:10:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236813AbiASWKR (ORCPT ); Wed, 19 Jan 2022 17:10:17 -0500 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A909C061574 for ; Wed, 19 Jan 2022 14:10:17 -0800 (PST) Received: by mail-wm1-x32a.google.com with SMTP id q141-20020a1ca793000000b00347b48dfb53so8895233wme.0 for ; Wed, 19 Jan 2022 14:10:17 -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=JZI6DJCppqgzZEGMlaQ0nwRQbvfwWhHRR7lqGA52ysIaa8mM1GBPn7PSaohUX6wDyJ NvqGgxJYImnp8XKesOQvHURhesjGZKFAsNmRPkGI2AQBsZaKNqSfsdXxrOjFoEmaxq9q Mlpg7PbEuTCqYbcZlHob5SdS3PHt24W6bFSgBeQl8NOsvy+0H1Y73INqERAgF1CAKIbm S4Py/+i0Sy49F2nltmtKUtcq8yUTEzkUBGUkSqq+78fDU3qEzTnhiX18P2mugaL6x0Am 2lS9bBBmgld4oVM1xbaU50qMg+9Ap37EzHjeCMsWQCRpY9sCWbCvAGqyD9C2x6nG7BU8 b0Gg== X-Gm-Message-State: AOAM530IDmxvbgNpPWbmCA0fsgwfhtDFA4lFfNeBzRql2ZKMTwRApRvL wsN7DFoQKWDq/f/LxPNN/bYufxp7omicaqRD6dhnIg== 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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