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 A66F5C77B7F for ; Sun, 30 Apr 2023 01:22:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B3F9F6B0072; Sat, 29 Apr 2023 21:22:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AEFC96B0074; Sat, 29 Apr 2023 21:22:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9B7AE6B0075; Sat, 29 Apr 2023 21:22:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 89EEF6B0072 for ; Sat, 29 Apr 2023 21:22:24 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 49A48160519 for ; Sun, 30 Apr 2023 01:22:24 +0000 (UTC) X-FDA: 80736307008.01.3883A73 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by imf06.hostedemail.com (Postfix) with ESMTP id 96515180007 for ; Sun, 30 Apr 2023 01:22:21 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=FVaY2km+; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf06.hostedemail.com: domain of lkp@intel.com designates 134.134.136.20 as permitted sender) smtp.mailfrom=lkp@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1682817742; 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=2jCSXCo7F7TEHfNmejiVn/F/m5DFqxClK0WhpXVJOaA=; b=63MwJcjjpgiNS1k2h2uExRuwsBlVmfizd0aZ45JYoydEB2KjVMO1CsnM6kHgU1DQLLcZpW VJbZiZ+4U+oMRIdeAcQHnWX9rpIVld+jbRwTDablgULMizokYiSL48ZyNhs7SQSo8zDcmp eu5nxE+M1QS4LVwCaGTban/tcfB6Y6U= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=FVaY2km+; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf06.hostedemail.com: domain of lkp@intel.com designates 134.134.136.20 as permitted sender) smtp.mailfrom=lkp@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1682817742; a=rsa-sha256; cv=none; b=nO/i0Rxd3D2S2/cKX3S7tWF4ITSCBKpgSdfJLsA99hDKU09yWxHVMOQjir9nL5tu7Kdpf0 BzOGEw41fRUhSx2kIkOEotxUcTrM51AZx84oT6VzXwj8Qhf+O6mtWY30AhxigkQvUoVhg8 tJQwn65XNMWG1KQPhFVqW+W7yKQZhZ0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682817741; x=1714353741; h=date:from:to:cc:subject:message-id:mime-version; bh=AVnF9VDeZvsLXWfvD8Al3C8iXctwwF+ZYTtsAfhNyf4=; b=FVaY2km+bbpY0H3ZReYB27By8V+D8uUIr9wstQDv/emNxiurgCNvEerh Twue+K3hdclov3C/Gs/tfq9fDOZpjckpzVhzRU5gBv6tiO+qX7yLiQukr 0HDDR3FKxowhd7hnN7TJ4xJrL5F1OxXKpN+gBoX0PoO6r0M3xCHGIvYnj AjoBFbtSREkGKVlv0axWJIdWM+9AB/Qc9ovLCMArWibXFJ0ie+4pNp6x1 9psgHnydw+CStMoQJauiz+ndfcSyp56nTovda90UFNfqNOcl913V3NKME c44vSQ3Ni7FdQ44JbpUTot13AAEFUJATScRUL7e3DEqQjo/ZHknnaUTxa A==; X-IronPort-AV: E=McAfee;i="6600,9927,10695"; a="337082097" X-IronPort-AV: E=Sophos;i="5.99,238,1677571200"; d="scan'208";a="337082097" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2023 18:22:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10695"; a="725901477" X-IronPort-AV: E=Sophos;i="5.99,238,1677571200"; d="scan'208";a="725901477" Received: from lkp-server01.sh.intel.com (HELO 5bad9d2b7fcb) ([10.239.97.150]) by orsmga008.jf.intel.com with ESMTP; 29 Apr 2023 18:22:17 -0700 Received: from kbuild by 5bad9d2b7fcb with local (Exim 4.96) (envelope-from ) id 1psvlY-0001Rf-0m; Sun, 30 Apr 2023 01:22:16 +0000 Date: Sun, 30 Apr 2023 09:21:42 +0800 From: kernel test robot To: Shiyang Ruan Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, Andrew Morton , Linux Memory Management List , Christoph Hellwig , "Darrick J. Wong" Subject: fs/dax.c:1087:23: sparse: sparse: Using plain integer as NULL pointer Message-ID: <202304300917.nn0VclKO-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 96515180007 X-Stat-Signature: u9joyomc15pxo18ngmg13ijdug7qkzx5 X-HE-Tag: 1682817741-829354 X-HE-Meta: U2FsdGVkX19kNL0rxDv9KSckD4XGosMjHtUZSQpj0yOAHYJyiJnlSkaxKJGgIic+BYw6F6V4B8lmH69AFJUCWjfsYSNWmzO6KuZLsL508qQ/pd0iYmFWCvpZKgfEpt8kBs2J7Au//H7vvXKckTBKpqXCModBcj2yStnLbn56166gH8je0Cg+JArWRxRIFxla2AnauqCwpor78gkyZzC1ppz3sAeUFJAcOD+vCvdysvMscaYQwzoIUOe/thgU/T54QrfCDHCdmiXfvjdwP2uvwWNYFvQDz5kWd3h0NQH3Gb75PLhti5RG/qBEjrJ1XVPU8XfAl+FRd5qEzQjLZA5ZElyHxV6PbgGG8XMbyxPR4cCwdga2uX/82iPnxnEYOF90Nyob/wnZe4QB2FR4HPcuTilGXbgsKBO9A15E9Il7Y5UeVp9BE3lTPvah30yB4hDW4zVDSPKMwYHYuHEhphNOUxo5PLXKHpox21sJSN4yc4LSw5orRl8rw+FILw7UUCliApmf6seCcL5B88uof7XD09Z8d8idvmlCpclwhWxQqvZB1micZ6LVrLmpbBQ/Kq7AzK++yszA6vFoa2dy4Tp9MpZV5pRLeT6Xtmjow7pxlnXx/3OpmlbGR8tEObk9qDkpmtGw6M4pe+9HEoPEQhEUfNM0vpR7Q6ZOahNyQI57V6xCUl6R2eQGilAzQNbh+5PRVk/BwYAoxRvkGhOdeFG+GXDayrZG6LKEs9eQjC1SPYGtcBQkXdZumBoguw6vcCSl2Aki+msWBsmbyPQI6VnMH18OCGg90Rm1fOTZC9vxn5/9kzp3xn0HM0Z1POH0nIv+Gr0zB0oHmNfE51/b8nbqJJWqoxtk45VsL3Qxmvw/qcOQgrQ9Tu7XPHwU50rvomtkJ7QPkduUb1uos8t+3Sy/0+0RokA7+pcsdYGh0kE+Bfa/5qU6oR7APfifmasa0v/gUYfQdH/+d1lTX2HSH4L xJzXv9HY LI1vE8QraZ+yrXB0ZHlNMCht8hTd/bMwpDE1ZY+xsv1VIRtzAsxnyXza9wVPiqBiKCMuee7Wv80kXqXIJUqDRN7Pv6qOuKoiXCfmgAyQIz0uBsVR8xneqsf+kakxo+pJuBEE6RbofDGNFYResMfGoaxcAcsr+M7Tavv48OvL9uXbfe0p790VuciJ4EquSf6x+6OdFtWR2yqi5Rddb7l05C1vVQTxC6Z9G4gNfdZ8H0SVoMvkV8Lyt8Bc3+bjWCPsvLvOqflS1QDY81ACGInM8ht4AICbpC6deKfHlPLmTGO6m2odWUpv8km9NQfff+y78ENbJgBwMcdmIaymLR8OuD1YIvCxXNow3bvvTM4ZiUFbdfj7JWhRm97LCfVwdLZ6l3RG001Sz96MTZDRY+tVppOjeXg== 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: tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 1ae78a14516b9372e4c90a89ac21b259339a3a3a commit: ff17b8df224b98e282ec39a9949a3672fa3dbe93 fsdax: introduce dax_iomap_cow_copy() date: 10 months ago config: s390-randconfig-s041-20230430 (https://download.01.org/0day-ci/archive/20230430/202304300917.nn0VclKO-lkp@intel.com/config) compiler: s390-linux-gcc (GCC) 12.1.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # apt-get install sparse # sparse version: v0.6.4-39-gce1a6720-dirty # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ff17b8df224b98e282ec39a9949a3672fa3dbe93 git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git git fetch --no-tags linus master git checkout ff17b8df224b98e282ec39a9949a3672fa3dbe93 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=s390 olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=s390 SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot | Link: https://lore.kernel.org/oe-kbuild-all/202304300917.nn0VclKO-lkp@intel.com/ sparse warnings: (new ones prefixed by >>) fs/dax.c: note: in included file (through include/trace/trace_events.h, include/trace/define_trace.h, include/trace/events/fs_dax.h): include/trace/events/fs_dax.h:10:1: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned long mask @@ got restricted vm_fault_t @@ include/trace/events/fs_dax.h:10:1: sparse: expected unsigned long mask include/trace/events/fs_dax.h:10:1: sparse: got restricted vm_fault_t include/trace/events/fs_dax.h:10:1: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned long mask @@ got restricted vm_fault_t @@ include/trace/events/fs_dax.h:10:1: sparse: expected unsigned long mask include/trace/events/fs_dax.h:10:1: sparse: got restricted vm_fault_t include/trace/events/fs_dax.h:10:1: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned long mask @@ got restricted vm_fault_t @@ include/trace/events/fs_dax.h:10:1: sparse: expected unsigned long mask include/trace/events/fs_dax.h:10:1: sparse: got restricted vm_fault_t include/trace/events/fs_dax.h:10:1: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned long mask @@ got restricted vm_fault_t @@ include/trace/events/fs_dax.h:10:1: sparse: expected unsigned long mask include/trace/events/fs_dax.h:10:1: sparse: got restricted vm_fault_t include/trace/events/fs_dax.h:10:1: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned long mask @@ got restricted vm_fault_t @@ include/trace/events/fs_dax.h:10:1: sparse: expected unsigned long mask include/trace/events/fs_dax.h:10:1: sparse: got restricted vm_fault_t include/trace/events/fs_dax.h:10:1: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned long mask @@ got restricted vm_fault_t @@ include/trace/events/fs_dax.h:10:1: sparse: expected unsigned long mask include/trace/events/fs_dax.h:10:1: sparse: got restricted vm_fault_t include/trace/events/fs_dax.h:10:1: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned long mask @@ got restricted vm_fault_t @@ include/trace/events/fs_dax.h:10:1: sparse: expected unsigned long mask include/trace/events/fs_dax.h:10:1: sparse: got restricted vm_fault_t include/trace/events/fs_dax.h:10:1: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned long mask @@ got restricted vm_fault_t @@ include/trace/events/fs_dax.h:10:1: sparse: expected unsigned long mask include/trace/events/fs_dax.h:10:1: sparse: got restricted vm_fault_t include/trace/events/fs_dax.h:10:1: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned long mask @@ got restricted vm_fault_t @@ include/trace/events/fs_dax.h:10:1: sparse: expected unsigned long mask include/trace/events/fs_dax.h:10:1: sparse: got restricted vm_fault_t include/trace/events/fs_dax.h:10:1: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned long mask @@ got restricted vm_fault_t @@ include/trace/events/fs_dax.h:10:1: sparse: expected unsigned long mask include/trace/events/fs_dax.h:10:1: sparse: got restricted vm_fault_t include/trace/events/fs_dax.h:10:1: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned long mask @@ got restricted vm_fault_t @@ include/trace/events/fs_dax.h:10:1: sparse: expected unsigned long mask include/trace/events/fs_dax.h:10:1: sparse: got restricted vm_fault_t include/trace/events/fs_dax.h:10:1: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned long mask @@ got restricted vm_fault_t @@ include/trace/events/fs_dax.h:10:1: sparse: expected unsigned long mask include/trace/events/fs_dax.h:10:1: sparse: got restricted vm_fault_t include/trace/events/fs_dax.h:10:1: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned long mask @@ got restricted vm_fault_t @@ include/trace/events/fs_dax.h:10:1: sparse: expected unsigned long mask include/trace/events/fs_dax.h:10:1: sparse: got restricted vm_fault_t include/trace/events/fs_dax.h:153:1: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned long mask @@ got restricted vm_fault_t @@ include/trace/events/fs_dax.h:153:1: sparse: expected unsigned long mask include/trace/events/fs_dax.h:153:1: sparse: got restricted vm_fault_t include/trace/events/fs_dax.h:153:1: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned long mask @@ got restricted vm_fault_t @@ include/trace/events/fs_dax.h:153:1: sparse: expected unsigned long mask include/trace/events/fs_dax.h:153:1: sparse: got restricted vm_fault_t include/trace/events/fs_dax.h:153:1: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned long mask @@ got restricted vm_fault_t @@ include/trace/events/fs_dax.h:153:1: sparse: expected unsigned long mask include/trace/events/fs_dax.h:153:1: sparse: got restricted vm_fault_t include/trace/events/fs_dax.h:153:1: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned long mask @@ got restricted vm_fault_t @@ include/trace/events/fs_dax.h:153:1: sparse: expected unsigned long mask include/trace/events/fs_dax.h:153:1: sparse: got restricted vm_fault_t include/trace/events/fs_dax.h:153:1: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned long mask @@ got restricted vm_fault_t @@ include/trace/events/fs_dax.h:153:1: sparse: expected unsigned long mask include/trace/events/fs_dax.h:153:1: sparse: got restricted vm_fault_t include/trace/events/fs_dax.h:153:1: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned long mask @@ got restricted vm_fault_t @@ include/trace/events/fs_dax.h:153:1: sparse: expected unsigned long mask include/trace/events/fs_dax.h:153:1: sparse: got restricted vm_fault_t include/trace/events/fs_dax.h:153:1: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned long mask @@ got restricted vm_fault_t @@ include/trace/events/fs_dax.h:153:1: sparse: expected unsigned long mask include/trace/events/fs_dax.h:153:1: sparse: got restricted vm_fault_t include/trace/events/fs_dax.h:153:1: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned long mask @@ got restricted vm_fault_t @@ include/trace/events/fs_dax.h:153:1: sparse: expected unsigned long mask include/trace/events/fs_dax.h:153:1: sparse: got restricted vm_fault_t include/trace/events/fs_dax.h:153:1: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned long mask @@ got restricted vm_fault_t @@ include/trace/events/fs_dax.h:153:1: sparse: expected unsigned long mask include/trace/events/fs_dax.h:153:1: sparse: got restricted vm_fault_t include/trace/events/fs_dax.h:153:1: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned long mask @@ got restricted vm_fault_t @@ include/trace/events/fs_dax.h:153:1: sparse: expected unsigned long mask include/trace/events/fs_dax.h:153:1: sparse: got restricted vm_fault_t include/trace/events/fs_dax.h:153:1: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned long mask @@ got restricted vm_fault_t @@ include/trace/events/fs_dax.h:153:1: sparse: expected unsigned long mask include/trace/events/fs_dax.h:153:1: sparse: got restricted vm_fault_t include/trace/events/fs_dax.h:153:1: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned long mask @@ got restricted vm_fault_t @@ include/trace/events/fs_dax.h:153:1: sparse: expected unsigned long mask include/trace/events/fs_dax.h:153:1: sparse: got restricted vm_fault_t include/trace/events/fs_dax.h:153:1: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned long mask @@ got restricted vm_fault_t @@ include/trace/events/fs_dax.h:153:1: sparse: expected unsigned long mask include/trace/events/fs_dax.h:153:1: sparse: got restricted vm_fault_t fs/dax.c:658:39: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned long v @@ got restricted vm_fault_t @@ fs/dax.c:658:39: sparse: expected unsigned long v fs/dax.c:658:39: sparse: got restricted vm_fault_t fs/dax.c:660:39: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned long v @@ got restricted vm_fault_t @@ fs/dax.c:660:39: sparse: expected unsigned long v fs/dax.c:660:39: sparse: got restricted vm_fault_t fs/dax.c:664:31: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned long v @@ got restricted vm_fault_t @@ fs/dax.c:664:31: sparse: expected unsigned long v fs/dax.c:664:31: sparse: got restricted vm_fault_t >> fs/dax.c:1087:23: sparse: sparse: Using plain integer as NULL pointer fs/dax.c:1139:41: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected int result @@ got restricted vm_fault_t [assigned] [usertype] ret @@ fs/dax.c:1139:41: sparse: expected int result fs/dax.c:1139:41: sparse: got restricted vm_fault_t [assigned] [usertype] ret fs/dax.c:1580:46: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected int result @@ got restricted vm_fault_t [usertype] ret @@ fs/dax.c:1580:46: sparse: expected int result fs/dax.c:1580:46: sparse: got restricted vm_fault_t [usertype] ret fs/dax.c:1596:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted vm_fault_t [assigned] [usertype] ret @@ got unsigned long @@ fs/dax.c:1596:21: sparse: expected restricted vm_fault_t [assigned] [usertype] ret fs/dax.c:1596:21: sparse: got unsigned long fs/dax.c:1637:51: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected int result @@ got restricted vm_fault_t [assigned] [usertype] ret @@ fs/dax.c:1637:51: sparse: expected int result fs/dax.c:1637:51: sparse: got restricted vm_fault_t [assigned] [usertype] ret fs/dax.c:1815:55: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected int result @@ got restricted vm_fault_t @@ fs/dax.c:1815:55: sparse: expected int result fs/dax.c:1815:55: sparse: got restricted vm_fault_t fs/dax.c:1830:58: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected int result @@ got restricted vm_fault_t [assigned] [usertype] ret @@ fs/dax.c:1830:58: sparse: expected int result fs/dax.c:1830:58: sparse: got restricted vm_fault_t [assigned] [usertype] ret fs/dax.c:257:13: sparse: sparse: context imbalance in 'wait_entry_unlocked' - unexpected unlock fs/dax.c:439:49: sparse: sparse: context imbalance in 'dax_lock_page' - different lock contexts for basic block fs/dax.c:506:17: sparse: sparse: context imbalance in 'dax_lock_mapping_entry' - different lock contexts for basic block fs/dax.c:930:9: sparse: sparse: context imbalance in 'dax_writeback_one' - unexpected unlock vim +1087 fs/dax.c 1064 1065 /** 1066 * dax_iomap_cow_copy - Copy the data from source to destination before write 1067 * @pos: address to do copy from. 1068 * @length: size of copy operation. 1069 * @align_size: aligned w.r.t align_size (either PMD_SIZE or PAGE_SIZE) 1070 * @srcmap: iomap srcmap 1071 * @daddr: destination address to copy to. 1072 * 1073 * This can be called from two places. Either during DAX write fault (page 1074 * aligned), to copy the length size data to daddr. Or, while doing normal DAX 1075 * write operation, dax_iomap_actor() might call this to do the copy of either 1076 * start or end unaligned address. In the latter case the rest of the copy of 1077 * aligned ranges is taken care by dax_iomap_actor() itself. 1078 */ 1079 static int dax_iomap_cow_copy(loff_t pos, uint64_t length, size_t align_size, 1080 const struct iomap *srcmap, void *daddr) 1081 { 1082 loff_t head_off = pos & (align_size - 1); 1083 size_t size = ALIGN(head_off + length, align_size); 1084 loff_t end = pos + length; 1085 loff_t pg_end = round_up(end, align_size); 1086 bool copy_all = head_off == 0 && end == pg_end; > 1087 void *saddr = 0; 1088 int ret = 0; 1089 1090 ret = dax_iomap_direct_access(srcmap, pos, size, &saddr, NULL); 1091 if (ret) 1092 return ret; 1093 1094 if (copy_all) { 1095 ret = copy_mc_to_kernel(daddr, saddr, length); 1096 return ret ? -EIO : 0; 1097 } 1098 1099 /* Copy the head part of the range */ 1100 if (head_off) { 1101 ret = copy_mc_to_kernel(daddr, saddr, head_off); 1102 if (ret) 1103 return -EIO; 1104 } 1105 1106 /* Copy the tail part of the range */ 1107 if (end < pg_end) { 1108 loff_t tail_off = head_off + length; 1109 loff_t tail_len = pg_end - end; 1110 1111 ret = copy_mc_to_kernel(daddr + tail_off, saddr + tail_off, 1112 tail_len); 1113 if (ret) 1114 return -EIO; 1115 } 1116 return 0; 1117 } 1118 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests