[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTimWT8=fmqbEeb+qXbwsWOmaz5d2_Bsr-=DON7L1@mail.gmail.com>
Date: Thu, 9 Dec 2010 10:23:32 -0800
From: Tony Luck <tony.luck@...el.com>
To: Borislav Petkov <bp@...en8.de>, "Luck, Tony" <tony.luck@...el.com>,
linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
tglx@...utronix.de, mingo@...e.hu, greg@...ah.com,
akpm@...ux-foundation.org, ying.huang@...el.com,
David Miller <davem@...emloft.net>,
Alan Cox <alan@...rguk.ukuu.org.uk>,
Jim Keniston <jkenisto@...ux.vnet.ibm.com>,
Kyungmin Park <kmpark@...radead.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>
Subject: Re: [RFC] persistent store (version 3) (part 1 of 2)
On Thu, Dec 9, 2010 at 5:14 AM, Borislav Petkov <bp@...en8.de> 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-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists