Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp358276lqc; Thu, 7 Mar 2024 22:20:49 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUR+Cm6Aw8v+xT/AAXG/ZBtfo5Uh1c7wix8Lb793n5uWNuuORzmgcTSjB4W6VtcCjWDE5S8zF264xeJgzS/VgeWrXh8o+KJ5cGQBX+okg== X-Google-Smtp-Source: AGHT+IHCtK4E387n8ob3TZUKVj5oQmfryQ7G0XR6zMjxv8bi/fOItAquZhZkw6DBi5yta4YW73P2 X-Received: by 2002:a2e:b5ae:0:b0:2d3:ffa4:6287 with SMTP id f14-20020a2eb5ae000000b002d3ffa46287mr2788515ljn.37.1709878849002; Thu, 07 Mar 2024 22:20:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709878848; cv=pass; d=google.com; s=arc-20160816; b=oO+/t1X86t8KL7DiDqN902pUwtFDNa66dsDnPTifD7s7tnkbhDNIDhdOVNDJImpQDn +EQSyuevo/sPEQ387Q71B6Ofa9EpG3rid57x9QpwtLk6wtz/GWAiqigC+46C/STwkJxF p9N3PxfKsaZJzQ26te2gh/5ANgDxCTDeKa0sUok1sWsHBac+d4XQf/UcPV03DV1cIJDc TWGR9XartRbGIoc9trxMWqJkvCBcN07MfKAE53JVkQlCLE3f8Jtt/GmmsmbfvTbN1r9O +8Q063WUWhKChniXpsu0ui+QdYJ5SHozVr8RWsVZ5viceAmf2XpuEXZCLXsnankBWlUu Tleg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=OZ+qnmSVC3iLyvhs+UIjCUUIXVPW9vWO1BjQSnS4hDA=; fh=1D7eQ/0rc+iU6BAcs/KVKWP4G7WgjJ9VzUdfNwtKJ+I=; b=p++n9UgvHo1CYmpGf6OdMknY1aq5+aSDQe0w55Rj8avjiNxsQt8kKh6muiRsGydBry gVdXdx1PzWSD6xuAyvkUj/1HZGgSMctF3FzLmPakxjZTNq5Nkgefr2tHB+ffXkNYoHS6 9si2hSwvGxZXVOi1VI0Zb3cqpBXUR7wfvWqXaTMdN8GvoAyA0DKCdQA9rv9/l0x0sykk Zmq2bFDWbwoFGt9le251LjZ7oyyd2o3aMMKRY5nJEF8f+yio3Hvgh7j8BFL9T3yhJ9d4 60XuA0mHYL+hS6Xfcxykeynh/9bL/6YbUe9velHSUxODkq+wWi/K+m4FwOlFNJ+8ttbY douQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JhMvwzu7; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-96550-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96550-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id eb14-20020a0564020d0e00b005662ce42344si7425729edb.147.2024.03.07.22.20.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 22:20:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-96550-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JhMvwzu7; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-96550-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96550-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B0F341F22A9E for ; Fri, 8 Mar 2024 06:20:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0462232C89; Fri, 8 Mar 2024 06:20:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JhMvwzu7" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 234AA3611E for ; Fri, 8 Mar 2024 06:20:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709878840; cv=none; b=A6jrQ2y96eVEF+XLTpblc3Ss3lxHDD5x7Gy66QIE8P/MEdzC8HlMNpLqIPL5SUXk5ATr7ooyvr+IEOL1Q07ihnBQd60D+tqfp2I6IJBl12dAjM2m/r88TY1CrmCR+0dbVcYqCllaKvTj3DTbJ/C1Sl6XqWoT3pQr5Bg3ZdDT6/c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709878840; c=relaxed/simple; bh=APt9nw3iUKosH6rfvav1qdlGVyqi/IlhhjgYZZfNE5Y=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=cfEAGto82BNWtbd3LC0LUHHaEGjHWejrCrczyLKJP/rlBqUYgUYMjVnqKo0qYfxOXb45YpY01u+rnVCE6teSWgC+6my7pRIX489rJYDO3hOYsM3qh286Gi1bkysg46WW68s1+rqCOuXD8uFZX5Yw9BV0JjfKRTOzLlFBRvffxyI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JhMvwzu7; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 078C5C433F1; Fri, 8 Mar 2024 06:20:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709878840; bh=APt9nw3iUKosH6rfvav1qdlGVyqi/IlhhjgYZZfNE5Y=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=JhMvwzu75vexwGA5XzB+R6ylBhI0lqs3sN6u5DHe4KGwhWryea2zpbIOkCRuA+fdf 8Jl8D84Xu89gZnrgRknzV04h9xQnYte2lwok+dlxQLz0Jl/I3R4HcXec1hxPCayIL6 Lh8LaS8te3qQf7HyGxLQf28rQCDs02vp70RDKpZl1KyPFC+7HZ+QG6RLyXcuxer2LA NfHhvBiGLeEFg2u1kp2zyRqNi5Xv+BSZqIGInmNGDbWPds1pbDtfONc+8pmJrC5trI kX0r5YbOdo02x6u/9qxjf4fYWEj6+F2rOqGVPpY51XS+i9TfbODVfiij6WndZD3MpY K+dvnxu0H3O6A== Message-ID: <73296ac6-8b00-4131-ab78-a127cdbff4b9@kernel.org> Date: Fri, 8 Mar 2024 14:20:33 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/5] f2fs: fix to wait page writeback before update Content-Language: en-US To: Jaegeuk Kim Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <20200618063625.110273-1-yuchao0@huawei.com> <20200618235932.GA227771@google.com> <20200619054922.GC227771@google.com> <3634ef79-5903-449d-0d52-3d5566481863@huawei.com> <20200619224755.GA60059@google.com> From: Chao Yu In-Reply-To: <20200619224755.GA60059@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2020/6/20 6:47, Jaegeuk Kim wrote: >>>>>> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c >>>>>> index 3268f8dd59bb..1862073b96d2 100644 >>>>>> --- a/fs/f2fs/file.c >>>>>> +++ b/fs/f2fs/file.c >>>>>> @@ -1250,6 +1250,7 @@ static int __clone_blkaddrs(struct inode *src_inode, struct inode *dst_inode, >>>>>> f2fs_put_page(psrc, 1); >>>>>> return PTR_ERR(pdst); >>>>>> } >>>>>> + f2fs_wait_on_page_writeback(pdst, DATA, true, true); > > Do you mean pdst can be under writeback? Jaegeuk, Look back this again, is it possible that pdst is writebacking in below race condition? or am I missing something? Thread A GC Thread - f2fs_move_file_range - filemap_write_and_wait_range(dst) - gc_data_segment - f2fs_down_write(dst) - move_data_page - set_page_writeback(dst_page) - f2fs_submit_page_write - f2fs_up_write(dst) - f2fs_down_write(dst) - __exchange_data_block - __clone_blkaddrs - f2fs_get_new_data_page - memcpy_page Thanks,