All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Osterlund <petero2@telia.com>
To: viro@parcelfarce.linux.theplanet.co.uk
Cc: linux-kernel@vger.kernel.org, Jens Axboe <axboe@suse.de>,
	Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH] CDRW packet writing support for 2.6.7-bk13
Date: 02 Jul 2004 23:52:22 +0200	[thread overview]
Message-ID: <m2u0wqqdpl.fsf@telia.com> (raw)
In-Reply-To: <m2lli36ec9.fsf@telia.com>

Peter Osterlund <petero2@telia.com> writes:

> This patch implements CDRW packet writing as a kernel block device.
> Usage instructions are in the packet-writing.txt file.
...
> +static int pkt_proc_device(struct pktcdvd_device *pd, char *buf)
> +{
> +	char *b = buf, *msg;
> +	char bdev_buf[BDEVNAME_SIZE];
> +	int states[PACKET_NUM_STATES];
> +
> +	b += sprintf(b, "\nWriter %s mapped to %s:\n", pd->name,
> +		     __bdevname(pd->dev, bdev_buf));

This code leaks a module reference. The patch below fixes it. I'm not
sure it's correct, but do_open() also does module_put() after
put_disk().

Signed-off-by: Peter Osterlund <petero2@telia.com>

---

 linux-petero/fs/partitions/check.c |    1 +
 1 files changed, 1 insertion(+)

diff -puN fs/partitions/check.c~packet-refcnt fs/partitions/check.c
--- linux/fs/partitions/check.c~packet-refcnt	2004-07-02 23:18:22.000000000 +0200
+++ linux-petero/fs/partitions/check.c	2004-07-02 23:18:23.000000000 +0200
@@ -151,6 +151,7 @@ const char *__bdevname(dev_t dev, char *
 	if (disk) {
 		buffer = disk_name(disk, part, buffer);
 		put_disk(disk);
+		module_put(disk->fops->owner);
 	} else {
 		snprintf(buffer, BDEVNAME_SIZE, "unknown-block(%u,%u)",
 				MAJOR(dev), MINOR(dev));
_

-- 
Peter Osterlund - petero2@telia.com
http://w1.894.telia.com/~u89404340

  reply	other threads:[~2004-07-02 21:52 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-01 13:34 [PATCH] CDRW packet writing support for 2.6.7-bk13 Peter Osterlund
2004-07-02 21:52 ` Peter Osterlund [this message]
2004-07-02 22:08   ` Andrew Morton
2004-07-02 22:47     ` Greg KH
2004-07-02 22:59       ` Andrew Morton
2004-07-02 23:24         ` Peter Osterlund
2004-07-02 23:51           ` Andrew Morton
2004-07-04 11:57             ` Peter Osterlund
2004-07-04 20:58               ` Andrew Morton
2004-07-04 21:06                 ` Christoph Hellwig
2004-07-04 12:30 ` [PATCH] Fix race in pktcdvd kernel thread handling Peter Osterlund
2004-07-04 12:37 ` [PATCH] Fix open/close races in pktcdvd Peter Osterlund
2004-07-04 13:05 ` [PATCH] CDRW packet writing support for 2.6.7-bk13 Christoph Hellwig
2004-07-04 23:49   ` Peter Osterlund
2004-07-05  0:01     ` Peter Osterlund
2004-07-10 23:20       ` Arnd Bergmann
2004-07-10 23:27         ` Christoph Hellwig
2004-07-11  1:06           ` Peter Osterlund
2004-07-12 16:25             ` Arnd Bergmann
2004-07-12 16:34               ` Christoph Hellwig
2004-07-13  6:04                 ` Jens Axboe
2004-07-14  0:06             ` [RFC][PATCH] Control pktcdvd with an auxiliary character device Peter Osterlund
2004-07-14  0:17               ` Peter Osterlund
2004-07-05  8:17     ` [PATCH] CDRW packet writing support for 2.6.7-bk13 Jens Axboe
2004-07-05 10:26     ` Christoph Hellwig
2004-07-06  8:45     ` Peter Osterlund
2004-07-07 10:06   ` Peter Osterlund

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=m2u0wqqdpl.fsf@telia.com \
    --to=petero2@telia.com \
    --cc=akpm@osdl.org \
    --cc=axboe@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.