Received: by 10.213.65.68 with SMTP id h4csp1207124imn; Sun, 18 Mar 2018 19:37:41 -0700 (PDT) X-Google-Smtp-Source: AG47ELstQ1v2Y0QKKg2mc4l4PHjFZ87JmBUxH+9TanvabxrhfpIDi8kd/L6JCXfw0IEL8cbhFzEK X-Received: by 2002:a17:902:7482:: with SMTP id h2-v6mr10891766pll.264.1521427061253; Sun, 18 Mar 2018 19:37:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521427061; cv=none; d=google.com; s=arc-20160816; b=lUTOAFjLomChaqkXAZxGQyM9q0frqweAXOs19mnZ7ryUwQm7fkxxrOuXjwLOuwSH01 18XB3cEVANef6tSLU8b+Hbyx1QEjbvuR0mB98P2l9A/Pp8KQbYau8lC625HVIAP3Bcs4 N7zDP74/h1eX5uGnK9oGDhaw2XtP3zc1tM3OOCg/B8u+xxUnXtckN3JYlDBD8ZMaqqnR YZScCMpHT5x+fOkcFQWEJ+6vQ3SdEYYdyDXS8hRErJy4fVOQ/ewerpz1pkaLChvAxm9m glJvzEurGwU18JF11TjcHEXNNF0sM9Rly/j8rdRsx1SJSON/yZ72DZZW7+aU0ky9Vr3H vQ5w== 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:arc-authentication-results; bh=BdSVW7EG49Wv6pHg/Cfa+PVp/z8rjSnqGbN0bYWfgAg=; b=iTPX1TeAxz7JF62S49HOb/a3rSa02zW+TRn9p0bbCna/habX3KgrNKJx8AR7QVj/eW rmC5Av4pwFLqIl7b/ymYArLbZ63Y/5Uk7CCxI6p/CJ8B+OUIF6WzxSwargynvscQGV2i qLvcAY8jNSUAMxi6cBWPM3+gZfXQjqNB6tTime+0HTU0dBGNnuoFLqotu5Etq7wCP+jL Yh1P+WvIKgrBhbj91/jKc0nJXCxEY/YX2HhXzxE/7Px46y9xlqrLmNcxLpQ7bkC564fW xDyCLvg6Z36oT9AFBd7omUWUGjPfcSy9P9hboCniNJnqPbywn+s2ZFyFv23xML5K1zi5 qjwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g8-v6si2220411plt.235.2018.03.18.19.37.27; Sun, 18 Mar 2018 19:37:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754923AbeCSCgd (ORCPT + 99 others); Sun, 18 Mar 2018 22:36:33 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:52843 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1754531AbeCSCgb (ORCPT ); Sun, 18 Mar 2018 22:36:31 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id D240C8659E3CD; Mon, 19 Mar 2018 10:36:28 +0800 (CST) Received: from [127.0.0.1] (10.134.22.195) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.361.1; Mon, 19 Mar 2018 10:36:25 +0800 Subject: Re: [PATCH] f2fs: Set GF_NOFS in read_cache_page_gfp while doing f2fs_quota_read To: Ritesh Harjani , , , CC: References: <1521206633-21378-1-git-send-email-riteshh@codeaurora.org> <1521206633-21378-2-git-send-email-riteshh@codeaurora.org> From: Chao Yu Message-ID: <173fc1c2-bc17-2167-cfda-3217fff8789f@huawei.com> Date: Mon, 19 Mar 2018 10:36:26 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <1521206633-21378-2-git-send-email-riteshh@codeaurora.org> 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 2018/3/16 21:23, Ritesh Harjani wrote: > Quota code itself is serializing the operations by taking mutex_lock. > It seems a below deadlock can happen if GF_NOFS is not used in > f2fs_quota_read > > __switch_to+0x88 > __schedule+0x5b0 > schedule+0x78 > schedule_preempt_disabled+0x20 > __mutex_lock_slowpath+0xdc //mutex owner is itself > mutex_lock+0x2c > dquot_commit+0x30 //mutex_lock(&dqopt->dqio_mutex); > dqput+0xe0 > __dquot_drop+0x80 > dquot_drop+0x48 > f2fs_evict_inode+0x218 > evict+0xa8 > dispose_list+0x3c > prune_icache_sb+0x58 > super_cache_scan+0xf4 > do_shrink_slab+0x208 > shrink_slab.part.40+0xac > shrink_zone+0x1b0 > do_try_to_free_pages+0x25c > try_to_free_pages+0x164 > __alloc_pages_nodemask+0x534 > do_read_cache_page+0x6c > read_cache_page+0x14 > f2fs_quota_read+0xa4 > read_blk+0x54 > find_tree_dqentry+0xe4 > find_tree_dqentry+0xb8 > find_tree_dqentry+0xb8 > find_tree_dqentry+0xb8 > qtree_read_dquot+0x68 > v2_read_dquot+0x24 > dquot_acquire+0x5c // mutex_lock(&dqopt->dqio_mutex); > dqget+0x238 > __dquot_initialize+0xd4 > dquot_initialize+0x10 > dquot_file_open+0x34 > f2fs_file_open+0x6c > do_dentry_open+0x1e4 > vfs_open+0x6c > path_openat+0xa20 > do_filp_open+0x4c > do_sys_open+0x178 > > Signed-off-by: Ritesh Harjani Reviewed-by: Chao Yu Thanks,