Commit Graph

1092 Commits

Author SHA1 Message Date
reinoud
7cbe9b45a2 Fix uid/gid check; it was checking if the old values would fit in 32 bits
instead of checking if the new values would.
2009-07-30 12:13:51 +00:00
reinoud
dde01096c4 Re-do nilfs_load_super_root() and implement crc checking of read in super root
to check for consistency.

Since a new crc-seed is chosen on each new nilfs formatting, older structures
will fail the crc check.
2009-07-29 17:06:57 +00:00
reinoud
59cef39273 Add debugging text to indicate a super root has been found while searching for
it.
2009-07-29 13:23:23 +00:00
reinoud
ad5a398ed7 Enhance/fix read support for sparse files.
Extents read in wich there were no mappings at all were defined would error
out and files beginning with a sparse area were erroring out.
2009-07-28 15:31:21 +00:00
reinoud
1f6bbe277a System nodes are not written out on becomming inactive; they should be written
out before automatically.

However, when dealing with faulty discs that fail to mount, system nodes are
of course not written out and thus may still be marked dirty, if only due to
access. Especially on sequential media this gave rise to panics on reading
trackinfo since the write track section had not yet been initialised.
2009-07-27 13:20:41 +00:00
reinoud
09d39e1a6c Issue extra synchronise caches before closing tracks or sessions. It shouldn't
be needed as the caches should already be synchronised, but better be safe.
2009-07-27 13:13:33 +00:00
reinoud
69a586f230 Import read-only part of the NiLFS (v2) implementation for NetBSD. It has been
tested with a DEBUG+DIAGNOSTIC+LOCKDEBUG kernel. To summerise NiLFS, i'll
repeat my posting to tech-kern here:

NiLFS stands for New implementation of Logging File System; LFS done
right they claim :) It is at version 2 now and is being developed by NTT, the
Japanese telecom company and recently put into the linux source tree. See
http://www.nilfs.org. The on-disc format is not completely frozen and i expect
at least one minor revision to come in time.

The benefits of NiLFS are build-in fine-grained checkpointing, persistent
snapshots, multiple mounts and very large file and media support. Every
checkpoint can be transformed into a snapshot and v.v. It is said to perform
very well on flash media since it is not overwriting pieces apart from a
incidental update of the superblock, but that might change. It is accompanied
by a cleaner to clean up the segments and recover lost space.

My work is not a port of the linux code; its a new implementation. Porting the
code would be more work since its very linux oriented and never written to be
ported outside linux. The goal is to be fully interchangable. The code is non
intrusive to other parts of the kernel. It is also very light-weight.

The current state of the code is read-only access to both clean and dirty
NiLFS partitions. On mounting a dirty partition it rolls forward the log to
the last checkpoint. Full read-write support is however planned!

