Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1268634
| Path | csiph.com!goblin3!goblin1!goblin.stu.neva.ru!news.panservice.it!diesel.cu.mi.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Rajat Jain <rajatxjain@gmail.com> |
| Newsgroups | linux.kernel |
| Subject | Anonymous inode cleanup? |
| Date | Fri, 13 Nov 2015 06:50:02 +0100 |
| Message-ID | <qufpg-2lu-3@gated-at.bofh.it> (permalink) |
| X-Original-To | linux-fsdevel@vger.kernel.org, Alexander Viro <viro@zeniv.linux.org.uk>, Davide Libenzi <davidel@xmailserver.org> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:date:message-id:subject:from:to:cc :content-type; bh=9wWwTnjEfUttGYWMgd6XxO6dia1XLO7lhYtaB4fSM2o=; b=dkIQMmncbe2z4k6LUQcfAQo8U9WIhLSSNzADuWr7hw5Vjw+MxQdCmSfYJzjOVOwaei RwIK920Ovs8uyL5bbL5uXLjidGUgAbke7iz7ElFY1mkzE7E+hJF3z8kQh1s7aw7zT9rC iW/xnvuO7FWMNiMAIP1bbwGE71LATaSfI8cdab4HdLZOSDJ3/obssD3DtiKVhNaAp9gA eJzDpZDm1wfd3a1OEN27HFMa9mc5try5vIyQeoZjYFWNoSO7qDSIaosUXZPY6Tur6msd CIYjN632sEpVC4+L56VsDCMVllQeqH2AHKOL7E9vRXBeuLrzf7CFZhMlMNq4MoJvRQ/O tJaw== |
| MIME-Version | 1.0 |
| X-Received | by 10.182.1.235 with SMTP id 11mr11350084obp.19.1447393380216; Thu, 12 Nov 2015 21:43:00 -0800 (PST) |
| Reply-To | rajatxjain@gmail.com |
| Content-Type | text/plain; charset=UTF-8 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 34 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org> |
| X-Original-Date | Thu, 12 Nov 2015 21:43:00 -0800 |
| X-Original-Message-ID | <CAA93t1pFoXnpcCry5VV6_ZceBg9JYSr+kWfc7ztK0iAjp+_rBA@mail.gmail.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1268634 |
Show key headers only | View raw
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
Anonymous inode cleanup? Rajat Jain <rajatxjain@gmail.com> - 2015-11-13 06:50 +0100 Re: Anonymous inode cleanup? Mateusz Guzik <mguzik@redhat.com> - 2015-11-13 07:00 +0100 Re: Anonymous inode cleanup? Al Viro <viro@ZenIV.linux.org.uk> - 2015-11-13 07:40 +0100
csiph-web