Commit Graph

7 Commits

Author SHA1 Message Date
Pedro F. Giffuni
0b4b96e6e5 libstand: Reset the seek pointer in ext2fs as done in UFS.
Based on r134760:

Reset the seek pointer to 0 when a file is successfully opened,
since otherwise the initial seek offset will contain the directory
offset of the filesystem block that contained its directory entry.
This bug was mostly harmless because typically the directory is
less than one filesystem block in size so the offset would be zero.
It did however generally break loading a kernel from the (large)
kernel compile directory.

Also reset the seek pointer when a new inode is opened in read_inode(),
though this is not actually necessary now because all callers set
it afterwards.

PR:		177328
Submitted by:	Eric van Gyzen
Reviewed by:	iedowse
MFC after:	5 days
2013-06-09 01:19:22 +00:00
Stefan Farfeleder
5a9e72a72b Don't add integers to void pointers. 2004-10-03 15:58:20 +00:00
John Baldwin
fb6b710c39 Clean up error handling in libstand filesystem code to be more consistent:
- bzipfs and gzipfs now properly return errno values directly from their
  read routines rather than returning -1.
- missing errno values on error returns for the seek routines on almost
  all filesystems were added.
- fstat() now returns -1 if an error occurs rather than ignoring it.
- nfs's readdir() routine now reports valid errno values if an error or
  EOF occurs rather than EPERM  (It was just returning 0 for success and
  1 for failure).
- nullfs used the wrong semantics for every function besides close() and
  seek().  Getting it right for close() appears to be an accident at that.
- read() for buffered files no longer returns 0 (EOF) if an error occurs,
  but returns -1 instead.
2004-01-21 20:12:23 +00:00
Ian Dowse
95431d3d42 Use an explicitly-sized type instead of daddr_t for on-disk block
numbers.
2002-05-19 10:50:38 +00:00
Matthew Dillon
e74b6a84ce Add __FBSDID()s to libstand 2001-09-30 22:28:01 +00:00
Jeroen Ruigrok van der Werven
2fa72ea7d4 Fix typo: compatability -> compatibility.
Compatability is not an existing english word.
2001-02-06 12:05:58 +00:00
Jonathan Lemon
ee8d82ce9f Add ext2fs support to the loader. 2000-04-29 20:44:07 +00:00