public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: ch@murgatroid.com (Christopher Hoover)
To: linux-mtd@lists.infradead.org
Subject: Another mmap / jffs2 problem (was RE: 2.5.59-rmk1: unmap_vmas: VMA list is not sorted correctly!)
Date: Thu, 6 Mar 2003 17:30:50 -0800	[thread overview]
Message-ID: <003501c2e449$2fc65db0$e55f040f@bergamot> (raw)
In-Reply-To: <20030306232854.F982@flint.arm.linux.org.uk>

This is a multi-part message in MIME format.

------=_NextPart_000_0036_01C2E406.21A31DB0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit


> This is a long standing problem - and, has been reported many times
> here.  I don't remember the details, but I seem to remember that
> pppd is buggy.

Ah.  I looked at the code -- it seems that someone thought that mmap(2)
returns 0 on error.  A couple of checks for -1 fixed it.  I'll forward a
patch to the maintainers (attached here for anyone encountering this
problem who finds this note).

Incidentally why does the mmap fail with EINVAL against a jffs2 file and
succeed against a tmpfs file?  Is that by design?


> As far as the unmap_vmas message, if you could get a copy of the
> /proc/<pid>/maps file while pppd is running, it might provide some
> clues.

I'm still getting the occasion unmap_vmas message; I'll grab that info
next time I see it.

Thanks again.

Cheers,
-ch

------=_NextPart_000_0036_01C2E406.21A31DB0
Content-Type: application/octet-stream;
	name="ppp-2.4.1-mmap.diff"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="ppp-2.4.1-mmap.diff"

--- ppp-2.4.1.orig/pppd/tdb.c	2000-04-03 23:27:13.000000000 -0700=0A=
+++ ppp-2.4.1/pppd/tdb.c	2003-03-06 17:11:51.000000000 -0800=0A=
@@ -210,6 +210,8 @@=0A=
 	tdb->map_ptr =3D (void *)mmap(NULL, tdb->map_size, =0A=
 				    tdb->read_only?PROT_READ:PROT_READ|PROT_WRITE,=0A=
 				    MAP_SHARED | MAP_FILE, tdb->fd, 0);=0A=
+	if (tdb->map_ptr =3D=3D (void *) -1)=0A=
+		tdb->map_ptr =3D 0;=0A=
 #endif	=0A=
 	return 0;=0A=
 }=0A=
@@ -373,6 +375,8 @@=0A=
             tdb->map_ptr =3D (void *)mmap(NULL, tdb->map_size, =0A=
                                         PROT_READ|PROT_WRITE,=0A=
                                         MAP_SHARED | MAP_FILE, tdb->fd, =
0);=0A=
+	    if (tdb->map_ptr =3D=3D (void *) -1)=0A=
+		tdb->map_ptr =3D 0;=0A=
         }=0A=
 #endif=0A=
 =0A=
@@ -1180,6 +1184,8 @@=0A=
             tdb.map_ptr =3D (void *)mmap(NULL, st.st_size, =0A=
                                        tdb.read_only? PROT_READ : =
PROT_READ|PROT_WRITE,=0A=
                                        MAP_SHARED | MAP_FILE, tdb.fd, =
0);=0A=
+	    if (tdb.map_ptr =3D=3D (void *) -1)=0A=
+		tdb.map_ptr =3D 0;=0A=
         }=0A=
 #endif=0A=
 =0A=

------=_NextPart_000_0036_01C2E406.21A31DB0--

  reply	other threads:[~2003-03-07  1:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <000d01c2e2ba$95246520$7a00000a@bergamot>
2003-03-06 22:47 ` Another mmap / jffs2 problem (was RE: 2.5.59-rmk1: unmap_vmas: VMA list is not sorted correctly!) Christopher Hoover
2003-03-06 23:28   ` Russell King - ARM Linux
2003-03-07  1:30     ` Christopher Hoover [this message]
2003-03-07  2:10       ` Christopher Hoover
2003-03-07  6:53       ` David Woodhouse

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='003501c2e449$2fc65db0$e55f040f@bergamot' \
    --to=ch@murgatroid.com \
    --cc=linux-mtd@lists.infradead.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