From: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
To: Richard Weinberger <richard@nod.at>, <dedekind1@gmail.com>,
<jack@suse.com>
Cc: <linux-fsdevel@vger.kernel.org>, <linux-mtd@lists.infradead.org>
Subject: Re: [RFC PATCH 00/25] Add quota supporting in ubifs
Date: Wed, 22 Jul 2015 08:58:47 +0800 [thread overview]
Message-ID: <55AEEAC7.9080307@cn.fujitsu.com> (raw)
In-Reply-To: <55AEB685.9030904@nod.at>
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: [<ffffffff81306031>] 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: [<ffffffff811434c5>] 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] [<ffffffff810a2103>] lock_acquire+0xd3/0x270
> [ 63.780006] [<ffffffff819cee7b>] mutex_lock_nested+0x6b/0x3a0
> [ 63.780006] [<ffffffff81202d23>] vfs_load_quota_inode+0x4f3/0x560
> [ 63.780006] [<ffffffff81203203>] dquot_quota_on+0x53/0x60
> [ 63.780006] [<ffffffff8120786a>] SyS_quotactl+0x66a/0x890
> [ 63.780006] [<ffffffff819d2d57>] entry_SYSCALL_64_fastpath+0x12/0x6f
> [ 63.780006]
> -> #1 (&s->s_dquot.dqonoff_mutex){+.+...}:
> [ 63.780006] [<ffffffff810a2103>] lock_acquire+0xd3/0x270
> [ 63.780006] [<ffffffff819cee7b>] mutex_lock_nested+0x6b/0x3a0
> [ 63.780006] [<ffffffff81203603>] dquot_writeback_dquots+0x33/0x280
> [ 63.780006] [<ffffffff812f2e3e>] ubifs_sync_fs+0x2e/0xb0
> [ 63.780006] [<ffffffff811d0d54>] sync_filesystem+0x74/0xb0
> [ 63.780006] [<ffffffff8119cf5f>] generic_shutdown_super+0x2f/0x100
> [ 63.780006] [<ffffffff8119d281>] kill_anon_super+0x11/0x20
> [ 63.780006] [<ffffffff812f22d5>] kill_ubifs_super+0x15/0x30
> [ 63.780006] [<ffffffff8119d709>] deactivate_locked_super+0x39/0x70
> [ 63.780006] [<ffffffff8119deb9>] deactivate_super+0x49/0x70
> [ 63.780006] [<ffffffff811bcb4e>] cleanup_mnt+0x3e/0x90
> [ 63.780006] [<ffffffff811bcbed>] __cleanup_mnt+0xd/0x10
> [ 63.780006] [<ffffffff81076258>] task_work_run+0x88/0xb0
> [ 63.780006] [<ffffffff81003abd>] do_notify_resume+0x3d/0x50
> [ 63.780006] [<ffffffff819d2f2c>] int_signal+0x12/0x17
> [ 63.780006]
> -> #0 (&type->s_umount_key#28){+++++.}:
> [ 63.780006] [<ffffffff810a1a17>] __lock_acquire+0x1907/0x1ea0
> [ 63.780006] [<ffffffff810a2103>] lock_acquire+0xd3/0x270
> [ 63.780006] [<ffffffff819d03cc>] down_read+0x4c/0xa0
> [ 63.780006] [<ffffffff81306031>] ubifs_budget_space+0x2c1/0x660
> [ 63.780006] [<ffffffff812eef5d>] ubifs_write_begin+0x23d/0x500
> [ 63.780006] [<ffffffff81140bda>] generic_perform_write+0xaa/0x1a0
> [ 63.780006] [<ffffffff81143433>] __generic_file_write_iter+0x183/0x1e0
> [ 63.780006] [<ffffffff81143574>] generic_file_write_iter+0xe4/0x1f0
> [ 63.780006] [<ffffffff812eda96>] ubifs_write_iter+0xc6/0x180
> [ 63.780006] [<ffffffff8119a958>] __vfs_write+0xa8/0xe0
> [ 63.780006] [<ffffffff8119afb7>] vfs_write+0xa7/0x190
> [ 63.780006] [<ffffffff8119bcf4>] SyS_write+0x44/0xa0
> [ 63.780006] [<ffffffff819d2d57>] 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: [<ffffffff8119b086>] vfs_write+0x176/0x190
> [ 63.780006] #1: (&sb->s_type->i_mutex_key#12){+.+.+.}, at: [<ffffffff811434c5>] 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] [<ffffffff819c4998>] dump_stack+0x4c/0x65
> [ 63.780006] [<ffffffff819c0647>] print_circular_bug+0x202/0x213
> [ 63.780006] [<ffffffff810a1a17>] __lock_acquire+0x1907/0x1ea0
> [ 63.780006] [<ffffffff810a2103>] lock_acquire+0xd3/0x270
> [ 63.780006] [<ffffffff81306031>] ? ubifs_budget_space+0x2c1/0x660
> [ 63.780006] [<ffffffff819d03cc>] down_read+0x4c/0xa0
> [ 63.780006] [<ffffffff81306031>] ? ubifs_budget_space+0x2c1/0x660
> [ 63.780006] [<ffffffff819d23c6>] ? _raw_spin_unlock+0x26/0x40
> [ 63.780006] [<ffffffff81306031>] ubifs_budget_space+0x2c1/0x660
> [ 63.780006] [<ffffffff819cf25b>] ? __mutex_unlock_slowpath+0xab/0x160
> [ 63.780006] [<ffffffff812eef5d>] ubifs_write_begin+0x23d/0x500
> [ 63.780006] [<ffffffff81140bda>] generic_perform_write+0xaa/0x1a0
> [ 63.780006] [<ffffffff81143433>] __generic_file_write_iter+0x183/0x1e0
> [ 63.780006] [<ffffffff81143574>] generic_file_write_iter+0xe4/0x1f0
> [ 63.780006] [<ffffffff812eda96>] ubifs_write_iter+0xc6/0x180
> [ 63.780006] [<ffffffff8119a958>] __vfs_write+0xa8/0xe0
> [ 63.780006] [<ffffffff8119afb7>] vfs_write+0xa7/0x190
> [ 63.780006] [<ffffffff8119bcf4>] SyS_write+0x44/0xa0
> [ 63.780006] [<ffffffff819d2d57>] entry_SYSCALL_64_fastpath+0x12/0x6f
>
> Thanks,
> //richard
> .
>
next prev parent reply other threads:[~2015-07-22 1:04 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-21 8:37 [RFC PATCH 00/25] Add quota supporting in ubifs Dongsheng Yang
2015-07-21 8:37 ` [PATCH 01/25] fs: introduce a ->s_cdev field into struct super_block Dongsheng Yang
2015-07-21 8:37 ` [PATCH 02/25] ubi: introduce a interface to get cdev in ubi_volume Dongsheng Yang
2015-07-21 8:37 ` [PATCH 03/25] ubifs: fill sb->s_cdev in ubifs_fill_super() Dongsheng Yang
2015-07-21 8:37 ` [PATCH 04/25] fs: super: introduce the functions to get super by cdev reference Dongsheng Yang
2015-07-21 9:04 ` Jan Kara
2015-07-22 0:37 ` Dongsheng Yang
2015-07-21 8:37 ` [PATCH 05/25] fs: char_dev: introduce lookup_cdev function to find cdev by name Dongsheng Yang
2015-07-21 9:20 ` Jan Kara
2015-07-21 8:37 ` [PATCH 06/25] fs: dquot: skip invalidate_bdev if bdev is NULL Dongsheng Yang
2015-07-21 8:37 ` [PATCH 07/25] fs: quota: make quota support fs which is running on char dev Dongsheng Yang
2015-07-21 8:37 ` [PATCH 08/25] ubifs: fix a typo in comment of ubifs_budget_req Dongsheng Yang
2015-07-21 8:37 ` [PATCH 09/25] ubifs: extend budget for blocks Dongsheng Yang
2015-07-21 8:37 ` [PATCH 10/25] ubifs: fill ->s_dev in ubifs_fill_super Dongsheng Yang
2015-07-21 8:37 ` [PATCH 11/25] ubifs: export read_block() from file.c Dongsheng Yang
2015-07-21 20:36 ` Richard Weinberger
2015-07-22 0:41 ` Dongsheng Yang
2015-07-21 8:37 ` [PATCH 12/25] ubifs: introduce quota related mount options Dongsheng Yang
2015-07-21 20:39 ` Richard Weinberger
2015-07-22 0:41 ` Dongsheng Yang
2015-07-21 8:37 ` [PATCH 13/25] ubifs: introduce a field named as budgeted to ubifs_inode Dongsheng Yang
2015-07-21 20:47 ` Richard Weinberger
2015-07-22 0:56 ` Dongsheng Yang
2015-07-22 6:22 ` Dongsheng Yang
2015-07-21 8:37 ` [PATCH 14/25] ubifs: implement IO functions for quota files Dongsheng Yang
2015-07-21 8:37 ` [PATCH 15/25] ubifs: disable quota in ubifs_put_super Dongsheng Yang
2015-07-21 8:37 ` [PATCH 16/25] ubifs: write quota back in ubifs_sync Dongsheng Yang
2015-07-21 8:37 ` [PATCH 17/25] ubifs: suspend & resume quota properly in ubifs_remount Dongsheng Yang
2015-07-21 8:37 ` [PATCH 18/25] ubifs: record quota information about inode in ubifs_new_inode Dongsheng Yang
2015-07-21 8:37 ` [PATCH 19/25] ubifs: free quota inode information in ubifs_evict_inode Dongsheng Yang
2015-07-21 8:37 ` [PATCH 20/25] ubifs: alloc quota space in ubifs_write_begin Dongsheng Yang
2015-07-21 8:37 ` [PATCH 21/25] ubifs: free quota space in do_truncation and unlink Dongsheng Yang
2015-07-21 8:37 ` [PATCH 22/25] ubifs: adapt quota space informatin in do_setattr Dongsheng Yang
2015-07-21 8:37 ` [PATCH 23/25] ubifs: transfer quota information in changing owner or group Dongsheng Yang
2015-07-21 8:37 ` [PATCH 24/25] ubifs: implement ubifs_qctl_operations for quotactl Dongsheng Yang
2015-07-21 8:37 ` [PATCH 25/25] ubifs: make ubifs to support quota Dongsheng Yang
2015-07-21 8:58 ` [RFC PATCH 00/25] Add quota supporting in ubifs Jan Kara
2015-07-22 0:56 ` Dongsheng Yang
2015-07-21 20:50 ` Richard Weinberger
2015-07-22 1:11 ` Dongsheng Yang
2015-07-21 21:01 ` Richard Weinberger
2015-07-22 0:58 ` Dongsheng Yang
2015-07-21 21:15 ` Richard Weinberger
2015-07-22 0:58 ` Dongsheng Yang [this message]
2015-07-22 6:58 ` Richard Weinberger
2015-07-22 11:23 ` Dongsheng Yang
2015-07-22 14:13 ` Jan Kara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55AEEAC7.9080307@cn.fujitsu.com \
--to=yangds.fnst@cn.fujitsu.com \
--cc=dedekind1@gmail.com \
--cc=jack@suse.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=richard@nod.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).