From owner-freebsd-fs Sun Aug 12 2:45: 8 2001 Delivered-To: freebsd-fs@freebsd.org Received: from smarthost2.mail.easynet.fr (smarthost2.mail.easynet.fr [212.180.1.69]) by hub.freebsd.org (Postfix) with ESMTP id F34C637B405 for ; Sun, 12 Aug 2001 02:45:05 -0700 (PDT) (envelope-from fonvi@easynet.fr) Received: from smtp1.mail.easynet.fr (slb-1-sippriv.mail.easynet.fr [10.0.1.57]) by smarthost2.mail.easynet.fr (Postfix) with ESMTP id 8D55DBD0B for ; Sun, 12 Aug 2001 11:44:07 +0200 (CEST) Received: from gothic.blackend.org (adsl-4-110.adsl.easynet.fr [195.114.94.110]) by smtp1.mail.easynet.fr (Postfix) with ESMTP id AC334B6A7 for ; Sun, 12 Aug 2001 11:44:06 +0200 (CEST) Received: (from marc@localhost) by gothic.blackend.org (8.11.5/8.11.4/ - 31/07/01) id f7C9lbE36520 for freebsd-fs@freebsd.org; Sun, 12 Aug 2001 11:47:37 +0200 (CEST) (envelope-from marc) Date: Sun, 12 Aug 2001 11:47:37 +0200 From: Marc Fonvieille To: freebsd-fs@freebsd.org Subject: Can i grow any partitions with growfs(8) ? Message-ID: <20010812114737.A36490@gothic.blackend.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i X-Useless-Header: blackend.org X-Operating-System: FreeBSD 4.4-PRERELEASE Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hello, I used growfs(8) to grow the last partition (f which is used by /usr) on a slice and all is running fine. Now i want to grow /var which is the e partition, is it possible? I wonder if i have to "play" with /usr offset in the disklabel or growfs(8) does it for me? Marc To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message From owner-freebsd-fs Sun Aug 12 3:16:32 2001 Delivered-To: freebsd-fs@freebsd.org Received: from snipe.mail.pas.earthlink.net (snipe.mail.pas.earthlink.net [207.217.120.62]) by hub.freebsd.org (Postfix) with ESMTP id 43FB237B40C for ; Sun, 12 Aug 2001 03:16:27 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from mindspring.com (dialup-209.247.137.140.Dial1.SanJose1.Level3.net [209.247.137.140]) by snipe.mail.pas.earthlink.net (EL-8_9_3_3/8.9.3) with ESMTP id DAA11362; Sun, 12 Aug 2001 03:16:23 -0700 (PDT) Message-ID: <3B76579F.EBEECCA2@mindspring.com> Date: Sun, 12 Aug 2001 03:17:03 -0700 From: Terry Lambert Reply-To: tlambert2@mindspring.com X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Marc Fonvieille Cc: freebsd-fs@freebsd.org Subject: Re: Can i grow any partitions with growfs(8) ? References: <20010812114737.A36490@gothic.blackend.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Marc Fonvieille wrote: > > Hello, > > I used growfs(8) to grow the last partition (f which is used by /usr) on > a slice and all is running fine. > Now i want to grow /var which is the e partition, is it possible? I > wonder if i have to "play" with /usr offset in the disklabel or growfs(8) > does it for me? The only way to grow a partition that is stuck between two other partitions is to move the following partitions further toward the end of the disk -- growfs will not do this for you, and it is not an easy task. The easiest way to do this right now is to back them up (including the one you want to move), and then edit the disklabel, and then newfs the relocated/resized partitions, and restore. I would have to check the sources, but from memory (and _you_ should check the sources to verify my memory is correct), the disklabel partition size is used as the device size (this I know to be true), but that value is _not_ used by the FS, which uses its own stored copy instead. This would mean that you could get away _without_ including the one you want to move, and be able to use "growfs" on it later (you would still need the backup/restore on the partitions following it). In the future, you might look to using "Vinum", which would let you create a bunch of physical parittions, and include them in arbitrary volume sets later, depending on which FS you want to grow. AFAIK, there is no PP driver, though, so you will not be able to "do the AIX" trick, where you add to FS's 4M at a time simply by giving them unallocated PP's, or by telling the partition that it can grab PP's as needed. This would probably be worthwhile to work on, but I personally don't have the time right now, nor can I dedicate a scratch machine to the task. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message From owner-freebsd-fs Sun Aug 12 4:33:11 2001 Delivered-To: freebsd-fs@freebsd.org Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by hub.freebsd.org (Postfix) with SMTP id 506F537B403 for ; Sun, 12 Aug 2001 04:33:04 -0700 (PDT) (envelope-from iedowse@maths.tcd.ie) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 12 Aug 2001 12:33:03 +0100 (BST) To: Igor Shmukler Cc: freebsd-fs@freebsd.org Subject: Re: another FFS question In-Reply-To: Your message of "Fri, 10 Aug 2001 18:31:22 EDT." <00bb01c121ec$307d48c0$7b02a8c0@tp600e> Date: Sun, 12 Aug 2001 12:32:56 +0100 From: Ian Dowse Message-ID: <200108121233.aa95748@salmon.maths.tcd.ie> Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org In message <00bb01c121ec$307d48c0$7b02a8c0@tp600e>, Igor Shmukler writes: >However dump of showed that 17th (starting count from 1st partition = >sector) and following two sectors >are 0x00 filled. You obviously didn't compile this with compiler warnings turned on (gcc -Wall) or you would have spotted the bugs yourself: fs.c: In function `main': fs.c:20: warning: assignment makes pointer from integer without a cast fs.c:24: warning: implicit declaration of function `pread' fs.c:29: warning: control reaches end of non-void function `man open' will tell you that open() returns an int, not a FILE *. `man pread' will tell you that `#include ' is required to get the correct prototype for pread(). This is the omission that actually stops the program from working as intended, because the `offset' argument to pread() is a 64-bit type, but without a prototype the compiler assumes an int (usually 32-bit). The functions open(), pread() and malloc() are documented to return values that indicate whether or not the operation was successful. If you ignore these errors, the program just carries on blindly, so any results may be meaningless - what happens if you accidentally mistype the device path pased to open() for example? There are useful functions such as perror() available to help print meaningful error messages, e.g.: fd = open(path, O_RDONLY); if (fd < 0) { perror(path); exit(1); } sbbuf = malloc(SBSIZE); if (sbbuf == NULL) { perror("malloc"); exit(1); } nread = pread(fd, sbbuf, SBSIZE, SBOFF); if (nread != SBSIZE) { if (nread < 0) perror("pread"); else fprintf(stderr, "SBSIZE at SBOFF: short read\n"); exit(1); } See also `man err' for some handy but less portable error printing functions. Ian To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message From owner-freebsd-fs Sun Aug 12 5:59:47 2001 Delivered-To: freebsd-fs@freebsd.org Received: from bilver.wjv.com (dhcp-1-132.n01.orldfl01.us.ra.verio.net [157.238.210.132]) by hub.freebsd.org (Postfix) with ESMTP id E4FFA37B407 for ; Sun, 12 Aug 2001 05:59:43 -0700 (PDT) (envelope-from bill@bilver.wjv.com) Received: (from bill@localhost) by bilver.wjv.com (8.11.1/8.11.1) id f7CCxPF56823; Sun, 12 Aug 2001 08:59:25 -0400 (EDT) (envelope-from bill) Date: Sun, 12 Aug 2001 08:59:25 -0400 From: Bill Vermillion To: Marc Fonvieille Cc: freebsd-fs@FreeBSD.ORG Subject: Re: Can i grow any partitions with growfs(8) ? Message-ID: <20010812085924.A56780@wjv.com> Reply-To: bv@wjv.com References: <20010812114737.A36490@gothic.blackend.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010812114737.A36490@gothic.blackend.org>; from fonvi@easynet.fr on Sun, Aug 12, 2001 at 11:47:37AM +0200 Organization: W.J.Vermillion / Orlando - Winter Park Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Sun, Aug 12, 2001 at 11:47:37AM +0200, Marc Fonvieille thus sprach: > I used growfs(8) to grow the last partition (f which is used by > /usr) on a slice and all is running fine. Now i want to grow /var > which is the e partition, is it possible? I wonder if i have to > "play" with /usr offset in the disklabel or growfs(8) does it for > me? A workaround is to take the directory that is using most of you data in /var and just symlink that to a directory on another partition. I've never made /var much bigger than 100M and on large installs where mail like to go to /var/mail, that just a link to /usr/mail. Bill -- Bill Vermillion - bv @ wjv . com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message From owner-freebsd-fs Sun Aug 12 9: 6:58 2001 Delivered-To: freebsd-fs@freebsd.org Received: from gull.mail.pas.earthlink.net (gull.mail.pas.earthlink.net [207.217.121.85]) by hub.freebsd.org (Postfix) with ESMTP id 51C3537B40C for ; Sun, 12 Aug 2001 09:06:55 -0700 (PDT) (envelope-from shmukler@mail.ru) Received: from tp600e (user-2ive7la.dialup.mindspring.com [165.247.30.170]) by gull.mail.pas.earthlink.net (EL-8_9_3_3/8.9.3) with SMTP id JAA10595; Sun, 12 Aug 2001 09:06:50 -0700 (PDT) Message-ID: <003901c12348$cac65ea0$7b02a8c0@tp600e> From: "Igor Shmukler" To: "Ian Dowse" Cc: References: <200108121233.aa95748@salmon.maths.tcd.ie> Subject: Re: another FFS question Date: Sun, 12 Aug 2001 12:06:45 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org > >However dump of showed that 17th (starting count from 1st partition = > >sector) and following two sectors > >are 0x00 filled. > > You obviously didn't compile this with compiler warnings turned on > (gcc -Wall) or you would have spotted the bugs yourself: > ... > Ian I agree that normally error checking is a good thing, however: Since it was only intended to run once, so I didn't check whether malloc would fail. Regarding inappropriate cast, I did get warning, but for cylinder 0 head 1 sector 1 int and long long should yield same results. I actually dumped partition and came up with following: I got 2 versions of FreeBSD installed on 2 different boxes. On FBSD 2.2 sectors 17,18 and 19 are 0x00 filled. On FBSD 4.3 same sectors seem to contain the FS structure, but still no FS_MAGIC present. While one can assume the mount does not check for 0x011954 signature in fs->fs_magic. I cannot even come to comprehend how does FreeBSD 2.2 boot without FS following BBLOCK. *** Is FS_MAGIC signature mandatory for FFS? Any logical reason for 0x00 filled 17-19th sectors? *** To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message From owner-freebsd-fs Sun Aug 12 9:57:33 2001 Delivered-To: freebsd-fs@freebsd.org Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by hub.freebsd.org (Postfix) with SMTP id A586E37B40C for ; Sun, 12 Aug 2001 09:57:29 -0700 (PDT) (envelope-from iedowse@maths.tcd.ie) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 12 Aug 2001 17:57:28 +0100 (BST) To: Igor Shmukler Cc: freebsd-fs@freebsd.org Subject: Re: another FFS question In-Reply-To: Your message of "Sun, 12 Aug 2001 12:06:45 EDT." <003901c12348$cac65ea0$7b02a8c0@tp600e> Date: Sun, 12 Aug 2001 17:57:28 +0100 From: Ian Dowse Message-ID: <200108121757.aa23922@salmon.maths.tcd.ie> Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org In message <003901c12348$cac65ea0$7b02a8c0@tp600e>, Igor Shmukler writes: >Since it was only intended to run once, so I didn't check whether malloc >would fail. That's fine, though you should at least ktrace the program to check that all system calls succeeded before trusting the output. >Regarding inappropriate cast, I did get warning, but for cylinder 0 head 1 >sector 1 int and long long should yield same results. In general this is not true at all; passing an int instead of a long long will fill the high 32 bits of the long long with junk from the stack, and can mess up other arguments. However in this case I hadn't noticed that the SBOFF macro includes an (off_t) cast, so it might have actually worked. >I actually dumped partition and came up with following: >I got 2 versions of FreeBSD installed on 2 different boxes. >On FBSD 2.2 sectors 17,18 and 19 are 0x00 filled. >On FBSD 4.3 same sectors seem to contain the FS structure, but still no >FS_MAGIC present. You must be looking in the wrong place on the disk; every ffs filesystem does have a superblock containing FS_MAGIC, and this is checked by the ffs mount code, by fsck and by any other filesystem utilities. Are you sure you are taking the offset of the start of the partition into account? For a raw disk, you need to read the DOS slice table and determine the start of the FreeBSD slice, and then read the disklabel in that slice to find the partitions. Normally the 'a' partition would begin right at the start of the FreeBSD slice, but nothing stops you from putting it elsewhere. Try looking at the raw disk/slice/partition with hd: hd /dev/ad0 | less hd /dev/ad0s1 | less hd /dev/ad0s1a | less In the first case (ad0), the MBR partition table starts at 0x1be, so you'd have to read that to determine where the slices start. For ad0s1, the disklabel should appear at 0x200. Finally, for ad0s1a (which on a slice beginning with the 'a' partition starts at the same place as ad0s1), the superblock can be found at 0x2000, with the FS_MAGIC visable at 0x255c. >Is FS_MAGIC signature mandatory for FFS? Yes. Ian To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message From owner-freebsd-fs Sun Aug 12 10:29:30 2001 Delivered-To: freebsd-fs@freebsd.org Received: from gull.mail.pas.earthlink.net (gull.mail.pas.earthlink.net [207.217.121.85]) by hub.freebsd.org (Postfix) with ESMTP id ED9C137B401 for ; Sun, 12 Aug 2001 10:29:26 -0700 (PDT) (envelope-from shmukler@mail.ru) Received: from tp600e (user-2ivec3r.dialup.mindspring.com [165.247.48.123]) by gull.mail.pas.earthlink.net (EL-8_9_3_3/8.9.3) with SMTP id KAA15652; Sun, 12 Aug 2001 10:29:21 -0700 (PDT) Message-ID: <001401c12354$528bc040$7b02a8c0@tp600e> From: "Igor Shmukler" To: "Ian Dowse" Cc: References: <200108121757.aa23922@salmon.maths.tcd.ie> Subject: Re: another FFS question Date: Sun, 12 Aug 2001 13:29:18 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org > >Since it was only intended to run once, so I didn't check whether malloc > >would fail. > > That's fine, though you should at least ktrace the program to > check that all system calls succeeded before trusting the output. Let's assume call succeded. I'm sure malloc didn't fail me. ... > >I actually dumped partition and came up with following: > >I got 2 versions of FreeBSD installed on 2 different boxes. > >On FBSD 2.2 sectors 17,18 and 19 are 0x00 filled. > >On FBSD 4.3 same sectors seem to contain the FS structure, but still no > >FS_MAGIC present. > > You must be looking in the wrong place on the disk; every ffs > filesystem does have a superblock containing FS_MAGIC, and this is > checked by the ffs mount code, by fsck and by any other filesystem > utilities. That's what I thought. > Are you sure you are taking the offset of the start of the partition > into account? For a raw disk, you need to read the DOS slice table > and determine the start of the FreeBSD slice, and then read the > disklabel in that slice to find the partitions. Normally the 'a' > partition would begin right at the start of the FreeBSD slice, > but nothing stops you from putting it elsewhere. Try looking at the > raw disk/slice/partition with hd: I'm sure I found partition ok. Otherwise, how would I find boot code in 1st 8k of the partition? > For ad0s1, the disklabel should appear at 0x200. Same here. > Finally, for ad0s1a (which on a slice beginning with the 'a' partition > starts at the same place as ad0s1), the superblock can be found at > 0x2000, with the FS_MAGIC visable at 0x255c. OK. Seems I was looking at 0x2558 Thank you. Actually this makes me think that perhaps open did fail? Otherwise why would I get fs->fs_magic - 0? My bad. Also, above data reflects state of affairs on my 4.3 box. Is there a logical explanation for 0x00 filled sectors on 2.2 box? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message From owner-freebsd-fs Mon Aug 13 9:51:57 2001 Delivered-To: freebsd-fs@freebsd.org Received: from softarch.com (softarch.com [66.12.162.130]) by hub.freebsd.org (Postfix) with ESMTP id 73A8937B406 for ; Mon, 13 Aug 2001 09:51:55 -0700 (PDT) (envelope-from ryand@softarch.com) Received: from localhost (66.12.162.140) by softarch.com (FirstClass Mail Server v5.50) with ESMTP (Sender: ryand@softarch.com) transient id 6029; Mon, 13 Aug 2001 09:53:00 -0700 Date: Mon, 13 Aug 2001 09:52:06 -0700 Content-Type: text/plain; format=flowed; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v388) From: Ryan Dary To: freebsd-fs@freebsd.org X-Mailer: Apple Mail (2.388) Content-Transfer-Encoding: 7bit Subject: uio structure Message-Id: <20010813165155.73A8937B406@hub.freebsd.org> Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Can someone tell me how to fill out the uio structure? I can't find any documentation that talks about all the elements. Specifically the iovec? How would an example of that look? - Ryan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message From owner-freebsd-fs Mon Aug 13 10:37:48 2001 Delivered-To: freebsd-fs@freebsd.org Received: from blackcomb.panasas.com (gw2.panasas.com [65.194.124.178]) by hub.freebsd.org (Postfix) with ESMTP id EACC037B40D for ; Mon, 13 Aug 2001 10:37:45 -0700 (PDT) (envelope-from rgrover@panasas.com) Received: from tiltill.panasas.com (IDENT:rgrover@tiltill.panasas.com [172.17.132.191]) by blackcomb.panasas.com (8.9.3/8.9.3) with SMTP id NAA25104; Mon, 13 Aug 2001 13:37:33 -0400 From: Rohit Grover Organization: Panasas Inc. To: Ryan Dary , freebsd-fs@FreeBSD.ORG Subject: Re: uio structure Date: Mon, 13 Aug 2001 10:35:23 -0700 X-Mailer: KMail [version 1.0.29] Content-Type: text/plain References: <20010813165155.73A8937B406@hub.freebsd.org> In-Reply-To: <20010813165155.73A8937B406@hub.freebsd.org> MIME-Version: 1.0 Message-Id: <01081310373209.07250@tiltill.panasas.com> Content-Transfer-Encoding: 8bit Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Mon, 13 Aug 2001, Ryan Dary wrote: > Can someone tell me how to fill out the uio structure? I can't find any > documentation that talks about all the elements. > The daemon book talks about the uio structure. Checkout /usr/src/sys/kern/sys_generic.c:dofileread to see how it might be used. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message From owner-freebsd-fs Mon Aug 13 13:27:28 2001 Delivered-To: freebsd-fs@freebsd.org Received: from softarch.com (softarch.com [66.12.162.130]) by hub.freebsd.org (Postfix) with ESMTP id 88A8037B40D for ; Mon, 13 Aug 2001 13:27:25 -0700 (PDT) (envelope-from ryand@softarch.com) Received: from localhost (66.12.162.140) by softarch.com (FirstClass Mail Server v5.50) with ESMTP (Sender: ryand@softarch.com) transient id 6200; Mon, 13 Aug 2001 13:28:30 -0700 Date: Mon, 13 Aug 2001 13:27:37 -0700 Content-Type: text/plain; format=flowed; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v388) From: Ryan Dary To: freebsd-fs@freebsd.org X-Mailer: Apple Mail (2.388) Content-Transfer-Encoding: 7bit Subject: Connecting the VFS dots... Message-Id: <20010813202725.88A8037B40D@hub.freebsd.org> Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org I have a library which is a platform independent implementation of the file system I am porting. I have to tie it down to the I/O system for now. In the kernel extension, how do I access the device for read/write? Is there a VFS way to access blocks of the device? - Ryan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message From owner-freebsd-fs Mon Aug 13 13:39:40 2001 Delivered-To: freebsd-fs@freebsd.org Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by hub.freebsd.org (Postfix) with ESMTP id 9E04537B401 for ; Mon, 13 Aug 2001 13:39:36 -0700 (PDT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (robert@fledge.pr.watson.org [192.0.2.3]) by fledge.watson.org (8.11.4/8.11.4) with SMTP id f7DKdRf56291; Mon, 13 Aug 2001 16:39:27 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Mon, 13 Aug 2001 16:39:26 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Ryan Dary Cc: freebsd-fs@freebsd.org Subject: Re: uio structure In-Reply-To: <20010813165155.73A8937B406@hub.freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org I recommend reading uio(9) and readv(2)/writev(2). Robert N M Watson FreeBSD Core Team, TrustedBSD Project robert@fledge.watson.org NAI Labs, Safeport Network Services On Mon, 13 Aug 2001, Ryan Dary wrote: > Can someone tell me how to fill out the uio structure? I can't find any > documentation that talks about all the elements. > > Specifically the iovec? How would an example of that look? > > - Ryan > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-fs" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message From owner-freebsd-fs Fri Aug 17 2:25:54 2001 Delivered-To: freebsd-fs@freebsd.org Received: from tao.org.uk (genesis.tao.org.uk [212.135.162.62]) by hub.freebsd.org (Postfix) with ESMTP id EEF6F37B408 for ; Fri, 17 Aug 2001 02:25:51 -0700 (PDT) (envelope-from joe@tao.org.uk) Received: by tao.org.uk (Postfix, from userid 100) id 27F1BE; Fri, 17 Aug 2001 10:25:49 +0100 (BST) Date: Fri, 17 Aug 2001 10:25:49 +0100 From: Josef Karthauser To: freebsd-fs@FreeBSD.ORG Subject: parsing problem with /proc/N/status Message-ID: <20010817102549.A712@tao.org.uk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="lrZ03NoBR/3+SXJZ" Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I've raised PR29682 about a problem parsing /proc/N/status (procfs) in -current. The problem occurs when process names contain spaces, like all of the 'irqN: xxx' ones do. Is there a procfs guru here that would mind taking a look for me? Many thanks, Joe --lrZ03NoBR/3+SXJZ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjt84xwACgkQXVIcjOaxUBYLbACeIy+DwKl7c/I0qMELD1E5THmS xaIAn04RCGtAXvb4/Fuqq4Wbb8oOHQwu =5zKd -----END PGP SIGNATURE----- --lrZ03NoBR/3+SXJZ-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message From owner-freebsd-fs Fri Aug 17 15:14:45 2001 Delivered-To: freebsd-fs@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id 7729B37B409 for ; Fri, 17 Aug 2001 15:14:41 -0700 (PDT) (envelope-from des@ofug.org) Received: (from des@localhost) by flood.ping.uio.no (8.9.3/8.9.3) id AAA80390; Sat, 18 Aug 2001 00:13:59 +0200 (CEST) (envelope-from des@ofug.org) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: Josef Karthauser Cc: freebsd-fs@FreeBSD.ORG Subject: Re: parsing problem with /proc/N/status References: <20010817102549.A712@tao.org.uk> From: Dag-Erling Smorgrav Date: 18 Aug 2001 00:13:59 +0200 In-Reply-To: <20010817102549.A712@tao.org.uk> Message-ID: Lines: 27 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Josef Karthauser writes: > I've raised PR29682 about a problem parsing /proc/N/status (procfs) in > -current. The problem occurs when process names contain spaces, like > all of the 'irqN: xxx' ones do. Is there a procfs guru here that would > mind taking a look for me? I'm not a guru, but I'm the closest thing to a maintainer procfs has at the moment. The problem you describe is not limited to -CURRENT, nor to interrupt threads: des@xxxxx ~% uname -a FreeBSD xxxxx.xxxx.xxx.xx 3.5-STABLE FreeBSD 3.5-STABLE #1: Fri Apr 27 09:54:47 CEST 2001 des@xxxxx.xxxx.xxx.xx:/usr/src/sys/compile/XXXXX i386 des@xxxxx ~% cp /bin/cat 'c a t' des@xxxxx ~% ./c\ a\ t /proc/curproc/status c a t 80330 75065 80330 75065 5,1 ctty 998085659,268032 0,0 0,0 nochan 2602 2602 12602,12602,12602,0,69,4711,11000,11002,11381,99 There is no good solution. The ideal fix would be to use NUL characters instead of spaces to separate the fields (as is done for cmdline), but that would (obviously) break backwards compatibility. Replacing spaces with underscores like your patch does is a hack (and only a partial hack at that - the process name might contain a newline). If we have to go down that road, I'd rather just encode whitespace and unprintables in octal notation (like ls -B does). DES -- Dag-Erling Smorgrav - des@ofug.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message From owner-freebsd-fs Sat Aug 18 6:19:48 2001 Delivered-To: freebsd-fs@freebsd.org Received: from tao.org.uk (genesis.tao.org.uk [212.135.162.62]) by hub.freebsd.org (Postfix) with ESMTP id E5CE937B40E for ; Sat, 18 Aug 2001 06:19:44 -0700 (PDT) (envelope-from joe@tao.org.uk) Received: by tao.org.uk (Postfix, from userid 100) id 00F214B; Sat, 18 Aug 2001 14:19:40 +0100 (BST) Date: Sat, 18 Aug 2001 14:19:40 +0100 From: Josef Karthauser To: Dag-Erling Smorgrav Cc: freebsd-fs@FreeBSD.ORG Subject: Re: parsing problem with /proc/N/status Message-ID: <20010818141940.B877@tao.org.uk> References: <20010817102549.A712@tao.org.uk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="s2ZSL+KKDSLx8OML" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from des@ofug.org on Sat, Aug 18, 2001 at 12:13:59AM +0200 Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --s2ZSL+KKDSLx8OML Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Aug 18, 2001 at 12:13:59AM +0200, Dag-Erling Smorgrav wrote: =20 > There is no good solution. The ideal fix would be to use NUL > characters instead of spaces to separate the fields (as is done for > cmdline), but that would (obviously) break backwards compatibility. > Replacing spaces with underscores like your patch does is a hack (and > only a partial hack at that - the process name might contain a > newline). If we have to go down that road, I'd rather just encode > whitespace and unprintables in octal notation (like ls -B does). Sounds fair. I don't particularly care, but as it stands it's next to useless as it's unparsable. Joe --s2ZSL+KKDSLx8OML Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjt+a2sACgkQXVIcjOaxUBaxegCcCuAKNkGksTMYMQC5UY3nL27Y 0tUAoOSus2dUkcCUhux4tq5cDFnPDdwK =mhmt -----END PGP SIGNATURE----- --s2ZSL+KKDSLx8OML-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message From owner-freebsd-fs Sat Aug 18 17:49: 1 2001 Delivered-To: freebsd-fs@freebsd.org Received: from capybara.eecs.harvard.edu (capybara.eecs.harvard.edu [140.247.62.36]) by hub.freebsd.org (Postfix) with ESMTP id 5EEEA37B407 for ; Sat, 18 Aug 2001 17:48:58 -0700 (PDT) (envelope-from ellard@eecs.harvard.edu) Received: from localhost (ellard@localhost) by capybara.eecs.harvard.edu (8.11.3/8.11.3) with ESMTP id f7J0o1V75644; Sat, 18 Aug 2001 20:50:03 -0400 (EDT) (envelope-from ellard@eecs.harvard.edu) X-Authentication-Warning: capybara.eecs.harvard.edu: ellard owned process doing -bs Date: Sat, 18 Aug 2001 20:50:01 -0400 (EDT) From: Dan Ellard To: Josef Karthauser Cc: , Dan Ellard Subject: Re: parsing problem with /proc/N/status In-Reply-To: <20010817102549.A712@tao.org.uk> Message-ID: <20010818204221.I75599-100000@capybara.eecs.harvard.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Fri, 17 Aug 2001, Josef Karthauser wrote: > I've raised PR29682 about a problem parsing /proc/N/status (procfs) in > -current. The problem occurs when process names contain spaces, like > all of the 'irqN: xxx' ones do. Is there a procfs guru here that would > mind taking a look for me? I'm nearly as far as possible from being a guru in this area... But after reading through the man page, it looks like the only field you need to worry about containing spaces is the first field. If this is true, then if you parse the string *backwards*, after you've plucked out all the other fields, whatever remains is the command name. (The value from procfs should consist of 11+x tokens (where x > 0). The last 11 match up with the last 11 fields, and the first x get combined to form the command name.) -Dan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message From owner-freebsd-fs Sat Aug 18 19:15: 4 2001 Delivered-To: freebsd-fs@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id 7E75837B40C for ; Sat, 18 Aug 2001 19:14:54 -0700 (PDT) (envelope-from des@ofug.org) Received: (from des@localhost) by flood.ping.uio.no (8.9.3/8.9.3) id EAA87726; Sun, 19 Aug 2001 04:14:52 +0200 (CEST) (envelope-from des@ofug.org) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: Arne Dag =?iso-8859-1?q?Fidjest=F8l?= Cc: Josef Karthauser , freebsd-fs@FreeBSD.ORG Subject: Re: parsing problem with /proc/N/status References: <200108182324.BAA10850@zevs.idi.ntnu.no> From: Dag-Erling Smorgrav Date: 19 Aug 2001 04:14:51 +0200 In-Reply-To: <200108182324.BAA10850@zevs.idi.ntnu.no> Message-ID: Lines: 19 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Arne Dag Fidjest=F8l writes: > > > newline). If we have to go down that road, I'd rather just encode > > > whitespace and unprintables in octal notation (like ls -B does). > Unprintables vary with locales, so octal encoding should probably be=20 > limited to ascii-whitespace? Anything below ASCII value 33 or above ASCII value 126 is unprintable. > > Sounds fair. I don't particularly care, but as it stands it's next > > to useless as it's unparsable. > Provided that there is a known number of space-seperated fields it is=20 > still parsable. Only if you're 100% certain you'll never, ever want to add more fields at the end. DES --=20 Dag-Erling Smorgrav - des@ofug.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message