On Thu, Dec 9, 2010 at 5:14 AM, Borislav Petkov <bp@xxxxxxxxx> wrote: >> if (!pstore_writefile(inode, dentry, data, size)) { >> inode->i_nlink--; >> mutex_lock(&root->d_inode->i_mutex); >> d_delete(dentry); >> dput(dentry); >> mutex_unlock(&root->d_inode->i_mutex); >> rc = -ENOSPC; >> goto fail; >> } > > don't we have to iput() the inode here too if pstore_writefile() fails? No. d_delete() called iput() for us (passing through dentry_iput along the way) - so we must not do it again. This upsets the traditional layout of having the error recovery part of the function undo all the things that we did leading up to the error. Pity, because your version is easier to read. -Tony -- To unsubscribe from this list: send the line "unsubscribe linux-arch" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html