public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jari Ruusu <jariruusu@users.sourceforge.net>
To: Andries Brouwer <Andries.Brouwer@cwi.nl>
Cc: linux-kernel@vger.kernel.org
Subject: Re: OOM & [OT] util-linux-2.12e
Date: Wed, 22 Sep 2004 20:05:31 +0300	[thread overview]
Message-ID: <4151B0DB.A0DA0135@users.sourceforge.net> (raw)
In-Reply-To: 20040921212620.GA15559@apps.cwi.nl

Andries Brouwer wrote:
> On Tue, Sep 21, 2004 at 07:45:21PM +0300, Jari Ruusu wrote:
> > How about implementing /etc/fstab option parsing code that is compatible
> > with existing libc /etc/fstab parsing code:
> >
> > defaults,noauto,comment=kudzu,rw
> >                 ^^^^^^^^^^^^^
> 
> Is there such libc parsing code? Can you tell me which libc?
> Which file? Invoked for what function calls?

man setmntent

SYNOPSIS
       #include <stdio.h>
       #include <mntent.h>
       FILE *setmntent(const char *filename, const char *type);
       struct mntent *getmntent(FILE *filep);
       int addmntent(FILE *filep, const struct mntent *mnt);
       int endmntent(FILE *filep);
       char *hasmntopt(const struct mntent *mnt, const char *opt);

Mount is not the only piece of code that parses fstab. Even swapon and
swapoff programs that are part of util-linux were broken by this change. The
'comment=fubar' mount option requires two line change to mount.c, and most
of all, does not break any existing fstab parsing code.

Your fstab options comment change means that all code that parses fstab
needs to be modified to understand the new comment separator sequence. If
they are not modified, they will mis-parse the comment separator sequence
and mis-parse options beyond the comment separator sequence.

Not directly related to above, but you need to release new version of
util-linux soon anyway. You intruduced this type of gems to util-linux-2.12e

--- util-linux-2.12d/mount/lomount.c	Sun Jul 11 20:26:41 2004
+++ util-linux-2.12e/mount/lomount.c	Fri Sep 17 01:28:58 2004

+	memset(&loopinfo64, 0, sizeof(loopinfo64));
 
 	close (fd);
---------------^^
+
+	if (i) {
+		ioctl (fd, LOOP_CLR_FD, 0);
-----------------------^^
+		return 1;
+	}
+
 	if (verbose > 1)
 		printf(_("set_loop(%s,%s,%llu): success\n"),
 		       device, file, offset);
 	return 0;
-
- fail:
-	(void) ioctl (fd, LOOP_CLR_FD, 0);
-	close (fd);
-	return 1;
 }

-- 
Jari Ruusu  1024R/3A220F51 5B 4B F9 BB D3 3F 52 E9  DB 1D EB E3 24 0E A9 DD

  reply	other threads:[~2004-09-22 17:04 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-19 22:05 OOM & [OT] util-linux-2.12e Andries.Brouwer
2004-09-20  9:46 ` Olaf Hering
2004-09-20 10:12   ` Andreas Schwab
2004-09-20 10:54     ` DervishD
2004-09-20 11:43       ` Andreas Schwab
2004-09-20 11:51         ` Paulo Marques
2004-09-20 12:11           ` DervishD
2004-09-20 12:14           ` Andreas Schwab
2004-09-20 12:00         ` DervishD
2004-09-20 10:23   ` Roman Zippel
2004-09-20 10:56     ` Olaf Hering
2004-09-20 11:16       ` Roman Zippel
2004-09-20 11:26         ` Olaf Hering
2004-09-20 11:38           ` Roman Zippel
2004-09-20 11:50             ` Olaf Hering
2004-09-20 12:02               ` Roman Zippel
2004-09-20 12:07                 ` Olaf Hering
2004-09-20 12:14                   ` Roman Zippel
2004-09-20 12:19                     ` Olaf Hering
2004-09-20 12:34                       ` Roman Zippel
2004-09-20 12:38                         ` Olaf Hering
2004-09-20 12:51                           ` Andreas Schwab
2004-09-20 12:54                             ` Olaf Hering
2004-09-20 13:19             ` CaT
2004-09-20 13:33               ` Andreas Schwab
2004-09-20 13:15     ` CaT
2004-09-20 10:59   ` DervishD
2004-09-20 13:24     ` Helge Hafting
2004-09-20 13:21       ` Olaf Hering
2004-09-20 13:32         ` Helge Hafting
2004-09-20 14:12           ` Herbert Poetzl
2004-09-21  7:20             ` Helge Hafting
2004-09-21  9:18               ` Herbert Poetzl
2004-09-20 15:24     ` Tonnerre
2004-09-20 11:11   ` David Gómez
2004-09-20 11:06 ` DervishD
2004-09-20 11:38   ` Xavier Bestel
2004-09-20 11:59     ` DervishD
2004-09-20 12:32       ` Xavier Bestel
2004-09-20 14:16         ` Herbert Poetzl
2004-09-21 16:45 ` Jari Ruusu
2004-09-21 21:26   ` Andries Brouwer
2004-09-22 17:05     ` Jari Ruusu [this message]
2004-09-22 18:39       ` Andries Brouwer

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=4151B0DB.A0DA0135@users.sourceforge.net \
    --to=jariruusu@users.sourceforge.net \
    --cc=Andries.Brouwer@cwi.nl \
    --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