Commit Graph

1939 Commits

Author SHA1 Message Date
drochner
5724e77fda Implement experimental support to pass notifications that a file
was deleted from the filesystem to the disk driver, commonly
known as "discard" or "trim".
fs/driver support is in ffs and ata wd for now.
This is what was posted here:
http://mail-index.netbsd.org/tech-kern/2012/02/28/msg012813.html
with minor cleanup, and the global switch replaced by a mount option.
2012-10-19 17:09:06 +00:00
ttoth
bca84b9e1f CHFS comments 2012-10-19 12:44:39 +00:00
dholland
6c1de0eff5 Add an XXX comment about a broken error case in ufs_dirremove.
(this was in one of my old rename patches)
2012-10-14 23:57:32 +00:00
bouyer
a2d3f5532c Fix quota2 list corruption issue when defaultquotas are 0 (deny any file
and block allocation).

When quota2_check() is called with an uid not yet in the list,
getinoquota2() will call quota2_q2ealloc() to allocate a new entry for this
uid. quota2_q2ealloc() will remove an entry from the free list and
put it at the head of the corresponding hash list, and flush the block
containing the header if it's not the one also containing the allocated entry.
quota2_q2ealloc() then return the alocated entry and corresponding block
to caller (getinoquota2() here), which returns it to quota2_check().
quota2_check() then checks if the allocation can succeed, and returns and
error if not and calls brelse() on the buffer (because from his POW no
change was made to the entry), effectively discarding changes
to the entry that may have been made by quota2_q2ealloc().
Fix by always bwrite()ing the entry in quota2_q2ealloc(), and re-reading
the entry in caller.
2012-09-27 07:47:56 +00:00
manu
dbb40afdd6 Fix unmount returnign EBUSY if an attribute was autocreated: we hold
a useless reference that we never gave back
2012-09-10 14:00:15 +00:00
manu
73a4ed62d1 Stop extended attributes at the appropriate place so that unmount
does not fail with EBUSY on filesystem with extended attributes ensabled.
2012-09-10 07:57:50 +00:00
manu
bd4473d64d Temporary fix for quotactl authorization: it must use the effective UID
and not the real UID.

Further work is required to move the check to the kauth listener instead
of having it in UFS code.
2012-09-09 04:27:49 +00:00
christos
56494a63c4 really print the incompatible bits. 2012-09-01 17:01:24 +00:00
chs
e17cae4e52 when failing a mount due to unsupported features,
print which features are involved.
2012-09-01 15:46:11 +00:00
dholland
6f1deef47f Move INITQFNAMES to the right header file. 2012-08-26 02:32:14 +00:00
ttoth
621ca7dac4 chfs: uappnd flag patch 2012-08-23 11:29:51 +00:00
ttoth
8a77fce611 chfs: fixed truncating 2012-08-22 09:20:13 +00:00
ttoth
36435346bd chfs fixes
1. nodes are obsoleted only once during truncating a file
2. frags don't stay in pool_cache
2012-08-13 13:12:51 +00:00
ttoth
3fae61ee8c chfs bugfix [node was obsoleted twice] 2012-08-10 09:26:58 +00:00
dholland
25f0cf9440 Restore accidentally lost initialization of quotatypes[].
Fixes (null) in the kernel message triggered when you go over quota, and
maybe other things. Reported by Matthew Mondor.
2012-07-29 08:32:27 +00:00
rmind
d65753d972 Move some the test for MAKEENTRY into the cache_enter(9). Make some
variables in vfs_cache.c static, __read_mostly, etc.

No objection on tech-kern@.
2012-07-22 00:53:18 +00:00
matt
7d217c32d0 Convert a KDASSERT to a KDASSERTMSG 2012-07-09 11:20:22 +00:00
riastradh
482b8291f9 Use two separate comments for stub where IN_RENAME was. 2012-06-04 22:01:07 +00:00
riastradh
b8c3b27f99 Kill the IN_RENAME in-core inode flag in ufs and ext2fs.
Now that rename works we need not to wave this sort of voodoo at it.

ok dholland
2012-06-04 20:13:47 +00:00
riastradh
93765c12f0 Fix typo in comment: bp->b_bcount, not bp->b_count. 2012-06-04 19:58:57 +00:00
riastradh
2881e7e069 Fix ext2fs's scary cross-block directory message too.
(See rev. 1.3 of sys/ufs/ufs/ufs_rename.c for the analysis.)
2012-06-04 19:45:59 +00:00
riastradh
487d92ffe0 Kill scary message about cross-block directories and fix its cause.
Add a bunch of kasserts to check more stringently that ufs_direnter
did not compact across directory blocks.  Don't bother fetching
subsequent I/O blocks from the directory: ufs_lookup guarantees that
it's not necessary, and the kasserts check this to be sure.

The message fired when we were looking at the start of an I/O block,
not when we crossed from the end of one to the start of another.  I
believe it fired only when tulr->ulr_offset was a multiple of the I/O
block size (fs_bsize), which can happen if ufs_lookup either finds an
entry or finds free space at the start of an I/O block.

If ufs_lookup found an entry, none of this ulr recalculation logic
should kick in -- if tvp != NULL, then tulr->ulr_count is garbage, so
it's not merely unnecessary but wrong (although I suspect harmless in
the end) to read it in ufs_rename_overlap_p in consideration of
whether to recalculate fulr.

Discussed with chuq and dholland.

ok dholland
2012-06-04 19:37:36 +00:00
riastradh
3ce4df2ac9 Tidy up some typos and vestiges in comments after the ulr changes. 2012-06-04 16:46:45 +00:00
riastradh
d9d99dd6dc Swap byte order of ext2fs_direct fields in ext2fs_rename_recalculate_fulr.
Symptom found and fix tested by martin.

