All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tao Ma <tao.ma@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] ocfs2 quota qs.
Date: Wed, 29 Jul 2009 22:29:17 +0800	[thread overview]
Message-ID: <4A705CBD.4050706@oracle.com> (raw)
In-Reply-To: <20090729103741.GG19209@duck.suse.cz>

Jan Kara wrote:
> On Wed 29-07-09 17:04:14, Tao Ma wrote:
>   
>> Hi Jan,
>> 	I am now reading quota support in ocfs2 and have some qs. Wish you can 
>> help me clarify it. Thanks.
>>
>> ocfs2_quota_write:
>> 	In the comment, you said that "we know the transaction is already 
>> started", so it should be called within a transaction. But in this 
>> function, we call ocfs2_extend_no_holes and ocfs2_simple_size_update which 
>> will start another transaction. So we can survive with nested transaction 
>> or this scenario will never happen?
>>     
>   The comment is right, we absolutely require a transaction being started
> when when entering ocfs2_quota_write(), otherwise deadlocks could occur.
>   JBD supports nested transactions - when journal_start() is called and
> the current process already has a transaction open, it just returns the
> currently open transaction. So you only have to be sure to initially ask
> for enough credits when opening the transaction - and quota code hopefully
> gets this right.
>   Hmm, but looking at the code again, there's one catch - normally,
> allocator locks nest outside the transaction and in ocfs2_quota_write()
> they are acquired inside the transaction and that can lead to deadlocks.
> Aw, that's going to be nasty to fix... I have to rethink the locking
> logic...
>   Thanks for your inquiry :)
>   
Thank you for the explanation.

Regards,
Tao

      reply	other threads:[~2009-07-29 14:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-29  9:04 [Ocfs2-devel] ocfs2 quota qs Tao Ma
2009-07-29 10:37 ` Jan Kara
2009-07-29 14:29   ` Tao Ma [this message]

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=4A705CBD.4050706@oracle.com \
    --to=tao.ma@oracle.com \
    --cc=ocfs2-devel@oss.oracle.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.