mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Robert P. J. Day" <rpjday@mindspring.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: should "create_proc_read_entry" enforce read-only semantics?
Date: Wed, 30 May 2007 08:17:13 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0705300813150.13465@localhost.localdomain> (raw)


  admittedly more nitpickery, but it strikes me as a bit confusing
that you can use create_proc_read_entry() to create writable proc
files, since that routine is simply a wrapper for create_proc_entry
that passes the mode untouched and unexamined.

  that's why you can get stuff like this from drivers/scsi/scsi_proc.c

...
        p = create_proc_read_entry(name, S_IFREG | S_IRUGO | S_IWUSR,
                        sht->proc_dir, proc_scsi_read, shost);
        if (!p) {
                printk(KERN_ERR "%s: Failed to register host %d in"
                       "%s\n", __FUNCTION__, shost->host_no,
                       sht->proc_name);
                return;
        }

        p->write_proc = proc_scsi_write_proc;
...

  it just seems to abuse the semantics to use a routine called
"create_proc_read_entry" to create a writable file.  but that's just
me.

rday

-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page
========================================================================

                 reply	other threads:[~2007-05-30 12:18 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=Pine.LNX.4.64.0705300813150.13465@localhost.localdomain \
    --to=rpjday@mindspring.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®