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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49C3AC43334 for ; Fri, 3 Jun 2022 18:17:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344417AbiFCSRT (ORCPT ); Fri, 3 Jun 2022 14:17:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348563AbiFCSQr (ORCPT ); Fri, 3 Jun 2022 14:16:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76B5664D37 for ; Fri, 3 Jun 2022 11:04:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3CC8860F32 for ; Fri, 3 Jun 2022 18:04:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9314FC385A9; Fri, 3 Jun 2022 18:04:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1654279455; bh=mSohYJ51aJa3h+70RpbTHLaq6HRsws9ZHsFqDn2WxZw=; h=Date:To:From:Subject:From; b=c1UGcxTEf6TuHLvKc+tXkssmPoNTYqRMsjPJ9kda0nDBVHLojvPvkNv5TdIoDTXcQ gX7D+JHqZvWKc+5ARuOzXZ1zYaIYsnNPrUdXG/xObH+hzzPdgc/N/DFpYGXWc3T5Qy RIZ5R2t4Lmww9v13TXbQGqRx4hG6YWtAr8a5tuVM= Date: Fri, 03 Jun 2022 11:04:14 -0700 To: mm-commits@vger.kernel.org, willy@infradead.org, viro@zeniv.linux.org.uk, riteshh@linux.ibm.com, rgoldwyn@suse.de, rgoldwyn@suse.com, naoya.horiguchi@nec.com, linmiaohe@huawei.com, jane.chu@oracle.com, hch@lst.de, djwong@kernel.org, david@fromorbit.com, dan.j.williams@intel.com, dan.j.wiliams@intel.com, ruansy.fnst@fujitsu.com, akpm@linux-foundation.org From: Andrew Morton Subject: + fsdax-output-address-in-dax_iomap_pfn-and-rename-it.patch added to mm-unstable branch Message-Id: <20220603180415.9314FC385A9@smtp.kernel.org> Precedence: bulk Reply-To: linux-kernel@vger.kernel.org List-ID: X-Mailing-List: mm-commits@vger.kernel.org The patch titled Subject: fsdax: output address in dax_iomap_pfn() and rename it has been added to the -mm mm-unstable branch. Its filename is fsdax-output-address-in-dax_iomap_pfn-and-rename-it.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/fsdax-output-address-in-dax_iomap_pfn-and-rename-it.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Shiyang Ruan Subject: fsdax: output address in dax_iomap_pfn() and rename it Date: Fri, 3 Jun 2022 13:37:32 +0800 Add address output in dax_iomap_pfn() in order to perform a memcpy() in CoW case. Since this function both output address and pfn, rename it to dax_iomap_direct_access(). Link: https://lkml.kernel.org/r/20220603053738.1218681-9-ruansy.fnst@fujitsu.com Signed-off-by: Shiyang Ruan Reviewed-by: Christoph Hellwig Reviewed-by: Ritesh Harjani Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong Cc: Al Viro Cc: Dan Williams Cc: Dave Chinner Cc: Goldwyn Rodrigues Cc: Goldwyn Rodrigues Cc: Jane Chu Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Naoya Horiguchi Signed-off-by: Andrew Morton --- fs/dax.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) --- a/fs/dax.c~fsdax-output-address-in-dax_iomap_pfn-and-rename-it +++ a/fs/dax.c @@ -1026,8 +1026,8 @@ int dax_writeback_mapping_range(struct a } EXPORT_SYMBOL_GPL(dax_writeback_mapping_range); -static int dax_iomap_pfn(const struct iomap *iomap, loff_t pos, size_t size, - pfn_t *pfnp) +static int dax_iomap_direct_access(const struct iomap *iomap, loff_t pos, + size_t size, void **kaddr, pfn_t *pfnp) { pgoff_t pgoff = dax_iomap_pgoff(iomap, pos); int id, rc; @@ -1035,11 +1035,13 @@ static int dax_iomap_pfn(const struct io id = dax_read_lock(); length = dax_direct_access(iomap->dax_dev, pgoff, PHYS_PFN(size), - DAX_ACCESS, NULL, pfnp); + DAX_ACCESS, kaddr, pfnp); if (length < 0) { rc = length; goto out; } + if (!pfnp) + goto out_check_addr; rc = -EINVAL; if (PFN_PHYS(length) < size) goto out; @@ -1049,6 +1051,12 @@ static int dax_iomap_pfn(const struct io if (length > 1 && !pfn_t_devmap(*pfnp)) goto out; rc = 0; + +out_check_addr: + if (!kaddr) + goto out; + if (!*kaddr) + rc = -EFAULT; out: dax_read_unlock(id); return rc; @@ -1456,7 +1464,7 @@ static vm_fault_t dax_fault_iter(struct return pmd ? VM_FAULT_FALLBACK : VM_FAULT_SIGBUS; } - err = dax_iomap_pfn(&iter->iomap, pos, size, &pfn); + err = dax_iomap_direct_access(&iter->iomap, pos, size, NULL, &pfn); if (err) return pmd ? VM_FAULT_FALLBACK : dax_fault_return(err); _ Patches currently in -mm which might be from ruansy.fnst@fujitsu.com are dax-introduce-holder-for-dax_device.patch mm-factor-helpers-for-memory_failure_dev_pagemap.patch pagemappmem-introduce-memory_failure.patch fsdax-introduce-dax_lock_mapping_entry.patch mm-introduce-mf_dax_kill_procs-for-fsdax-case.patch xfs-implement-notify_failure-for-xfs.patch fsdax-set-a-cow-flag-when-associate-reflink-mappings.patch fsdax-output-address-in-dax_iomap_pfn-and-rename-it.patch fsdax-introduce-dax_iomap_cow_copy.patch fsdax-replace-mmap-entry-in-case-of-cow.patch fsdax-add-dax_iomap_cow_copy-for-dax-zero.patch fsdax-dedup-file-range-to-use-a-compare-function.patch xfs-support-cow-in-fsdax-mode.patch xfs-add-dax-dedupe-support.patch