9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] dossrv panics
@ 2002-03-13 14:32 Russ Cox
  0 siblings, 0 replies; 5+ messages in thread
From: Russ Cox @ 2002-03-13 14:32 UTC (permalink / raw)
  To: 9fans

The extra argument to truncfile _is_ 9P2000 related.
I misread the code last night.  Sorry about that.

Russ


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] dossrv panics
@ 2002-03-13  7:38 forsyth
  0 siblings, 0 replies; 5+ messages in thread
From: forsyth @ 2002-03-13  7:38 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 45 bytes --]

i suspect it's related to a 9P2000 change


[-- Attachment #2: Type: message/rfc822, Size: 2247 bytes --]

To: 9fans@cse.psu.edu
Subject: Re: [9fans] dossrv panics
Date: Tue, 12 Mar 2002 23:00:38 -0800
Message-ID: <20020313070043.46A4A54804@zloty.ugcs.caltech.edu>


I made the change and it seems to be happy now.  Thanks!

> On a related note, in dossubs.c:/^truncfile, I think that
> 
> 	while(clust > 0){
> 		next = getfat(xf, clust);
> 		if(n <= 0)
> 			putfat(xf, clust, 0);
> 		else
> >>>			n -= bp->sectsize;
> 		clust = next;
> 	}
> 
> should be
> 
> 	n -= bp->clustsize*bp->sectsize;
> 
> It doesn't matter, since we only call truncfile
> with a count of 0.

My truncfile had no 'n' and hence no if-else, just putfat(), but if it's always
0 it sounds like I'll do ok without :)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] dossrv panics
  2002-03-13  5:21 Russ Cox
@ 2002-03-13  7:00 ` Quinn Dunkan
  0 siblings, 0 replies; 5+ messages in thread
From: Quinn Dunkan @ 2002-03-13  7:00 UTC (permalink / raw)
  To: 9fans


I made the change and it seems to be happy now.  Thanks!

> On a related note, in dossubs.c:/^truncfile, I think that
> 
> 	while(clust > 0){
> 		next = getfat(xf, clust);
> 		if(n <= 0)
> 			putfat(xf, clust, 0);
> 		else
> >>>			n -= bp->sectsize;
> 		clust = next;
> 	}
> 
> should be
> 
> 	n -= bp->clustsize*bp->sectsize;
> 
> It doesn't matter, since we only call truncfile
> with a count of 0.

My truncfile had no 'n' and hence no if-else, just putfat(), but if it's always
0 it sounds like I'll do ok without :)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] dossrv panics
@ 2002-03-13  5:21 Russ Cox
  2002-03-13  7:00 ` Quinn Dunkan
  0 siblings, 1 reply; 5+ messages in thread
From: Russ Cox @ 2002-03-13  5:21 UTC (permalink / raw)
  To: 9fans

In dossubs.c:/^getfat, change

	/*
	 * this is a very strange check for out of range
	 */
>>>	if(k >= (1 << fb) - 7)
		return -1;

to

	/*
	 * This is a very strange check for out of range.
	 * As a concrete example, for a 16-bit FAT,
	 * FFF8 through FFFF all signify ``end of cluster chain.''
	 * This generalizes to other-sized FATs.
	 */
	if(k >= (1 << fb) - 8)

(Note the s/7/8/ in addition to the big comment.)
and let me know whether that solves your problem.

On a related note, in dossubs.c:/^truncfile, I think that

	while(clust > 0){
		next = getfat(xf, clust);
		if(n <= 0)
			putfat(xf, clust, 0);
		else
>>>			n -= bp->sectsize;
		clust = next;
	}

should be

	n -= bp->clustsize*bp->sectsize;

It doesn't matter, since we only call truncfile
with a count of 0.

Russ



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [9fans] dossrv panics
@ 2002-03-13  4:27 Quinn Dunkan
  0 siblings, 0 replies; 5+ messages in thread
From: Quinn Dunkan @ 2002-03-13  4:27 UTC (permalink / raw)
  To: 9fans

dossrv tends to panic a lot on me.  It often seems to happen when writing to
files which have been put there by linux, which leads me to believe that
linux's dos filesystem is doing something weird which is messing up dossrv.
The error msg is:

dossrv 45: panic putfat n=65528: file does not exist

Here's what dossrv -v has to say:

session...OK
attach(fid=275,uname="quinn",aname="/dev/sdC0/9fat",auth="")...alloc "/dev/sdC0/9fat", dev=3...[tread 0+0...done]magic: 0xeb 0x3c 0x90
version: "Plan9.00"
sectsize: 512
clustsize: 4
nresrv: 2
nfats: 2
rootsize: 512
volsize: 20482
mediadesc: 0xf8
fatsize: 20
trksize: 63
nheads: 128
nhidden: 4193280
bigvolsize: 20482
driveno: 128
reserved0: 0x00
bootsig: 0x29
volid: 0x003ffc2a
label: "CYLINDRICAL"
fatbits=16 (5104 clusters)...fat 0: 2...fat 1: 22...root: 42...data: 74...OK
...
"plan9path.py" 41 00 1b 0
"PLAN9P~1.PY " --a----- 19:47:42 102.03.12 30:40:00 102.03.12 102.03.12 1534 307
found
OK
remove(fid=254,name="plan9path.py")...[tread 27+0...done]dossrv 259: panic
putfat n=65528: file does not exist


 From a cursory look at the src (and knowing almost nothing about FAT), it looks
like somehow dossrv got the idea that the file in question was on a cluster
which is too high (and is suspiciously close to 2^16---it's always 65528, even
for different files).  Reading the files in question works fine, it just gets
confused on a write or delete.  Oh, and it happens for short filenames too.

Before I possibly spend some time trying to figure out what cluster the file
actually is, and how dossrv figures out clusters, does this error look familiar
to anyone?


Random bit of learned-it-the-hard-way advice to other plan9 newbies:
don't name your kernel >8 chars, the loader doesn't seem to understand long
file names.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-03-13 14:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-13 14:32 [9fans] dossrv panics Russ Cox
  -- strict thread matches above, loose matches on Subject: below --
2002-03-13  7:38 forsyth
2002-03-13  5:21 Russ Cox
2002-03-13  7:00 ` Quinn Dunkan
2002-03-13  4:27 Quinn Dunkan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).