linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Anonymous inode cleanup?
@ 2015-11-13  5:43 Rajat Jain
  2015-11-13  5:52 ` Mateusz Guzik
  2015-11-13  6:31 ` Al Viro
  0 siblings, 2 replies; 8+ messages in thread
From: Rajat Jain @ 2015-11-13  5:43 UTC (permalink / raw)
  To: linux-fsdevel, Alexander Viro, Davide Libenzi
  Cc: linux-kernel@vger.kernel.org

Hello,

I'm writing a module that wants to get anonymous fd [using
anon_inode_getfd()] and my code looks like this:

fd = anon_inode_getfd(...)
if (fd < 0)
    return -EINVAL;

if (foobar_fail()) {
    /* undo everything */
    return -EINVAL;
}

My question is that in case of a failure after the anon_inode_getfd(),
I want to cleanup and undo whatever needs to be done w.r.t. anodnymous
fd I just allocated. (May be put a reference, or return the fd to the
free pool or whatever). Can some one please let me know what cleanup
needs to be done?

However neither I see a cleanup function, nor I see any of the drivers
attempting
to free the fd in case of failure.

Thanks,

Thanks,

Rajat

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-11-18 21:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-13  5:43 Anonymous inode cleanup? Rajat Jain
2015-11-13  5:52 ` Mateusz Guzik
2015-11-13  6:31 ` Al Viro
2015-11-18 20:28   ` Rajat Jain
2015-11-18 21:06     ` Al Viro
2015-11-18 21:10       ` Rajat Jain
2015-11-18 21:24         ` Al Viro
2015-11-18 21:25           ` Rajat Jain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).