All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joseph Qi via Ocfs2-devel <ocfs2-devel@oss.oracle.com>
To: Junxiao Bi <junxiao.bi@oracle.com>, ocfs2-devel@oss.oracle.com
Subject: Re: [Ocfs2-devel] [PATCH 1/2] ocfs2: dlmfs: not clear USER_LOCK_ATTACHED when destroy lock
Date: Wed, 18 May 2022 09:54:27 +0800	[thread overview]
Message-ID: <0277d743-1e03-89f5-38ec-1b833e8f5e43@linux.alibaba.com> (raw)
In-Reply-To: <e3daeccc-823a-665e-7068-4001114e7d36@oracle.com>



On 5/18/22 12:12 AM, Junxiao Bi wrote:
> 
> On 5/16/22 6:58 PM, Joseph Qi wrote:
>>
>> On 5/17/22 12:30 AM, Junxiao Bi wrote:
>>> On 5/15/22 7:57 AM, Joseph Qi wrote:
>>>> On 5/14/22 12:27 AM, Junxiao Bi wrote:
>>>>> On 5/12/22 7:05 PM, Joseph Qi wrote:
>>>>>
>>>>>> On 5/11/22 7:22 AM, Junxiao Bi wrote:
>>>>>>> The following function is the only place that check USER_LOCK_ATTACHED,
>>>>>>> this flag is set when lock request is granted through user_bast() and
>>>>>>> only the following function will clear it.
>>>>>>>
>>>>>> user_ast?
>>>>> Good catch, that's a typo, should be user_ast.
>>>>>>> Checking of this flag here is to make sure ocfs2_dlm_unlock is not
>>>>>>> issued if this lock is never granted. For example, lock file is created
>>>>>>> and then get removed, open file never happens.
>>>>>>>
>>>>>>> Clearing the flag here is not necessary because this is the only function
>>>>>>> that checks it, if another flow is executing user_dlm_destroy_lock(), it
>>>>>>> will bail out at the beginning because of USER_LOCK_IN_TEARDOWN and never
>>>>>>> check USER_LOCK_ATTACHED.
>>>>>>> Drop the clear, so we don't need take care it for the following
>>>>>>> error handling patch.
>>>>>>>
>>>>>> Seems it depends on initializing lockres every time, but it seems this
>>>>>> is not true for directory now.
>>>>> Sorry, i didn't get this. Can you elaborate this?
>>>>>
>>>> lockres may be reused and if we don't reinitialized, the left flag can
>>>> cause unexpected behavior.
>>> I don't know how it could get reused since it's going to be removed. Anyway USER_LOCK_IN_TEARDOWN is still set in lockres. All the flow will bail out because of this flag.
>>>
>> dlmfs_inode_private is allocated from kmem_cache.
>> The case I'm thinking about is, calling user_dlm_destroy_lock() without
>> a valid ast comming before. So checking USER_LOCK_ATTACHED here may be
>> incorrect.
>> But look more closer, it seems that lockres is unused for directories.
>> So it won't be a real issue.
> Yes, lock is only for file, not direcotry.
>> Could you please send a new version with update description?
> 
> Sorry, little confused, which part of description needs update?
> 

The typo that user_ast() is for granting lock request. And better to include
the information we discussed above.

_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel

  reply	other threads:[~2022-05-18  1:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-10 23:22 [Ocfs2-devel] [PATCH 1/2] ocfs2: dlmfs: not clear USER_LOCK_ATTACHED when destroy lock Junxiao Bi via Ocfs2-devel
2022-05-10 23:22 ` [Ocfs2-devel] [PATCH 2/2] ocfs2: dlmfs: fix error handling of user_dlm_destroy_lock Junxiao Bi via Ocfs2-devel
2022-05-13  2:05 ` [Ocfs2-devel] [PATCH 1/2] ocfs2: dlmfs: not clear USER_LOCK_ATTACHED when destroy lock Joseph Qi via Ocfs2-devel
2022-05-13 16:27   ` Junxiao Bi via Ocfs2-devel
2022-05-15 14:57     ` Joseph Qi via Ocfs2-devel
2022-05-16 16:30       ` Junxiao Bi via Ocfs2-devel
2022-05-17  1:58         ` Joseph Qi via Ocfs2-devel
2022-05-17 16:12           ` Junxiao Bi via Ocfs2-devel
2022-05-18  1:54             ` Joseph Qi via Ocfs2-devel [this message]
2022-05-18 15:54               ` Junxiao Bi via Ocfs2-devel

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=0277d743-1e03-89f5-38ec-1b833e8f5e43@linux.alibaba.com \
    --to=ocfs2-devel@oss.oracle.com \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=junxiao.bi@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.