Just as the linux code, mount_nilfs allows for the `head' to be mounted
read/write and allows multiple read-only snapshots/checkpoint mounts next to
it.

By allowing the RW mount at a different snapshot for read-write it should be
possible eventually to revert back to a previous state; i.e. try to upgrade a
system and being able to revert to the exact state prior to the upgrade.

Compared to other FS's its pretty light-weight, suitable for embedded use and
on flash media. The read-only code is currently 17kb object code on
NetBSD/i386. I doubt the read-write code will surpass the 50 or 60. Compared
this to FFS being 156kb, UDF being 84 kb and NFS being 130kb. Run-time memory
usage is most likely not very different from other uses though maybe a bit
higher than FFS.
2009-07-18 16:31:41 +00:00
apb
0a2587be49 Initialise the "fork" local variable in hfslib_get_file_extents().
This variable was not actually used uninitialised, but some compilers
(e.g. gcc-4.3.3) warned that the variable might be used uninitialised.
Inspired by PR 41255 from Kurt Lidl.
2009-07-14 21:12:18 +00:00
reinoud
77a7c01d68 Fix alternating oddity in RMW strategy. Even when in the reading state it
would push out elements to fillup-read only when the time had come for them.
This could then trickle feed the read queue slowly, but fast enough to prevent
it from switching state.
2009-07-08 19:04:08 +00:00
reinoud
ff90f0d37d Remove unused LIST_ENTRY()'s now replaced by the rbtree. 2009-07-08 14:53:23 +00:00
reinoud
7f0e98bc0d Since OSTA has not defined a good set of flags to cover our flags, its not
usefull to implement chflags(). Instead ignore it for now since the error
codes might confuse esp. gui's.
2009-07-08 14:46:55 +00:00
reinoud
c093c2520a Replace the old hashtable and sorted list implemenation by a RB-tree.
Benefits are significant speed improvements on node creation/insertion while
keeping the lookup times low and still allowing sequential iteration over the
nodes.
2009-07-07 10:23:36 +00:00
reinoud
4eb9ccfea3 Re-implement read-modify-write backend strategy. This version is a lot more
clean locking-wise and will consume less CPU power on needless moving-around.
2009-07-06 17:13:38 +00:00
reinoud
0a3cb580be Reduce the number of active ecclines; low memory systems could get into
trouble otherwise.

XXX this value should be computed eventually.
2009-07-06 17:08:04 +00:00
reinoud
2f9a24b61c Make source prettier 2009-07-06 17:06:57 +00:00
cegger
d6fd22aa8b make this build w/o SMB_VNODE_DEBUG 2009-07-04 07:36:46 +00:00
elad
1d5d8311da Fix cut/paste error and put back a missing variable. 2009-07-04 00:03:22 +00:00
pgoyette
c13b143ea3 Pass the vp arg to udf_check_possible() so we can access its v_mount
member.

XXX No idea if this is the right solution to this problem, but it does
XXX at least allow thebuild to continue.  The original committed should
XXX verify that this does what was intended!

(Hello again, Elad)
2009-07-03 23:14:11 +00:00
pgoyette
c2a56cbb37 Define error before using it.
(Hello again, elad!)
2009-07-03 22:38:08 +00:00
pooka
512aa8b607 Fix utterly botched previous commit. efs compiles now and apprears
to work, but the person doing the original change should verify
that it actually works like before the change.

(hi, elad!)
2009-07-03 22:25:51 +00:00
elad
009f5d2f88 Where possible, extract the file-system's access() routine to two internal
functions: the first checking if the operation is possible (regardless of
permissions), the second checking file-system permissions, ACLs, etc.

Mailing list reference:

	http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005311.html
2009-07-03 21:17:40 +00:00
njoly
fbe16f2ec1 Directory open with NT_SMBS capability require the NOPEN bit to be set
too.
2009-07-03 18:35:33 +00:00
reinoud
2a23ff6c30 Enhance dumping on buffer screwup. Also prevent races or invalid combinations
to exist for ecclines.
2009-07-02 16:56:35 +00:00
njoly
84a85be4f9 Fix some panics while trying to umount a smbfs share.
Be sure that no other active vnodes remains, before trying to release
the root one. Likewise, do not destroy the smbmount specific structure
if the umount will fail (busy conditions).

No objection from pooka@.
2009-07-02 16:17:52 +00:00
dholland
effcf1af5c Convert 67 namei call sites to use namei_simple, in these functions:
check_console, veriexecclose, veriexec_delete, veriexec_file_add,
emul_find_root, coff_load_shlib (sh3 version), coff_load_shlib,
compat_20_sys_statfs, compat_20_netbsd32_statfs,
ELFNAME2(netbsd32,probe_noteless), darwin_sys_statfs,
ibcs2_sys_statfs, ibcs2_sys_statvfs, linux_sys_uselib,
osf1_sys_statfs, sunos_sys_statfs, sunos32_sys_statfs,
ultrix_sys_statfs, do_sys_mount, fss_create_files (3 of 4),
adosfs_mount, cd9660_mount, coda_ioctl, coda_mount, ext2fs_mount,
ffs_mount, filecore_mount, hfs_mount, lfs_mount, msdosfs_mount,
ntfs_mount, sysvbfs_mount, udf_mount, union_mount, sys_chflags,
sys_lchflags, sys_chmod, sys_lchmod, sys_chown, sys_lchown,
sys___posix_chown, sys___posix_lchown, sys_link, do_sys_pstatvfs,
sys_quotactl, sys_revoke, sys_truncate, do_sys_utimes, sys_extattrctl,
sys_extattr_set_file, sys_extattr_set_link, sys_extattr_get_file,
sys_extattr_get_link, sys_extattr_delete_file,
sys_extattr_delete_link, sys_extattr_list_file, sys_extattr_list_link,
sys_setxattr, sys_lsetxattr, sys_getxattr, sys_lgetxattr,
sys_listxattr, sys_llistxattr, sys_removexattr, sys_lremovexattr

All have been scrutinized (several times, in fact) and compile-tested,
but not all have been explicitly tested in action.

XXX: While I haven't (intentionally) changed the use or nonuse of
XXX: TRYEMULROOT in any of these places, I'm not convinced all the
XXX: uses are correct; an audit might be desirable.
2009-06-29 05:08:15 +00:00
reinoud
7e99247bdd Fix corner-case in truncing files. It could forget to free the last block.
This would result in a free-space map with one block orphaned.
2009-06-27 13:42:06 +00:00
reinoud
5e29d1224f Rewrite of udf_on_rootpath(), and vop_rename() code that calls it, after the
UFS way. The tree walking is now done the same and the code hasn't locked up
on examples that made it lockup before.
2009-06-25 17:16:33 +00:00
reinoud
706de0e547 Commit first stage of free-space accounting. It is estimating the underlimit
of free blocks on the device and when free blocks are getting tight it tries
to readjust/recalculate that value by syncing the FS.

Second stage will be resizing the data/metadata partitions.
2009-06-24 17:09:13 +00:00
reinoud
c2fd371267 Bump the NetBSD kernel UDF id to version 0.5 2009-06-23 20:13:37 +00:00
reinoud
75bab0f5ee Renaming in UDF was already possible but directories could only be renamed in
the same directory.

This patch finally allows a directory to be moved between parent directories.
2009-06-23 20:09:07 +00:00
elad
870920260d Move the implementation of vaccess() to genfs_can_access(), in line with
the other routines of the same spirit.

Adjust file-system code to use it.

Keep vaccess() for KPI compatibility and to keep element of least
surprise. A "diagnostic" message warning that vaccess() is deprecated will
be printed when it's used (obviously, only in DIAGNOSTIC kernels).

No objections on tech-kern@:

	http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005310.html
2009-06-23 19:36:38 +00:00
njoly
0cef178686 Fix compilation with SMB_*_DEBUG options. 2009-06-22 21:13:50 +00:00
reinoud
c76ee53287 Add overlooked `cred' declaration in udf_write() when i committed the catchup
patches.
2009-06-18 15:51:44 +00:00
reinoud
8f6cc2bd0e Pass-on credentials to size reversal on aborted write due to error. It could
be that in the future this credentials need to be changed to allways-allow
since its an reverting-on-error behaviour.
2009-06-18 15:15:10 +00:00
reinoud
9cf321ebdd Fix nitpicky spacing and debug printout 2009-06-18 15:09:18 +00:00
reinoud
66e7de7ac6 Remove unneeded (and unused) inclusion of "opt_quota.h" 2009-06-18 15:06:38 +00:00
reinoud
b32db61b9b Enhance comment on node locking when writing out a node's descriptors. 2009-06-18 15:03:34 +00:00
reinoud
45929a2856 Remove unneeded wait for SYNC being finished on node disposal of deleted node;
this could interfere and lockup.
2009-06-18 15:01:34 +00:00
reinoud
ba587e2e62 Add RESERVE bitmask flag to DEBUG print constants adding another 0 prefix to
the constants already defined.
2009-06-18 14:57:50 +00:00
reinoud
96a16f2f23 Remove now unused UDF_DIRHASH constants 2009-06-18 14:56:09 +00:00
reinoud
b33f7bb0ef Retire IN_CALLBACK_ULK flagging since its not used anymore and the old
assertions on it would trigger without cause.
2009-05-20 15:30:26 +00:00
reinoud
2d212d801f Descriptor version is 16 bit and not 8 so use udf_rw16() to access them.
UniqueID was written in the logical volume integrity without byteswapping for
bigendian machines.
2009-05-20 13:25:50 +00:00
reinoud
2b1b74bba4 Account for the logical blocks recorded by the extent in the right endian! 2009-05-19 16:24:05 +00:00
reinoud
e186770777 On creation of a new node, don't forget to set the length of the allocated
space in the right endian!
2009-05-19 16:06:56 +00:00
reinoud
c3511553ae Forgot to use the udf_rw16() on the descriptor crc lengths of FID's!
Also fix a few dubiously formatted checks.
2009-05-19 15:08:42 +00:00
reinoud
fbd470bae3 A descriptor's CRC lenth is 16 bit so use udf_rw16() on tag.desc_crc_len. 2009-05-19 15:07:20 +00:00
reinoud
c469916e3d ANSI-fy. No idea why they weren't so in the first place. 2009-05-18 21:09:54 +00:00
reinoud
937ed04261 Fix *serious* bug in bswapping definitions for big endian machines. 2009-05-18 20:52:24 +00:00
reinoud
7b913c191b Make ecma167 header file compilable by pcc 2009-05-18 20:51:03 +00:00
pooka
c94cfd7632 add some todo-items, based on a file which was lingering in my
local tree for apparently almost two years now
2009-05-18 15:47:28 +00:00