On 17.04.19 г. 5:23 ч., Pan Bian wrote: > The reference count of inode is incremented by ihold. It should be > dropped if not used. However, the reference count is not dropped if > error occurs during updating the inode or deleting orphan items. This > patch fixes the bug. > > Signed-off-by: Pan Bian The extra reference count taken is needed for the call to d_instantiate, while this operation is in progress the inode is actually locked. This means it will be a lot clearer if ihold is done right before d_instantiate and they are moved at the end of the function where we are sure no errors have appened. Something like the attached diff