mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jan Kiszka" <jan.kiszka@googlemail.com>
To: linux-kernel@vger.kernel.org
Subject: safe usage of remove_proc_entry and proc_entry->data
Date: Fri, 31 Mar 2006 18:10:23 +0200	[thread overview]
Message-ID: <58d0dbf10603310810i52183e5bob5c51d4337ce5c8e@mail.gmail.com> (raw)

Hi,

I just wondered (after using this for years...) what the safe usage of
remove_proc_entry() is when I've registered a dynamic data object with
the proc-entry during creation. I'm creating and deleting proc entries
dynamically, not on module insertion/removal.

What is the clean way to synchronise e.g. an ongoing proc read request
on that entry and its access to the embedded data object vs. the
deregistration and later release of the data object?
remove_proc_entry() is non-blocking and does unfortunately not return
any error in case the deletion is deferred.

In the procfs-guide, I read that I should "free the data entry from
the struct proc_dir_entry *before* [calling] remove_proc_entry()".
Doesn't parse for me so far (how should this help?), and I failed to
find a pattern for this in existing kernel code. Any hints welcome!

Thanks in advance,
Jan

                 reply	other threads:[~2006-03-31 16:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58d0dbf10603310810i52183e5bob5c51d4337ce5c8e@mail.gmail.com \
    --to=jan.kiszka@googlemail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®