Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Wed, 22 Jan 2003 15:56:49 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Wed, 22 Jan 2003 15:56:49 -0500 Received: from nat-pool-rdu.redhat.com ([66.187.233.200]:36376 "EHLO devserv.devel.redhat.com") by vger.kernel.org with ESMTP id ; Wed, 22 Jan 2003 15:56:47 -0500 Date: Wed, 22 Jan 2003 16:05:55 -0500 From: Pete Zaitcev Message-Id: <200301222105.h0ML5t719018@devserv.devel.redhat.com> To: Andrew Morton cc: linux-kernel@vger.kernel.org Subject: Re: why isn't quota dependant on ext2? In-Reply-To: References: <20030121185927.3abd9298.akpm@digeo.com> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org >> > ext3, ufs and udf also use the core quota code. >> >> The documentation says it only works with ext2 where would I find working >> utilities to get it working on ext3 ? > > ext3 uses the same tools as ext2 - checkquota, quotaon, etc. > > http://quota-tools.sourceforge.net/ (site seems to be broken) The bad news is that quota on ext3 is virtually guaranteed to deadlock, so you can do it, but you do not want to do it. The original memo describes a deadlock in RH 2.4.18-5, which I assure you, was NOT fixed in Marcelo 2.4.20. A good anti-deadlock work was done, granted, but this particular one wasn't fixed. -- Pete --------------------------------------------------------- Date: Mon, 21 Oct 2002 20:20:19 -0400 From: Pete Zaitcev Subject: Deadlock in jbd A customer [@ Chicagolinux] had his box hanging with 2.4.18-5, as described in Issue 4561, Bug 71379. SysRq-T trace looks like this: kjournald D DD99A000 0 197 1 956 196 (L-TLB) Call Trace: [] sleep_on [kernel] 0x4b [] journal_commit_transaction [jbd] 0x15e [] ip_rcv [kernel] 0x39d [] kjournald [jbd] 0x136 [] commit_timeout [jbd] 0x0 [] kernel_thread [kernel] 0x26 [] kjournald [jbd] 0x0 popper D CEED5C00 0 4819 1104 4820 4807 (NOTLB) Call Trace: [] __down [kernel] 0x69 [] __down_failed [kernel] 0x8 [] .text.lock.dquot [kernel] 0x2d [] dqget [kernel] 0x15f [] do_get_write_access [jbd] 0x568 [] dquot_initialize [kernel] 0xa6 [] ext3_new_inode [ext3] 0x8d9 [] .rodata.str1.1 [jbd] 0x30 [] __jbd_kmalloc [jbd] 0x27 [] start_this_handle [jbd] 0x124 [] journal_start_Rsmp_89deb980 [jbd] 0xbd [] ext3_create [ext3] 0x81 [] vfs_create [kernel] 0x130 [] lookup_hash [kernel] 0x4a [] open_namei [kernel] 0x13c [] timer_bh [kernel] 0x39 [] filp_open [kernel] 0x36 [] sys_open [kernel] 0x34 [] system_call [kernel] 0x33 kswapd D DC0094A0 4128 7 1 8 6 (L-TLB) Call Trace: [] sleep_on [kernel] 0x4b <--- locked by pid 197 [] start_this_handle [jbd] 0xc5 [] journal_start_Rsmp_89deb980 [jbd] 0xbd [] ext3_dirty_inode [ext3] 0x6e [] __alloc_pages [kernel] 0xa8 <--- spurious (on stack) [] __mark_inode_dirty [kernel] 0x2e [] generic_file_write [kernel] 0x34d [] ext3_file_write [ext3] 0x22 [] write_dquot [kernel] 0xbb [] dqput [kernel] 0x8c [] dquot_drop [kernel] 0x3b [] clear_inode [kernel] 0xce [] destroy_inode [kernel] 0x2d [] dispose_list [kernel] 0x5c [] prune_icache [kernel] 0x143 [] shrink_icache_memory [kernel] 0x20 [] do_try_to_free_pages [kernel] 0x26 [] kswapd [kernel] 0x101 [] stext [kernel] 0x0 [] kernel_thread [kernel] 0x26 [] kswapd [kernel] 0x0 I reconstruct the sequence in the following way. The kswapd does its trick and does the dquot_drop on some inode, taking a quota semaphore, and manages to sleep somewhere a little (not exactly sure where, perhaps writing a page out or something...). Next, popper goes about ext3_create, does journal_start (we can even see a leftover part of that sequence on its stack, no need to guess!), and locks trying to grab the quote semaphore. Essentially, it sleeps with ->t_updates incremented, and this is where the trouble starts. kjournald is awaken, locks the current transaction with T_LOCKED and waits for updates to drop (held by popper). To top things off, the kswapd awakens or otherwise comes around and does journal_start, which promptly blocks, because current t_state is T_LOCKED. Now we have three processes, all locked together to form a deadlock, which is kinda cute. --------------------------------------------------------- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/