Re: [RFC] persistent store (version 3) (part 1 of 2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux