[Ocfs2-devel] [PATCH 3/3] ocfs2: drop and retake orphan_dir.i_mutex in ocfs2_recover_orphans
Wengang Wang
wen.gang.wang at oracle.com
Thu Jul 7 20:54:37 PDT 2011
On 11-07-08 10:28, Wengang Wang wrote:
> On 11-07-07 14:48, Sunil Mushran wrote:
> > This is too hacky for mainline. May work as a temp fix only.
<snip>
> > > trace_ocfs2_recover_orphans(slot);
> > >
> > >+cnt_scan:
> > > ocfs2_mark_recovering_orphan_dir(osb, slot);
> > >- ret = ocfs2_queue_orphans(osb, slot,&inode);
> > >+ ret = ocfs2_queue_orphans(osb, slot,&inode,&pos);
> > > ocfs2_clear_recovering_orphan_dir(osb, slot);
> >
> > The slot is being marked and cleared multiple times. I am unsure what the
> > ramifications are, but it does not look right.
>
> I will look at this more...
Per my understand, ocfs2_mark_recovering_orphan_dir() is used to avoid
dead lock only.
ABBA lock.
A: inode lock(cluster lock) on inode to delete
B: inode lock on orphan_dir inode
the ocfs2_delete_inode() path takes in AB.
the ocfs2_recover_orphans() path takes in BA on a different node.
Since AB are both required and then released within ocfs2_queue_orphans(), calling
ocfs2_mark_recovering_orphan_dir() multiple times is not a problem.
Opition?
thanks,
wengang.
More information about the Ocfs2-devel
mailing list