From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 CA983145B08 for ; Sun, 31 Mar 2024 18:28:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711909720; cv=none; b=Ty9xZBKLglnV3wXR3FkRuTQdYt7xrT6tY9XvroSns8SHpcidHCLmD+DJ1Z0gg1ydLpAMM88lLlCbo2XC7hGOk1OVVQVBLZO2/6nks/ynrUjx4fnBwzS3/4SgSgVyGlenSAgGYDUWWFaVIMRKraCA8nA8JaOV/kz+Fogwm1zR6qY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711909720; c=relaxed/simple; bh=kM5ZnYRwfatwEczWvxY4pAh07yJrgjeiQz791e3I580=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=Un4Ho2e3BxVeDSqQw5U+lTApLeNU7UeZ0ZdziwcZvDDuuILA8kpQ5kejz98F9lfeVxKT8GlVcS4iZDzpeNqXVEez1+d8/23fLeix/2gAch/SXm0r/Hx4CGUgIndslHDXBT7HzzaHYQfJ9t/0MqdLok928TfDXqgqBg9EYEeOYz0= 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=GlYN0KDw; arc=none smtp.client-ip=198.175.65.19 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="GlYN0KDw" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711909718; x=1743445718; h=date:from:to:cc:subject:message-id:mime-version; bh=kM5ZnYRwfatwEczWvxY4pAh07yJrgjeiQz791e3I580=; b=GlYN0KDwxe1Z5yVZSPclXvk8YlQ5yjlD6aiSVAgklB+sgROnhrOaedwH w/VDzpc6wwhVblJWjKy5jmQ7/JvDCiMw7k5pHfvc35jDiRJu1Gv+JQFUm p4PPLA7AfFb5ARzNFw0bw3U/4/4HQ34jTJKUQZqnRu6JQC0PdT2+UIJMS I1OwsVLw9aCCdtoeKug78v1ODaNAl6sB+C+ahVVSSTuQjDY3USWEjKhJh Vyxry+V/+PUxw5DBkDAEy+RmqETDQHRNHpdWBR6w3Z2jP4CnDIZlTdSWC m/0cQUlZotuuVXSfrs6p1Yk6uW4dW6dlqBF4TW2EUExIa/19K6VKmbdm/ w==; X-CSE-ConnectionGUID: i4hRYaXBQC69y5/UmQwtqA== X-CSE-MsgGUID: H/sFIcIpTGahwqqWif0soQ== X-IronPort-AV: E=McAfee;i="6600,9927,11030"; a="6892724" X-IronPort-AV: E=Sophos;i="6.07,170,1708416000"; d="scan'208";a="6892724" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2024 11:28:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,170,1708416000"; d="scan'208";a="40668003" Received: from lkp-server01.sh.intel.com (HELO 3d808bfd2502) ([10.239.97.150]) by fmviesa002.fm.intel.com with ESMTP; 31 Mar 2024 11:28:36 -0700 Received: from kbuild by 3d808bfd2502 with local (Exim 4.96) (envelope-from ) id 1rqzuz-0001LC-2b; Sun, 31 Mar 2024 18:28:33 +0000 Date: Mon, 1 Apr 2024 02:28:22 +0800 From: kernel test robot To: oe-kbuild@lists.linux.dev Cc: lkp@intel.com Subject: proc-empty-vm.c:342:17: warning: ignoring return value of 'write' declared with attribute 'warn_unused_result' Message-ID: <202404010211.ygidvMwa-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=us-ascii Content-Disposition: inline :::::: :::::: Manual check reason: "low confidence bisect report" :::::: BCC: lkp@intel.com CC: oe-kbuild-all@lists.linux.dev CC: linux-kernel@vger.kernel.org TO: Swarup Laxman Kotiaklapudi CC: Andrew Morton CC: Linux Memory Management List CC: Alexey Dobriyan tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 712e14250dd2907346617eba275c46f53db8fae7 commit: 6e79b375adb38219099d7e3ccc973a7808108a3e proc: test /proc/${pid}/statm date: 6 months ago :::::: branch date: 21 hours ago :::::: commit date: 6 months ago compiler: gcc-12 (Ubuntu 12.3.0-9ubuntu2) 12.3.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240401/202404010211.ygidvMwa-lkp@intel.com/reproduce) 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 | Closes: https://lore.kernel.org/r/202404010211.ygidvMwa-lkp@intel.com/ All warnings (new ones prefixed by >>): proc-empty-vm.c: In function 'test_proc_pid_statm': >> proc-empty-vm.c:342:17: warning: ignoring return value of 'write' declared with attribute 'warn_unused_result' [-Wunused-result] 342 | write(1, buf, rv); | ^~~~~~~~~~~~~~~~~ vim +342 tools/testing/selftests/proc/proc-empty-vm.c 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 320 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 321 /* 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 322 * There seems to be 2 types of valid output: 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 323 * "0 A A B 0 0 0\n" for dynamic exeuctables, 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 324 * "0 0 0 B 0 0 0\n" for static executables. 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 325 */ 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 326 static int test_proc_pid_statm(pid_t pid) 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 327 { 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 328 char buf[4096]; 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 329 snprintf(buf, sizeof(buf), "/proc/%u/statm", pid); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 330 int fd = open(buf, O_RDONLY); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 331 if (fd == -1) { 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 332 perror("open /proc/${pid}/statm"); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 333 return EXIT_FAILURE; 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 334 } 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 335 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 336 ssize_t rv = read(fd, buf, sizeof(buf)); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 337 close(fd); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 338 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 339 assert(rv >= 0); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 340 assert(rv <= sizeof(buf)); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 341 if (0) { 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 @342 write(1, buf, rv); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 343 } 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 344 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 345 const char *p = buf; 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 346 const char *const end = p + rv; 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 347 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 348 /* size */ 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 349 assert(p != end && *p++ == '0'); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 350 assert(p != end && *p++ == ' '); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 351 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 352 uint64_t resident; 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 353 p = parse_u64(p, end, &resident); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 354 assert(p != end && *p++ == ' '); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 355 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 356 uint64_t shared; 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 357 p = parse_u64(p, end, &shared); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 358 assert(p != end && *p++ == ' '); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 359 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 360 uint64_t text; 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 361 p = parse_u64(p, end, &text); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 362 assert(p != end && *p++ == ' '); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 363 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 364 assert(p != end && *p++ == '0'); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 365 assert(p != end && *p++ == ' '); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 366 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 367 /* data */ 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 368 assert(p != end && *p++ == '0'); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 369 assert(p != end && *p++ == ' '); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 370 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 371 assert(p != end && *p++ == '0'); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 372 assert(p != end && *p++ == '\n'); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 373 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 374 assert(p == end); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 375 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 376 /* 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 377 * "text" is "mm->end_code - mm->start_code" at execve(2) time. 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 378 * munmap() doesn't change it. It can be anything (just link 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 379 * statically). It can't be 0 because executing to this point 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 380 * implies at least 1 page of code. 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 381 */ 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 382 assert(text > 0); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 383 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 384 /* 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 385 * These two are always equal. Always 0 for statically linked 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 386 * executables and sometimes 0 for dynamically linked executables. 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 387 * There is no way to tell one from another without parsing ELF 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 388 * which is too much for this test. 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 389 */ 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 390 assert(resident == shared); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 391 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 392 return EXIT_SUCCESS; 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 393 } 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 394 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki 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 C6B12CD1284 for ; Mon, 1 Apr 2024 02:33:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C296A6B0082; Sun, 31 Mar 2024 22:33:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BD82B6B0083; Sun, 31 Mar 2024 22:33:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A51EF6B0085; Sun, 31 Mar 2024 22:33:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 81AB76B0082 for ; Sun, 31 Mar 2024 22:33:19 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id D9F2A40304 for ; Mon, 1 Apr 2024 02:33:18 +0000 (UTC) X-FDA: 81959391276.03.0F6383F Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) by imf14.hostedemail.com (Postfix) with ESMTP id ECF28100005 for ; Mon, 1 Apr 2024 02:33:14 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=lVh5Q+iJ; dmarc=pass (policy=none) header.from=intel.com; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); spf=pass (imf14.hostedemail.com: domain of yujie.liu@intel.com designates 198.175.65.17 as permitted sender) smtp.mailfrom=yujie.liu@intel.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711938795; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=VYx9yn9RZ4Lp7qBgIehUjB7enc0dJ/OUFbpf2fP7A9U=; b=jsxcmhFsM1pDJFM2qBb25i5h5TY42U2Mc+9/2wyxrvSq3TiH6ALwn4MDL8K2BkYeXHGuNk WV1T04BB6WyHAavcRkFij2Zi+VXiVd4E+IIydabmMocOgknyoJN0Yu/mbDKQ6IaA4rpVPe OuZtsnDszxz9a7lVQAD2lCkEL6UDO70= ARC-Authentication-Results: i=2; imf14.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=lVh5Q+iJ; dmarc=pass (policy=none) header.from=intel.com; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); spf=pass (imf14.hostedemail.com: domain of yujie.liu@intel.com designates 198.175.65.17 as permitted sender) smtp.mailfrom=yujie.liu@intel.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1711938795; a=rsa-sha256; cv=fail; b=31uGYy+2PuoJBY376R9TaDjcljHimzrwqwQkg6YQ0vFYJ+RAbeVKmI4OFXN/gfdUJuw784 jYBzA70Kv0/EYGTa5CGVlg27Gvsra25dnr0mzQbQFlh3N4s68UOPUdjqOgYNAEx98RIWmE UdgiCmPbtU9kk8v1uFYCP74hcMrO7O8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711938795; x=1743474795; h=date:from:to:cc:subject:message-id:mime-version; bh=KtId0EKw+dx4CDVyAsGCtPQFYiT1uxcbs4rxYPKD0d4=; b=lVh5Q+iJfqOG3vm7T6/mHNZmSwwk+7xwmhBO2IoVg4qRx797LcRNGuiI X93021ZipZj3iE/vHFgsC/lVUXo0PYopPBe0UDZJYQuenEbtt64Cv9ysH cN1XKiPepTFZBjNDeW/OQ6VdVdY2m0N21qNarVCE717vPNlnlOeEjoBjD lBkvEuolPgkNYbMVocHY7OfoyFEhOREphhAmFxP5lS64LWNg6CfVM0LTu FWnPlclchr7g3apQM+304HGN2goGcbxXUkEUFol5q7VWpYNrJwtoxahS0 U20USERW8JLjW3IVPXNE4X7XgTJdUpU4TJEzoRHGRniBEJA3KZ44Hbv83 A==; X-CSE-ConnectionGUID: hSClKN2FTUO9Vc+BTDuO6g== X-CSE-MsgGUID: zCBKCg4fRWqkKqsEACnysw== X-IronPort-AV: E=McAfee;i="6600,9927,11030"; a="7170160" X-IronPort-AV: E=Sophos;i="6.07,171,1708416000"; d="scan'208";a="7170160" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2024 19:33:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,171,1708416000"; d="scan'208";a="48556936" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orviesa002.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 31 Mar 2024 19:33:11 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 31 Mar 2024 19:33:09 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Sun, 31 Mar 2024 19:33:09 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.168) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Sun, 31 Mar 2024 19:33:09 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nwaJfjXNqZzGuNCUamET/3nfOo9Q2cVJ6bXaY88/6DVqMPurZFIi2FeOcsfOJsdgxPrVkDm9kilhaensBdOiCBAWUBVjPVA/QzP52LHWC/fpQ653xB4AKqoQ1OQsBEUY324WTUwXkQ7358IbkRaXMhPDUzEQLYBXgdCX3kL7i8r9GTdnIFA065RF1hhwq997jpTcLDoGen28OGf8Ui3BzxqeOO+LAAKrEtmmy8qR/W93K1hYFx9Bjd8FGiNyqcQl7tWgvPjhval87YrjE+FyoKhBYQcP7j70jgPNQ5SLnK4alQx6Ikjs/995bUwkFFpp5iq2ojcc3HrzQ5L1Yid53w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VYx9yn9RZ4Lp7qBgIehUjB7enc0dJ/OUFbpf2fP7A9U=; b=SrDbsAp5h96IAPzcyoEF2duiM6l23ZOtuzhRgQWhfvRKo38DbKx3ykdzkfe9z9IMhe3yuCW/6KZnp84hFwpRe72kuxxg/tYWm/B+Vceuu0aDea5Q2sV6YFigrzSo0uXJJbW+qCtrrEgAewu/lsCeeC4LEreEZMyFwp6nHl/m8KqwvSXFhIucps7rEzuYzJo9+c3PdnnLwmbyManl8JilcM+oE084UWAgH1kAdB4tMNcE0qw5t4PIfIZPJ3P8aNaGZbVN3CpHmiqCriQu077OAD790w1Xk3RhUM9WemH7XxzL+56w9o+ThrzLf34Kv5Yt3EQlLYHQEh3/EeSbur1P+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from CY5PR11MB6392.namprd11.prod.outlook.com (2603:10b6:930:37::15) by DS7PR11MB7887.namprd11.prod.outlook.com (2603:10b6:8:e2::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.32; Mon, 1 Apr 2024 02:33:08 +0000 Received: from CY5PR11MB6392.namprd11.prod.outlook.com ([fe80::7118:c3d4:7001:cf9d]) by CY5PR11MB6392.namprd11.prod.outlook.com ([fe80::7118:c3d4:7001:cf9d%6]) with mapi id 15.20.7452.017; Mon, 1 Apr 2024 02:33:07 +0000 Date: Mon, 1 Apr 2024 10:26:27 +0800 From: kernel test robot To: Swarup Laxman Kotiaklapudi CC: , , "Andrew Morton" , Linux Memory Management List , Alexey Dobriyan Subject: proc-empty-vm.c:342:17: warning: ignoring return value of 'write' declared with attribute 'warn_unused_result' Message-ID: <202404010211.ygidvMwa-lkp@intel.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline X-ClientProxiedBy: SI2PR01CA0003.apcprd01.prod.exchangelabs.com (2603:1096:4:191::16) To CY5PR11MB6392.namprd11.prod.outlook.com (2603:10b6:930:37::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY5PR11MB6392:EE_|DS7PR11MB7887:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AhHmYH5ef+0TV5i1Yth6HyReDJB7MoYFheyTAqq+ddwp5GgrK1v69tklFlnoQJZ0025p/x1HkLlTKgjg8nVSANaEeGMDK5S4OF/MjR0F+Zk1LUQ4vjn+dxPZKu+wn7UbbRFEvjd5ubtrmMuDOSDTsy5I1WCJUUd8xr06Tzif6sAt5qAa4RDGauPC1eUCo0uM5nm+Zi4Q36y7kkJK6zH+ULedkTVW4dWmHCH/liLUinXMVneyenRxLG5cTzNyMRKpxKMHgq38geOGNQt7OVZejaZgIuHOQa6CqiJDG8GZJgxzkHobPZnYvxj2BBncXhjHIHLY6WSLdNISRjLZUQuKuenFOFCW6Z7B6flEsVH88dkmI1dNWwEFF2v/Gt2E7ZP1x+/lgETr4sRdAieGW/Ul5kRyhxiaMdWCOAbDT+bouHmbqRNnd+pNZNZIGifpHAGshUiTBkMhRHNwPWJWK9s6n+aFONpTpV6OVCTumC+7SXUEAInA0SQ2ULknQhKD5fwuvMEod7cC5Srv3S9up1JcoHKiwXzcD4XRTgmTrcmKwcSFnOvEYxsvvIvi2ujiCXjtHu1/EbKM/26ENnL2RSaVpELgbXu/FMR7eSNgWqFwRxXvfVm7BPYdh8c5iB+l59Wh X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY5PR11MB6392.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(366007)(376005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?1lqHnGVE1MuU/YTk0/WLxFQLd1Cw8Kd+MQttlfplIwG+D69lhinQSyrNvwzA?= =?us-ascii?Q?PD2UQTYJD9yPA6crb+/amJH1GFCmt/W6BS/nVbQA0lD+JOOdSfrE+0KvqeJm?= =?us-ascii?Q?iaefPC4/yEFWcHwNAvvVzwZ1x2sz+5lrJ5mnXs7KyZS1xUquoA/nCdU5g5Vp?= =?us-ascii?Q?xbf3M6dX5QP5MT3umE8ov91Jlx1OnRg/Ylm0klNez2YXjpyVrhvyx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DHBmbXlZgvaq6Z0sIox6V93bH5QaaK8?= =?us-ascii?Q?UVftgQ+zxAA7Ak2OMe5fAkWZ25wBvNmVXWnELEH3ZEKM5V1hBpFxFYg+3zcj?= =?us-ascii?Q?RSCnZkEt/7E1NOMRmjULKm3Upa7nacmXDzmHUE1dg3jhTRI2RSx240HTwPlj?= =?us-ascii?Q?2yN/e4Ji8LmfEntj7JG7Z4kyMLWVFEcC+Y6R5S9sP64qbNrYn99vPQffd3SH?= =?us-ascii?Q?Ld9lBJf5zxh3BEYxQD9/IyInuNDAdt5gEG80vIpqGsDcqTctjXSIBOgbNLw+?= =?us-ascii?Q?KvcUBLb9BpIymCT8HCZvXcZGmeN5l3EmWJc1V58VI2s9vQZgdNHxoWoM3nlk?= =?us-ascii?Q?ajRZB6iRrAOex5tO3zKX29V8cdNBP0Yu8CZEvuWEQxx3IRc3oowM0TJIQrS6?= =?us-ascii?Q?LO/3OX07K4J74Guwx9VBLK0FC7Z/3Wb3LqyhylwlThxgNqMLetxIREoZXsbp?= =?us-ascii?Q?P96mk3gKQODRyxYKXvqmXjzhsUx+GJTX4+mnbZS/?= X-MS-Exchange-CrossTenant-Network-Message-Id: 8cdb0be8-3d8e-418e-1c2b-08dc51f410ee X-MS-Exchange-CrossTenant-AuthSource: CY5PR11MB6392.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2024 02:33:07.9253 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ITxKjVjtjdx0voZoKGcj9BGzyAzlEI7iAAiDjvykSqfwZy4w+nrWdRzMSigH83JIaxcLGEA7aKynAgoAvyF8vA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR11MB7887 X-OriginatorOrg: int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bzcckX32wUx5RdpxM6vveo8AgOo LktF38RS 9OLvuyGvt52/pKxwMkcsfi0ap/W6cZRcB9EUxnnV8DPSmyudAYbpfdC0XNcOVzzE/sU/9gSzNVB9GwpsOAxhDPKABf+eQaMtu6l/nA+Hwuj7JFxXX9OL6K6qyhxydcz7d6fa8i1xot2TYkz+05feNqtKZziqWUElL5HsPev7GtJjq0pMTK3eIb+78GXNhePGoJKstrXoLkuuuhffny1mxhTNTfGiAMoAhhhx6XUrIu7LnRuhANoivay8zYwkIxgWsuDkjHEauTQFkYrhM7pclFeEuqolwQa1/JOqs/If4akCnTre+TnOCfvmvNG2BQ6iW8SvTB6POXtUmjXF8vYJzMsuVpW6zq3xkBf6vTleVTOBoWuV/wifFsTmHOqdPvrmWq/9CGMwphWrR0X7K4+2HIiZMvN9HO/4SdDjGEGfZsOFov0XUIQcvP25V5IqHTJURIE0PIVFSSwgWc4HYqhyXkmcmdLy6yn4YGiglKxW1eWES38rhTrivydr4fJv/TGZHNCjmiY5r9bsXBnU= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 712e14250dd2907346617eba275c46f53db8fae7 commit: 6e79b375adb38219099d7e3ccc973a7808108a3e proc: test /proc/${pid}/statm 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 | Closes: https://lore.kernel.org/r/202404010211.ygidvMwa-lkp@intel.com/ All warnings (new ones prefixed by >>): proc-empty-vm.c: In function 'test_proc_pid_statm': >> proc-empty-vm.c:342:17: warning: ignoring return value of 'write' declared with attribute 'warn_unused_result' [-Wunused-result] 342 | write(1, buf, rv); | ^~~~~~~~~~~~~~~~~ vim +342 tools/testing/selftests/proc/proc-empty-vm.c 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 320 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 321 /* 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 322 * There seems to be 2 types of valid output: 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 323 * "0 A A B 0 0 0\n" for dynamic exeuctables, 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 324 * "0 0 0 B 0 0 0\n" for static executables. 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 325 */ 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 326 static int test_proc_pid_statm(pid_t pid) 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 327 { 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 328 char buf[4096]; 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 329 snprintf(buf, sizeof(buf), "/proc/%u/statm", pid); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 330 int fd = open(buf, O_RDONLY); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 331 if (fd == -1) { 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 332 perror("open /proc/${pid}/statm"); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 333 return EXIT_FAILURE; 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 334 } 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 335 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 336 ssize_t rv = read(fd, buf, sizeof(buf)); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 337 close(fd); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 338 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 339 assert(rv >= 0); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 340 assert(rv <= sizeof(buf)); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 341 if (0) { 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 @342 write(1, buf, rv); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 343 } 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 344 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 345 const char *p = buf; 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 346 const char *const end = p + rv; 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 347 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 348 /* size */ 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 349 assert(p != end && *p++ == '0'); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 350 assert(p != end && *p++ == ' '); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 351 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 352 uint64_t resident; 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 353 p = parse_u64(p, end, &resident); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 354 assert(p != end && *p++ == ' '); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 355 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 356 uint64_t shared; 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 357 p = parse_u64(p, end, &shared); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 358 assert(p != end && *p++ == ' '); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 359 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 360 uint64_t text; 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 361 p = parse_u64(p, end, &text); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 362 assert(p != end && *p++ == ' '); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 363 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 364 assert(p != end && *p++ == '0'); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 365 assert(p != end && *p++ == ' '); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 366 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 367 /* data */ 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 368 assert(p != end && *p++ == '0'); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 369 assert(p != end && *p++ == ' '); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 370 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 371 assert(p != end && *p++ == '0'); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 372 assert(p != end && *p++ == '\n'); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 373 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 374 assert(p == end); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 375 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 376 /* 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 377 * "text" is "mm->end_code - mm->start_code" at execve(2) time. 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 378 * munmap() doesn't change it. It can be anything (just link 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 379 * statically). It can't be 0 because executing to this point 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 380 * implies at least 1 page of code. 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 381 */ 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 382 assert(text > 0); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 383 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 384 /* 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 385 * These two are always equal. Always 0 for statically linked 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 386 * executables and sometimes 0 for dynamically linked executables. 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 387 * There is no way to tell one from another without parsing ELF 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 388 * which is too much for this test. 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 389 */ 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 390 assert(resident == shared); 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 391 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 392 return EXIT_SUCCESS; 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 393 } 6e79b375adb382 Swarup Laxman Kotiaklapudi 2023-10-09 394 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki