reiserfs: only call unlock_new_inode() if I_NEW
[sfrench/cifs-2.6.git] / fs / reiserfs / inode.c
index 1509775da040a0e05158ff7ee289c84f6cee11e2..e3af44c61524d1ad0d5b742301658465b9323201 100644 (file)
@@ -2163,7 +2163,8 @@ out_end_trans:
 out_inserted_sd:
        clear_nlink(inode);
        th->t_trans_id = 0;     /* so the caller can't use this handle later */
-       unlock_new_inode(inode); /* OK to do even if we hadn't locked it */
+       if (inode->i_state & I_NEW)
+               unlock_new_inode(inode);
        iput(inode);
        return err;
 }