[Ocfs2-devel] [PATCH] ocfs2: the parent directory reference count should be increased only after the ocfs2_add_entry function is successfully called

Joseph Qi joseph.qi at linux.alibaba.com
Mon Mar 16 17:58:31 PDT 2020



On 2020/3/16 15:27, wangjian wrote:
> good suggestion. Can we just move the three statements ocfs2_add_links_count (dirfe, 1),
> ocfs2_journal_dirty (handle, parent_fe_bh), inc_nlink (dir) to the following?
> This seems to be no problem. Or reset the reference count back in case of failure?
> 
IMO, rollback the link modification in error handling may be a better choice.

Thanks,
Joseph



More information about the Ocfs2-devel mailing list