ok martin
2012-05-10 19:08:34 +00:00
riastradh
dae16d94fa Disable scary but probably harmless printf.
Still need to find why this harmless-but-shouldn't-happen case is
happening, but in the mean time, we can stop scaring people with it.
2012-05-10 07:57:02 +00:00
riastradh
aeadee1d6d Adapt ffs, lfs, and ext2fs to use genfs_rename.
ok dholland, rmind
2012-05-09 00:21:17 +00:00
yamt
9b10dd1106 comments and cosmetics. no functional changes. 2012-05-05 04:08:53 +00:00
manu
7f8940a8ce Return ENODATA when no attribute is found, like Linux does. After
all we decided to adopt the Linux API, therefore there is rationale
to stick to it.

No standard tells us what to do, and our extended attribute API has not
been used in a release, therefore we do not break anything, and we get
more easily compatible with programs using the Linux extended attribute
API.

Note that FreeBSD and MacOS X return ENOATTR. FreeBSD has its own API
and MacOS X has a Linux-like API. How did the world get so complicated?
2012-05-01 07:48:25 +00:00
rmind
f1d428af19 - Replace some malloc(9) uses with kmem(9).
- G/C M_IPMOPTS, M_IPMADDR and M_BWMETER.
2012-04-30 22:51:27 +00:00
chs
8306a9eddf change vflushbuf() to take the full FSYNC_* flags.
translate FSYNC_LAZY into PGO_LAZY for VOP_PUTPAGES() so that
genfs_do_io() can set the appropriate io priority for the I/O.
this is the first part of addressing PR 46325.
2012-04-29 22:53:59 +00:00
drochner
de54f242ed everywhere else it is assumed that the filesystem block size fits into
a 32-bit "int" -- do the cast to quell a compiler warning in a more
sensible way
2012-04-23 17:19:00 +00:00
christos
fe0d6a4e66 one more cast 2012-04-20 02:07:43 +00:00
christos
99b2fa090d Fix signed/unsigned issues. 2012-04-19 17:25:38 +00:00
ttoth
c1270f067c chfs/debug.c deleted from files.ufs 2012-04-19 15:55:40 +00:00
joerg
e3482212aa Don't depend on implicit enum casts, be explicit. 2012-04-18 13:31:10 +00:00
christos
ec252a38db it is not an error if the kernel needs to clear the setuid/
setgid bit on write/chown/chgrp
2012-04-17 19:15:15 +00:00
ttoth
8be0dba80d prepare for chfs's makefs 2012-04-13 14:50:35 +00:00
ttoth
4024b54911 using chtype on media instead of vtype
debug.c deleted
2012-04-12 15:31:01 +00:00
tron
fe27549953 Assert that we can a valid inode when looking up a file handle. 2012-04-04 19:52:48 +00:00
wiz
eb52893a29 Fix wrong variable in snprintf. From Henning Petersen in PR 46259,
ok manu@
2012-03-26 11:03:43 +00:00
hannken
88f39ca44e Fix last commit that broke lookup for dot with op DELETE.
Reviewed by: David Holland <dholland@netbsd.org>
2012-03-16 08:39:54 +00:00
elad
0c9d8d15c9 Replace the remaining KAUTH_GENERIC_ISSUSER authorization calls with
something meaningful. All relevant documentation has been updated or
written.

Most of these changes were brought up in the following messages:

    http://mail-index.netbsd.org/tech-kern/2012/01/18/msg012490.html
    http://mail-index.netbsd.org/tech-kern/2012/01/19/msg012502.html
    http://mail-index.netbsd.org/tech-kern/2012/02/17/msg012728.html

Thanks to christos, manu, njoly, and jmmv for input.

Huge thanks to pgoyette for spinning these changes through some build
cycles and ATF.
2012-03-13 18:40:26 +00:00
christos
9d4f4a850b Make this compile again. From Paul Fleischer. 2012-02-28 02:48:39 +00:00
joerg
f3103aad9c Make sure that __BEGIN_DECLS and __END_DECLS are paired. 2012-02-23 22:33:33 +00:00
matt
2d7141bca8 Eliminate a common in a header file (add a missing extern) and
declare it in the approriate C file.
2012-02-18 06:13:23 +00:00
perseant
ed08fe6512 Pass t_renamerace and t_rmdirrace tests.
Adapt dholland@'s fix to ufs_rename to fix PR kern/43582.  Address several
other MP locking issues discovered during the course of investigating the
same problem.

Removed extraneous vn_lock() calls on the Ifile, since the Ifile writes
are controlled by the segment lock.

Fix PR kern/45982 by deemphasizing the estimate of how much metadata
will fill the empty space on disk when the disk is nearly empty
(t_renamerace crates a lot of inode blocks on a tiny empty disk).
2012-02-16 02:47:54 +00:00
dholland
602a9ede7c Fix another problem with quota cursor iteration. ok riz 2012-02-13 06:23:41 +00:00
dholland
7609b9bc56 Migrate one last leftover bit (used only by the kernel now) to
sys/ufs/ufs and remove the old quota headers and no-longer-used shared
code. Ok by releng.
2012-02-05 14:19:02 +00:00
matt
ded3ab848b Make this compile on vax (uninitialized use warning). 2012-02-02 03:00:48 +00:00
dholland
d2d6fa0ae1 Improve the names of some members of struct quotactl_args. These are
effectively function parameter names, but since they need to be
described with the same names in the man page the choices do matter.
Some.
2012-02-01 05:43:53 +00:00