All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pete Zaitcev <zaitcev@redhat.com>
To: viro@math.psu.edu
Cc: linux-kernel@vger.kernel.org
Subject: Patch for a leak of anonymous devices
Date: Tue, 9 Apr 2002 16:25:10 -0400	[thread overview]
Message-ID: <20020409162510.A21361@devserv.devel.redhat.com> (raw)

Hi, Al:

Arjan used your fix from 2.5 which simply moves the allocation
of the device. Are you going to change in in 2.4 too?
Here's what I did for 2.4.18-pre6 temporarily:

--- linux-2.4.18-pre6/fs/super.c	Tue Apr  9 11:58:25 2002
+++ linux-2.4.18-pre6-p3/fs/super.c	Tue Apr  9 11:53:43 2002
@@ -632,6 +632,9 @@
 			continue;
 		if (!grab_super(old))
 			goto retry;
+		spin_lock(&unnamed_dev_lock);
+		clear_bit(dev, unnamed_dev_in_use);
+		spin_unlock(&unnamed_dev_lock);
 		destroy_super(s);
 		return old;
 	}

Another question: your code allows to allocate device (0,0).
I assume you found it safe; everything works. However, why
is it safe? Do we have no functions that return zero as a
device number to indicate a failure?

My moremounts patch simple pre-sets the first bit of the
unnamed_dev_in_use bitmap to avoid this. But perhaps I am
paranoid here.

-- Pete

                 reply	other threads:[~2002-04-09 20:25 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=20020409162510.A21361@devserv.devel.redhat.com \
    --to=zaitcev@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@math.psu.edu \
    /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.