summaryrefslogtreecommitdiff
path: root/sys/ufs/ffs
AgeCommit message (Collapse)Author
2012-12-10Fix potential for use-after-free of bufs in softdep.Bob Beck
Softdep uses it's own "getdirtybuf" which has (always) potentially slept - this wasn't noticable when buffers were static and never freed, however now that the bufs it was trying to busy is might have been written out and freed by someone else we can see use-after free if we fast-recycle buffers. We fix this by either re-trying operations or ensuring we don't use the buf pointer after waiting. ok guenther@ (in coimbra)
2012-09-17fix uninitialized pointer in ffs_write(); ok guenther, beck, deraadtMarkus Friedl
2012-09-10Cleanup VFS mount string handling:Joel Sing
- Avoid using copyinstr() without checking the return value. - sys_mount() has already copied the path in, so pass this to the filesystem mount code so that it does not have to copy it in again. - Avoid copyinstr()/bzero() dance when we can simply bzero() and strlcpy(). ok krw@
2012-07-11If the current offset is strictly less than the process filesizePhilip Guenthe
rlimit, then a write that would take it over the limit should be clamped, making it a partial write. ok beck@
2012-06-10Do NOT make all check condition results report EIO. Only use EIOKenneth R Westerback
when b_error has not already been set to something more informative, e.g. EROFS. DO check the result of ffs_sbupdate() and error out of a mount() call when ffs_sbupdate() reports EROFS while attempting a rw mount. Letting RW mounts proceed regardless of EROFS led to crashes and usb problems for Oliver Seufer while using the RW/RO switches on some usb devices. Fix developed using devices kindly supplied by Oliver & Co. ok miod@
2012-03-23Make rusage totals, itimers, and profile settings per-process insteadPhilip Guenthe
of per-rthread. Handling of per-thread tick and runtime counters inspired by how FreeBSD does it. ok kettenis@
2011-09-18Fix more printf format string bugs in sys/ufs.Alexander Bluhm
ok miod
2011-09-18Make sure daddr64_t values get printed with %lld.Miod Vallat
ok deraadt@
2011-08-17remove the clamping of max_softdeps as it makesThordur I. Bjornsson
softdeps almost totally unusable;
2011-08-16Put back the pedro diff for VOP_FSYNC of softdep when itsThordur I. Bjornsson
limit is reached. Added twist, clamp the max_softdeps to 64 as it is still possible to exhaust bufkva.
2011-08-03back out pedro diff for VOP_FSYNC of softdep when limit is reached.Bob Beck
The basic analysys is correct, however, the problem in this case is that by forcing softdept to synchornously flush everything across *all* softdep filesystems we cause a huge performance problem when we take a 3 second pause and slam everything synchronously. the right way to fix this is to fix the speedup_softdep code, not make the filesystem go synchronous when we hit a limit - if we are doing that we may as well not run softdep it will be faster. ok deraadt@
2011-07-04move the specfs code to a place people can see it; ok guenther thib krwTheo de Raadt
2011-07-04bread does nothing with its ucred argument. remove it. ok matthewTed Unangst
2011-07-03correctify NULL 0 confusionTed Unangst
2011-07-02Getting a disklabel to extract d_secsize to initialize a variable that is thenKenneth R Westerback
re-initialized before use is silly. ffs shouldn't know of or worry about the physical disk sector size. ok thib@
2011-07-02rename VFSDEBUG to VFLCKDEBUG;Thordur I. Bjornsson
prompted by tedu@
2011-06-29ansi softdep, ok deraadtTed Unangst
2011-06-09In ffs_write, do not deref to get the p_ucred for VOP_FSYNC (aka ffs_fsync)Theo de Raadt
when softdep runs out, since it does not use it. In the nfsiod case, that ucred is pointless, and ffs_fsync does not use it in any case. This does not conflict with thib's plans moving forward ok thib
2011-04-12Avoid kvm starvation due to softdeps waiting on too many mapped buffers,Bob Beck
thus possibly consuming all of our available kva mapping buffers for deps. Diff and analysis actually comes from Pedro Martelleto (thanks!) tested by me and thib ok thib@, art@
2011-04-05Every single vop_default is set to eopnotsupp, so retire itThordur I. Bjornsson
and return EOPNOTSUPP directly from the VOP_* functions. Filesystems should, at some point fill in every function in the vop_default struct so we can get rid of the 'if' statements in VOP_*.
2010-12-29remove two unnecessary comments that snuck in with previous.Thordur I. Bjornsson
2010-12-21Bring back the "End the VOP experiment." diff, naddy's issues whereThordur I. Bjornsson
unrelated, and his alpha is much happier now. OK deraadt@
2010-09-10Backout the VOP diff until the issues naddy was seeing on alpha (gcc3)Thordur I. Bjornsson
have been resolved.
2010-09-06End the VOP experiment. Instead of the ridicolusly complicated operationThordur I. Bjornsson
vector setup that has questionable features (that have, as far as I can tell never been used in practice, atleast not in OpenBSD), remove all the gunk and favor a simple struct full of function pointers that get set directly by each of the filesystems. Removes gobs of ugly code and makes things simpler by a magnitude. The only downside of this is that we loose the vnoperate feature so the spec/fifo operations of the filesystems need to be kept in sync with specfs and fifofs, this is no big deal as the API it self is pretty static. Many thanks to armani@ who pulled an earlier version of this diff to current after c2k10 and Gabriel Kihlman on tech@ for testing. Liked by many. "come on, find your balls" deraadt@.
2010-07-23Improve English.Ray Lai
Help by jmc, earlier version OK thib krw
2010-07-13fix overflow of dirsize; from FreeBSD; PR 6426; ok beck@ millert@Otto Moerbeek
2010-06-29remove lies. the arguments are actually used.Thordur I. Bjornsson
2010-06-09Teach FFS mounts about disklabel UIDs. This allows file systems to beJoel Sing
mounted by specifying a disklabel UID followed by a dot and a partition. For example: mount -t ffs 0123456789abcdef.a /mnt ok otto@
2010-05-18dont let sys/ioctl.h imply that you get the ioctls in dkio.h. thisDavid Gwynne
gets rid of #include <sys/dkio.h> in sys/ioctl.h and adds #include <sys/dkio.h> to the places that actually want and use the disk ioctls. this became an issue when krw@'s X build failed when he was testing a change to dkio.h. tested by krw@ help from and ok miod@
2010-03-29Initialize various uninitialized variables. Found by jsg@ via Clang.Kenneth R Westerback
Feedback from miod@ and kettenis@. ok beck@
2010-01-16Remove dead assignment and newly created unused variable.Charles Longeau
Found by LLVM/Clang Static Analyzer. ok tedu@ thib@
2009-12-19Re-introduce the remaining bits of thib@'s Aug 2006 VOP_CLOSE()Kenneth R Westerback
locking fixes. Tweak cd9660 code to be the same as everywhere else, no functional change. ok beck@
2009-09-03- fix two more format strings wrt daddr64_t valuesJasper Lievisse Adriaanse
"sure" deraadt@, ok otto@
2009-08-14- use u_char consistentlyJasper Lievisse Adriaanse
- minor formatting ok oga@ otto@
2009-08-14- fix format string for daddr64_t to %lldJasper Lievisse Adriaanse
ok otto@
2009-08-13- remove super-obvious comments from $fs_vnodeop_entries[]Jasper Lievisse Adriaanse
prodded by and ok thib@ agreed by art@ and blambert@
2009-07-09Remove the VREF() macro and replaces all instances with a call to verf(),Thordur I. Bjornsson
which is exactly what the macro does. Macro's that are nothing more then: #define FUNCTION(arg) function(arg) are almost always pointless and should go away. OK blambert@ Agreed by many.
2009-06-25backout the buf_acquire() does the bremfree() since all callersThordur I. Bjornsson
where doing bremfree() befure calling buf_acquire(). This is causing us headache pinning down a bug that showed up when deraadt@ too cvs to current, and will have to be done anyway as a preperation for backouts. OK deraadt@
2009-06-06All caller of buf_acquire were doing bremfree before the call.Artur Grabowski
Just put it in the buf_acquire function. oga@ ok
2009-06-02blkno's are 64 bit so need %llu, found by ParfaitTheo de Raadt
ok oga
2009-01-17Use proper assignment macros for dinode manipulations instead ofAlexander Yurchenko
abusing the DIP() macro which is an rvalue and can't be used as an lvalue. No functional changes. ok tedu@ pedro@
2009-01-15Use proper *_ASSIGN() macros in assigments instead of abusing rvalue macros.Alexander Yurchenko
No binary change. ok tedu@ My 1000th commit!
2008-11-06use PAGE_SIZE in FS_KERNMAXFILESIZE() use, note this is not the same as ↵Theo de Raadt
getpagesize() elsewhere. otto, please fix correctly after
2008-11-06Have called pass pagesize into FS_KERNMAXFILESIZE(), because there is noTheo de Raadt
automatic symbol that has this information. PAGE_SIZE is simply not portable, or even fixed on some systems. ok otto
2008-11-02introduce a macro for max file size, instead of hardcoding it; okOtto Moerbeek
millert@
2008-09-12Remove bzero/memset calls after pool_gets by passing the PR_ZEROBret Lambert
flag to the pool_get call. ok art@, krw@
2008-08-08Admit b_blkno means block number; a block is DEV_BSIZE (a.k.a.Kenneth R Westerback
512) bytes; ffs is inextricably tied to using b_blkno and disklabel always uses sectorsize units. Thus use DEV_BSIZE units for all fields describing ffs filesystems and convert to/from sectors where required. This enables the creation and use of ffs filesystems on non-512 byte sectorsize devices. This diff allows i386 and sgi (the two test platforms) to find disklabels that are not on a sectorsize boundary. Same change to further archs coming. This is a no-op on 512-byte sectorsize devices. This work triggered by jsing@'s need to create ffs filesystems on sgi cdroms so we can create cdrom install media for sgi. sgi testing by jsing@ ok jsing@ pedro@ "looks sane" beck@ weingart@
2008-08-08use cgbase() instead of doing arthmetic on fs_fpg when calculatingThordur I. Bjornsson
block# too ensure proper casting. From FreeBSD; ok miod@, pedro@, blambert@
2008-08-08spacing + wrap a line at 79chars.Thordur I. Bjornsson
2008-08-02fix printf format specifiers; ok krw@ millert@ deraadt@Otto Moerbeek