Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp61283ybm; Wed, 27 May 2020 19:19:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhPnhjVlirdEsQ2UpL9pVJGCx/NmsbdrLuq1yRYe1GLQWweLKLilMJSbGy9f6Hr+FtDZcN X-Received: by 2002:a17:906:f85:: with SMTP id q5mr1043408ejj.344.1590632398404; Wed, 27 May 2020 19:19:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590632398; cv=none; d=google.com; s=arc-20160816; b=Cjys3PW2g2hUgvP0uU6RaJdfvXEfoHZ2spZWeCY0ly9nIinyLwuImWfA8A8HkiG+Uk USuKTcnJaOJdXD6xh4y5YudM1pU0mgnxdR8vKbF5/VgD5ebpUu7MBgpIlSJrpx3HufQu X5D0x6gHZdar6SXC1UwQWws215aeq7s5bdNz/WkaWgQWYfBQqOe2ONiUfzrGtXNmVWPS V/cxQ5MaFT5CGTCisAAW/ggu6fqLPH224oo4OX8rI50CV9NUnhBJ1kcuJaBJxRScgvOL A0JHWMyOczA+wrNBvukSuxnHtWsXKsGjn/Alyqu0+o20CK6UWRZ0YTeJCMammJ5pouwk +sRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=PLRffL/NiSTR5Xqla5It9g3+LmlTJtD08lTCjMaH0XU=; b=sUql42GP2gj5cPiSJIz3/fJeD7DlGVHVP1fLfNY7JBisnOQXNbDx1W9Jtn+Ko8Z95g ckj+HqdKx/t3tWPKf7+GhRlbmfaNMYg5wwrxxL7GekjWgwowoyqw+3mMUs9YUXl4yEd5 6guns5eBDey1oEWU0c5P+C+7D4EfnhCCKlpmvFa95yKWwjZAXWUsbCYFUwcj6hZb/l2o 1318T2YEpnzKcMbUEl/WY+Pa2HXmBG120w6iPV9dBBVgjxtiwXRgoSjjxLJMFoGNivE5 PfKwo1O8TsN/QQVbXO7irmo8SQyEIfg34HyUlLVIPKIUb0eiMGW4aTqi0/MrupuGNsVW RM6A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t10si3018737ejr.589.2020.05.27.19.19.35; Wed, 27 May 2020 19:19:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726878AbgE1CRr (ORCPT + 99 others); Wed, 27 May 2020 22:17:47 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:33656 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726086AbgE1CRr (ORCPT ); Wed, 27 May 2020 22:17:47 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id C900EC4ADDF2B4F880D7; Thu, 28 May 2020 10:17:44 +0800 (CST) Received: from [10.134.22.195] (10.134.22.195) by smtp.huawei.com (10.3.19.206) with Microsoft SMTP Server (TLS) id 14.3.487.0; Thu, 28 May 2020 10:17:42 +0800 Subject: Re: [f2fs-dev] [PATCH] f2fs: protect new segment allocation in expand_inode_data To: Daeho Jeong , , , CC: Daeho Jeong References: <20200527040231.70891-1-daeho43@gmail.com> From: Chao Yu Message-ID: Date: Thu, 28 May 2020 10:17:41 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200527040231.70891-1-daeho43@gmail.com> Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/5/27 12:02, Daeho Jeong wrote: > From: Daeho Jeong > > Found a new segemnt allocation without f2fs_lock_op() in > expand_inode_data(). So, when we do fallocate() for a pinned file > and trigger checkpoint very frequently and simultaneously. F2FS gets > stuck in the below code of do_checkpoint() forever. > > f2fs_sync_meta_pages(sbi, META, LONG_MAX, FS_CP_META_IO); > /* Wait for all dirty meta pages to be submitted for IO */ > <= if fallocate() here, > f2fs_wait_on_all_pages(sbi, F2FS_DIRTY_META); <= it'll wait forever. > > Signed-off-by: Daeho Jeong Reviewed-by: Chao Yu Thanks,