From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dongsheng Yang Subject: Re: [RFC PATCH 00/25] Add quota supporting in ubifs Date: Wed, 22 Jul 2015 08:58:47 +0800 Message-ID: <55AEEAC7.9080307@cn.fujitsu.com> References: <1437467876-22106-1-git-send-email-yangds.fnst@cn.fujitsu.com> <55AEB685.9030904@nod.at> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-15"; format=flowed Content-Transfer-Encoding: 7bit Cc: , To: Richard Weinberger , , Return-path: Received: from cn.fujitsu.com ([59.151.112.132]:42446 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S964833AbbGVBEP (ORCPT ); Tue, 21 Jul 2015 21:04:15 -0400 In-Reply-To: <55AEB685.9030904@nod.at> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 07/22/2015 05:15 AM, Richard Weinberger wrote: > Am 21.07.2015 um 10:37 schrieb Dongsheng Yang: >> Hi Atem, Richard and others, >> This is a patchset to add quota supporting in ubifs. >> [1/25] - [7/25] are working to make quotactl to support filesystems >> which are running on char device. >> >> Others are about making ubifs to support quota >> Please help to review or test it. Any comment is welcome :). >> >> Hi Jan Kara, >> I am not sure I am using the quota APIs correctly, please >> help to correct me if I am wrong. >> >> Also you can get the code from: >> https://github.com/yangdongsheng/linux.git ubifs_quota_v1 >> >> My simple testing is shown as below: > > I get this lockdep splat. Have you seen it too? OMG, could you share the script to trigger it? > > [ 63.779453] > [ 63.779633] ====================================================== > [ 63.780006] [ INFO: possible circular locking dependency detected ] > [ 63.780006] 4.2.0-rc3+ #45 Not tainted > [ 63.780006] ------------------------------------------------------- > [ 63.780006] dd/2668 is trying to acquire lock: > [ 63.780006] (&type->s_umount_key#28){+++++.}, at: [] ubifs_budget_space+0x2c1/0x660 > [ 63.780006] > [ 63.780006] but task is already holding lock: > [ 63.780006] (&sb->s_type->i_mutex_key#12){+.+.+.}, at: [] generic_file_write_iter+0x35/0x1f0 > [ 63.780006] > [ 63.780006] which lock already depends on the new lock. > [ 63.780006] > [ 63.780006] > [ 63.780006] the existing dependency chain (in reverse order) is: > [ 63.780006] > -> #2 (&sb->s_type->i_mutex_key#12){+.+.+.}: > [ 63.780006] [] lock_acquire+0xd3/0x270 > [ 63.780006] [] mutex_lock_nested+0x6b/0x3a0 > [ 63.780006] [] vfs_load_quota_inode+0x4f3/0x560 > [ 63.780006] [] dquot_quota_on+0x53/0x60 > [ 63.780006] [] SyS_quotactl+0x66a/0x890 > [ 63.780006] [] entry_SYSCALL_64_fastpath+0x12/0x6f > [ 63.780006] > -> #1 (&s->s_dquot.dqonoff_mutex){+.+...}: > [ 63.780006] [] lock_acquire+0xd3/0x270 > [ 63.780006] [] mutex_lock_nested+0x6b/0x3a0 > [ 63.780006] [] dquot_writeback_dquots+0x33/0x280 > [ 63.780006] [] ubifs_sync_fs+0x2e/0xb0 > [ 63.780006] [] sync_filesystem+0x74/0xb0 > [ 63.780006] [] generic_shutdown_super+0x2f/0x100 > [ 63.780006] [] kill_anon_super+0x11/0x20 > [ 63.780006] [] kill_ubifs_super+0x15/0x30 > [ 63.780006] [] deactivate_locked_super+0x39/0x70 > [ 63.780006] [] deactivate_super+0x49/0x70 > [ 63.780006] [] cleanup_mnt+0x3e/0x90 > [ 63.780006] [] __cleanup_mnt+0xd/0x10 > [ 63.780006] [] task_work_run+0x88/0xb0 > [ 63.780006] [] do_notify_resume+0x3d/0x50 > [ 63.780006] [] int_signal+0x12/0x17 > [ 63.780006] > -> #0 (&type->s_umount_key#28){+++++.}: > [ 63.780006] [] __lock_acquire+0x1907/0x1ea0 > [ 63.780006] [] lock_acquire+0xd3/0x270 > [ 63.780006] [] down_read+0x4c/0xa0 > [ 63.780006] [] ubifs_budget_space+0x2c1/0x660 > [ 63.780006] [] ubifs_write_begin+0x23d/0x500 > [ 63.780006] [] generic_perform_write+0xaa/0x1a0 > [ 63.780006] [] __generic_file_write_iter+0x183/0x1e0 > [ 63.780006] [] generic_file_write_iter+0xe4/0x1f0 > [ 63.780006] [] ubifs_write_iter+0xc6/0x180 > [ 63.780006] [] __vfs_write+0xa8/0xe0 > [ 63.780006] [] vfs_write+0xa7/0x190 > [ 63.780006] [] SyS_write+0x44/0xa0 > [ 63.780006] [] entry_SYSCALL_64_fastpath+0x12/0x6f > [ 63.780006] > [ 63.780006] other info that might help us debug this: > [ 63.780006] > [ 63.780006] Chain exists of: > &type->s_umount_key#28 --> &s->s_dquot.dqonoff_mutex --> &sb->s_type->i_mutex_key#12 > > [ 63.780006] Possible unsafe locking scenario: > [ 63.780006] > [ 63.780006] CPU0 CPU1 > [ 63.780006] ---- ---- > [ 63.780006] lock(&sb->s_type->i_mutex_key#12); > [ 63.780006] lock(&s->s_dquot.dqonoff_mutex); > [ 63.780006] lock(&sb->s_type->i_mutex_key#12); > [ 63.780006] lock(&type->s_umount_key#28); > [ 63.780006] > [ 63.780006] *** DEADLOCK *** > [ 63.780006] > [ 63.780006] 2 locks held by dd/2668: > [ 63.780006] #0: (sb_writers#8){.+.+.+}, at: [] vfs_write+0x176/0x190 > [ 63.780006] #1: (&sb->s_type->i_mutex_key#12){+.+.+.}, at: [] generic_file_write_iter+0x35/0x1f0 > [ 63.780006] > [ 63.780006] stack backtrace: > [ 63.780006] CPU: 2 PID: 2668 Comm: dd Not tainted 4.2.0-rc3+ #45 > [ 63.780006] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.7.5-0-ge51488c-20140816_022509-build35 04/01/2014 > [ 63.780006] ffffffff829ef340 ffff880000037988 ffffffff819c4998 0000000000000000 > [ 63.780006] ffffffff829f6f40 ffff8800000379d8 ffffffff819c0647 0000000000000002 > [ 63.780006] ffff880000037a28 ffff8800000379d8 ffff8800798b97c0 ffff8800798b9fd8 > [ 63.780006] Call Trace: > [ 63.780006] [] dump_stack+0x4c/0x65 > [ 63.780006] [] print_circular_bug+0x202/0x213 > [ 63.780006] [] __lock_acquire+0x1907/0x1ea0 > [ 63.780006] [] lock_acquire+0xd3/0x270 > [ 63.780006] [] ? ubifs_budget_space+0x2c1/0x660 > [ 63.780006] [] down_read+0x4c/0xa0 > [ 63.780006] [] ? ubifs_budget_space+0x2c1/0x660 > [ 63.780006] [] ? _raw_spin_unlock+0x26/0x40 > [ 63.780006] [] ubifs_budget_space+0x2c1/0x660 > [ 63.780006] [] ? __mutex_unlock_slowpath+0xab/0x160 > [ 63.780006] [] ubifs_write_begin+0x23d/0x500 > [ 63.780006] [] generic_perform_write+0xaa/0x1a0 > [ 63.780006] [] __generic_file_write_iter+0x183/0x1e0 > [ 63.780006] [] generic_file_write_iter+0xe4/0x1f0 > [ 63.780006] [] ubifs_write_iter+0xc6/0x180 > [ 63.780006] [] __vfs_write+0xa8/0xe0 > [ 63.780006] [] vfs_write+0xa7/0x190 > [ 63.780006] [] SyS_write+0x44/0xa0 > [ 63.780006] [] entry_SYSCALL_64_fastpath+0x12/0x6f > > Thanks, > //richard > . >