From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8FA977CF34 for ; Wed, 12 Jun 2024 19:30:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718220614; cv=none; b=Ee9ilahtUPPg7CbmM4o56BE7v2aLZ2QDWlVQLb7cwl5E7m/XRBDzwf5ZSO3qWDo2XPo8j560tgrQHRuG9lvMwtuuuakzF9YQg4qZAYUbQ+JUihan8fwITUluo3i22WNRZwBZvIQZiyE0dAaBey02uSI6Nsiq75BX/qaICQ6jEgE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718220614; c=relaxed/simple; bh=5BtyI5IDIXtKLDBCM9y34kHIvboJlQF6H/aKsojbtFw=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=IFzEjg0DIm0xSF243LydljYxXFZaUYWGqJwFUeMJEQyhtEleE7gXWtG6w0klbEzHKeBQHq7NOuwY/eCXE1Q2ckdkM00bMmNlyHQFCqIdclD09Z7FMazes7H+T/+taTW4Y+l7SXtnM2Qszk84u3WLuoP3ggSqWKn5CkkFXIef17Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Y1t6u4X7; arc=none smtp.client-ip=192.198.163.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Y1t6u4X7" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718220613; x=1749756613; h=date:from:to:cc:subject:message-id:mime-version: content-transfer-encoding; bh=5BtyI5IDIXtKLDBCM9y34kHIvboJlQF6H/aKsojbtFw=; b=Y1t6u4X7VoaZ+vFm9aWyFA0sZdkdW7cMAVlbPHhFfAfHLbRouU6u9EJs 3WJWbMitmSWmDi9QzN2Uww0HNj+BQ6icks/25goOuPcoRxyBUG94atTso 2iKOmL/kW500AyMAVrwJtFqPKj8hQ8a324weZgOSdZqXRmTaRLvjrQZtK e+n/B8oVVpm2Abm8uGI0ZmKB16RgTUfz315MoId99i8EoSIklFcIQ4EJC kzADaXK1eSC9AvFkSTRzzbkhq0XYbO58spjBs21jCO4hEVFefY2B5CCp1 APL62xQS9TMV4ZzSkD+bhtmA1Ayl67qgheTpPJL8X2XB3W3j8PXrAe+jn Q==; X-CSE-ConnectionGUID: z7WkQYMnROOu5n10TbxHCQ== X-CSE-MsgGUID: hPKGXKGbTaqaPidSNFmopw== X-IronPort-AV: E=McAfee;i="6700,10204,11101"; a="17930818" X-IronPort-AV: E=Sophos;i="6.08,234,1712646000"; d="scan'208";a="17930818" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2024 12:30:12 -0700 X-CSE-ConnectionGUID: Oi5ELaSHQeiK0vXMOLwaqQ== X-CSE-MsgGUID: 0M/kwU6ZQeSXGsSt5qWjjQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,234,1712646000"; d="scan'208";a="44333188" Received: from lkp-server01.sh.intel.com (HELO 628d7d8b9fc6) ([10.239.97.150]) by fmviesa005.fm.intel.com with ESMTP; 12 Jun 2024 12:30:10 -0700 Received: from kbuild by 628d7d8b9fc6 with local (Exim 4.96) (envelope-from ) id 1sHTfc-0001sM-2N; Wed, 12 Jun 2024 19:30:08 +0000 Date: Thu, 13 Jun 2024 03:29:13 +0800 From: kernel test robot To: oe-kbuild@lists.linux.dev Cc: lkp@intel.com, Dan Carpenter Subject: Re: [PATCH v2 1/4] kernfs: remove page_mkwrite() from vm_operations_struct Message-ID: <202406130357.6NmgCbMP-lkp@intel.com> Precedence: bulk X-Mailing-List: oe-kbuild@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit BCC: lkp@intel.com CC: oe-kbuild-all@lists.linux.dev In-Reply-To: <20240611182732.360317-2-martin.oliveira@eideticom.com> References: <20240611182732.360317-2-martin.oliveira@eideticom.com> TO: Martin Oliveira TO: linux-rdma@vger.kernel.org TO: linux-kernel@vger.kernel.org TO: linux-mm@kvack.org CC: Jason Gunthorpe CC: Leon Romanovsky CC: "Greg Kroah-Hartman" CC: Tejun Heo CC: Andrew Morton CC: Linux Memory Management List CC: Logan Gunthorpe CC: Martin Oliveira CC: Mike Marciniszyn CC: Shiraz Saleem CC: Michael Guralnik CC: Artemy Kovalyov Hi Martin, kernel test robot noticed the following build warnings: [auto build test WARNING on 83a7eefedc9b56fe7bfeff13b6c7356688ffa670] url: https://github.com/intel-lab-lkp/linux/commits/Martin-Oliveira/kernfs-remove-page_mkwrite-from-vm_operations_struct/20240612-023130 base: 83a7eefedc9b56fe7bfeff13b6c7356688ffa670 patch link: https://lore.kernel.org/r/20240611182732.360317-2-martin.oliveira%40eideticom.com patch subject: [PATCH v2 1/4] kernfs: remove page_mkwrite() from vm_operations_struct :::::: branch date: 25 hours ago :::::: commit date: 25 hours ago config: i386-randconfig-141-20240612 (https://download.01.org/0day-ci/archive/20240613/202406130357.6NmgCbMP-lkp@intel.com/config) compiler: gcc-12 (Ubuntu 12.3.0-9ubuntu2) 12.3.0 If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202406130357.6NmgCbMP-lkp@intel.com/ smatch warnings: fs/kernfs/file.c:462 kernfs_fop_mmap() error: we previously assumed 'vma->vm_ops' could be null (see line 459) vim +462 fs/kernfs/file.c 414985ae23c031 Tejun Heo 2013-11-28 415 c637b8acbe079e Tejun Heo 2013-12-11 416 static int kernfs_fop_mmap(struct file *file, struct vm_area_struct *vma) 414985ae23c031 Tejun Heo 2013-11-28 417 { c525aaddc366df Tejun Heo 2013-12-11 418 struct kernfs_open_file *of = kernfs_of(file); 414985ae23c031 Tejun Heo 2013-11-28 419 const struct kernfs_ops *ops; 414985ae23c031 Tejun Heo 2013-11-28 420 int rc; 414985ae23c031 Tejun Heo 2013-11-28 421 9b2db6e1894577 Tejun Heo 2013-12-10 422 /* 9b2db6e1894577 Tejun Heo 2013-12-10 423 * mmap path and of->mutex are prone to triggering spurious lockdep 9b2db6e1894577 Tejun Heo 2013-12-10 424 * warnings and we don't want to add spurious locking dependency 9b2db6e1894577 Tejun Heo 2013-12-10 425 * between the two. Check whether mmap is actually implemented 9b2db6e1894577 Tejun Heo 2013-12-10 426 * without grabbing @of->mutex by testing HAS_MMAP flag. See the c810729fe6471a Ahelenia ZiemiaƄska 2023-12-21 427 * comment in kernfs_fop_open() for more details. 9b2db6e1894577 Tejun Heo 2013-12-10 428 */ df23fc39bce03b Tejun Heo 2013-12-11 429 if (!(of->kn->flags & KERNFS_HAS_MMAP)) 9b2db6e1894577 Tejun Heo 2013-12-10 430 return -ENODEV; 9b2db6e1894577 Tejun Heo 2013-12-10 431 414985ae23c031 Tejun Heo 2013-11-28 432 mutex_lock(&of->mutex); 414985ae23c031 Tejun Heo 2013-11-28 433 414985ae23c031 Tejun Heo 2013-11-28 434 rc = -ENODEV; c637b8acbe079e Tejun Heo 2013-12-11 435 if (!kernfs_get_active(of->kn)) 414985ae23c031 Tejun Heo 2013-11-28 436 goto out_unlock; 414985ae23c031 Tejun Heo 2013-11-28 437 324a56e16e44ba Tejun Heo 2013-12-11 438 ops = kernfs_ops(of->kn); 414985ae23c031 Tejun Heo 2013-11-28 439 rc = ops->mmap(of, vma); b44b2140265ddf Tejun Heo 2014-04-20 440 if (rc) b44b2140265ddf Tejun Heo 2014-04-20 441 goto out_put; 414985ae23c031 Tejun Heo 2013-11-28 442 414985ae23c031 Tejun Heo 2013-11-28 443 /* 414985ae23c031 Tejun Heo 2013-11-28 444 * PowerPC's pci_mmap of legacy_mem uses shmem_zero_setup() 414985ae23c031 Tejun Heo 2013-11-28 445 * to satisfy versions of X which crash if the mmap fails: that 414985ae23c031 Tejun Heo 2013-11-28 446 * substitutes a new vm_file, and we don't then want bin_vm_ops. 414985ae23c031 Tejun Heo 2013-11-28 447 */ 414985ae23c031 Tejun Heo 2013-11-28 448 if (vma->vm_file != file) 414985ae23c031 Tejun Heo 2013-11-28 449 goto out_put; 414985ae23c031 Tejun Heo 2013-11-28 450 414985ae23c031 Tejun Heo 2013-11-28 451 rc = -EINVAL; 414985ae23c031 Tejun Heo 2013-11-28 452 if (of->mmapped && of->vm_ops != vma->vm_ops) 414985ae23c031 Tejun Heo 2013-11-28 453 goto out_put; 414985ae23c031 Tejun Heo 2013-11-28 454 414985ae23c031 Tejun Heo 2013-11-28 455 /* 414985ae23c031 Tejun Heo 2013-11-28 456 * It is not possible to successfully wrap close. 414985ae23c031 Tejun Heo 2013-11-28 457 * So error if someone is trying to use close. 414985ae23c031 Tejun Heo 2013-11-28 458 */ 414985ae23c031 Tejun Heo 2013-11-28 @459 if (vma->vm_ops && vma->vm_ops->close) 414985ae23c031 Tejun Heo 2013-11-28 460 goto out_put; 414985ae23c031 Tejun Heo 2013-11-28 461 927bb8d619fea4 Martin Oliveira 2024-06-11 @462 if (vma->vm_ops->page_mkwrite) 927bb8d619fea4 Martin Oliveira 2024-06-11 463 goto out_put; 927bb8d619fea4 Martin Oliveira 2024-06-11 464 414985ae23c031 Tejun Heo 2013-11-28 465 rc = 0; 05d8f255867e31 Neel Natu 2024-01-27 466 if (!of->mmapped) { a1d82aff5df760 Tejun Heo 2016-12-27 467 of->mmapped = true; bdb2fd7fc56e19 Tejun Heo 2022-08-27 468 of_on(of)->nr_mmapped++; 414985ae23c031 Tejun Heo 2013-11-28 469 of->vm_ops = vma->vm_ops; 05d8f255867e31 Neel Natu 2024-01-27 470 } 414985ae23c031 Tejun Heo 2013-11-28 471 vma->vm_ops = &kernfs_vm_ops; 414985ae23c031 Tejun Heo 2013-11-28 472 out_put: c637b8acbe079e Tejun Heo 2013-12-11 473 kernfs_put_active(of->kn); 414985ae23c031 Tejun Heo 2013-11-28 474 out_unlock: 414985ae23c031 Tejun Heo 2013-11-28 475 mutex_unlock(&of->mutex); 414985ae23c031 Tejun Heo 2013-11-28 476 414985ae23c031 Tejun Heo 2013-11-28 477 return rc; 414985ae23c031 Tejun Heo 2013-11-28 478 } 414985ae23c031 Tejun Heo 2013-11-28 479 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki