Commit Graph

31 Commits

Author SHA1 Message Date
mlelstv 09123a68b9 fix DEBUG build 2016-05-07 16:43:02 +00:00
mlelstv e01ac00248 Validate FAT entries to avoid some panics caused by a corrupted FAT.
Also print FAT write errors when mount is synchronous (-o sync). This
reveals problems caused by a write protected disklabel on sector 1.
2016-05-03 18:17:28 +00:00
maxv 6e39240181 Remove the 'cred' argument from bread(). Remove a now unused var in
ffs_snapshot.c. Update the man page accordingly.

ok hannken@
2015-03-28 19:24:04 +00:00
christos db2e654869 A little more debugging. 2013-01-28 00:17:18 +00:00
christos 50df1c7d20 don't need sys/mount.h in userland. 2013-01-27 22:04:19 +00:00
christos 3c0f9bd4e8 tidy up debugging printfs; no functional change. 2013-01-27 20:15:58 +00:00
christos 691bcd5dbb more cross-compile friendly. 2013-01-26 16:51:51 +00:00
christos 929f8943ca expose more stuff if MAKEFS is defined for the headers, and arrange for
the source file to be compilable from userland.
2013-01-26 00:21:49 +00:00
hannken 1a15b095d2 Revert rev. 1.20 now that bread() has been fixed.
PR kern/46282 (6.0_BETA crash: msdosfs_bmap -> pcbmap -> bread -> bio_doread)
2012-12-20 11:44:39 +00:00
hannken 312d89f0de Change bread() and breadn() to never return a buffer on
error and modify all callers to not brelse() on error.

Welcome to 6.99.16

PR kern/46282 (6.0_BETA crash: msdosfs_bmap -> pcbmap -> bread -> bio_doread)
2012-12-20 08:03:41 +00:00
jakllsch 48958e522b Stylistic changes in comments/strings:
"FAT" and "fat" are different things, use the appropriate case.
"GEMDOS" is all caps.
2012-11-04 17:57:59 +00:00
hannken 4856f6556b pcbmap(): We cannot use bread() here as for the pagedaemon getblk()
may fail leading to a panic in bread().
          Replace bread() with getblk() / VOP_STRATEGY() and return
          an error if getblk() fails.

Fixes PR#46282: 6.0_BETA crash: msdosfs_bmap -> pcbmap -> bread -> bio_doread

This is an interim solution for easy pullup.  The final solution
is be to change bread() to not return a buffer on error.  As
we have to change all callers of bread() this will not qualify
for a pullup.
2012-04-09 11:10:06 +00:00
joerg 816eaf9482 On broken filesystems the fillinmap inner loop may have never read a
block, so don't try to release it if bp==NULL.
2010-01-26 20:25:52 +00:00
dsl 82357f6d42 ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
2009-03-14 21:04:01 +00:00
dsl 454af1c0e8 Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
2009-03-14 15:35:58 +00:00
hannken 5d2bff060a Make sure all cached buffers with valid, not yet written data have been
run through copy-on-write.  Call fscow_run() with valid data where possible.

The LP_UFSCOW hack is no longer needed to protect ffs_copyonwrite() against
endless recursion.

- Add a flag B_MODIFY to bread(), breada() and breadn().  If set the caller
  intends to modify the buffer returned.

- Always run copy-on-write on buffers returned from ffs_balloc().

- Add new function ffs_getblk() that gets a buffer, assigns a new blkno,
  may clear the buffer and runs copy-on-write.  Process possible errors
  from getblk() or fscow_run().  Part of PR kern/38664.

Welcome to 4.99.63

Reviewed by: YAMAMOTO Takashi <yamt@netbsd.org>
2008-05-16 09:21:59 +00:00
ad 9f56dfa520 Merge brelse() changes from the vmlocking branch. 2007-10-08 18:02:53 +00:00
msaitoh 8ce1f4fff2 fix typos 2007-04-29 20:23:34 +00:00
christos 53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
scw 4f0ca2726e Support FAT filesystems on non-DEV_BSIZE media.
Based on the patches provided in PR kern/17398 by Trevin Beattie.
2006-11-25 12:17:30 +00:00
xtraeme 729d0a0184 Apply patch from PR kern/34583 sent by Rhialto, quoting him:
"Add a 3rd entry in the cache, which keeps the end position
 from just before extending a file.
 This has the desired effect of keeping the write speed constant."

And yes, that helps a lot copying large files... always at full speed
now. This closes my PR kern/30868 "Poor performance copying large files
on msdosfs".

Also remove a 2 if-statements testing the same condition, combine them.

All that from Rhialto, thank you very much.
2006-09-22 17:45:21 +00:00
elad fc9422c9d9 integrate kauth. 2006-05-14 21:31:52 +00:00
christos 9e36ae3b49 Coverity CID 839: Add KASSERT before deref. 2006-04-15 02:58:12 +00:00
christos f16f3462cc Coverity CID 838: Add KASSERT before deref. 2006-04-15 02:56:51 +00:00
perry 0f0296d88a Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 20:45:08 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
xtraeme 47216f8470 Remove __P() 2005-08-29 23:57:35 +00:00
perry 477853c351 nuke trailing whitespace 2005-02-26 22:58:54 +00:00
christos 6bd1d6d4db Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
2004-04-21 01:05:31 +00:00
briggs 33a79483d0 Fix a panic that occurred when trying to traverse a corrupt msdosfs
filesystem.  With this particular corruption, the code in pcbmap()
would compute an offset into an array that was way out of bounds,
so check the bounds before trying to access and return an error if
the offset would be out of bounds.
2003-10-22 03:51:12 +00:00
jdolecek 98d58548c7 move msdosfs code from sys/msdosfs to sys/fs/msdosfs 2002-12-26 12:31:23 +00:00