Commit Graph

1049 Commits

Author SHA1 Message Date
pjd
6fb52e4447 MFC: Synchronize geli(8) with HEAD version. 2006-09-04 15:26:05 +00:00
pjd
69384fa213 MFC: sys/geom/mirror/g_mirror.c 1.86-1.88
sys/geom/raid3/g_raid3.c	1.70-1.72

- Don't use f-word in comments. We are gentlemans.

  Pointed out by: Maciej Sobczak

- Commit the results of the typo hunt by Darren Pilgrim.
  This change affects documentation and comments only,
  no real code involved.

  PR:			misc/101245
  Submitted by:		Darren Pilgrim <darren pilgrim bitfreak org>
  Tested by:		md5(1)
  Commit to HEAD by:	yar

- Not only a request from us can be passed to g_{mirror,raid3}_worker()
  function, but also a request to us, in which case checking bio_cflags
  is wrong, because the class above us is controling it, not we.
2006-09-04 12:55:43 +00:00
pjd
ba9933edbf MFC: sys/geom/label/g_label.c 1.21
Verify if a label doesn't point to the parent directory.
2006-09-04 12:47:19 +00:00
pjd
73a58d459c MFC: sys/geom/geom.h 1.94
sys/geom/geom_io.c	1.70

Add g_duplicate_bio() function which does the same thing what g_clone_bio()
is doing, but g_duplicate_bio() allocates new bio with M_WAITOK flag.
2006-09-03 16:28:40 +00:00
pjd
6327f7202d MFC: sys/geom/geom.h 1.95
Only check if we're freeing a valid object if we hold the topology lock.
This prevents panic under heavy load with DIAGNOSTIC compiled in.
2006-09-03 16:15:57 +00:00
cvs2svn
c222d1afc4 This commit was manufactured by cvs2svn to create branch 'RELENG_6'. 2006-08-07 23:35:50 +00:00
yar
333f9ded5a MFC rev. 1.27: Fix a misspelled module name. 2006-08-01 09:47:11 +00:00
pjd
b30a285b2c MFC: sys/geom/raid3/g_raid3.c 1.67,1.68,1.69
- Allow to close access even if device is already destroyed.
  Reported by:	Ulrich Spoerlein <uspoerlein@gmail.com>
  PR:		kern/98093

- When kern.geom.raid3.use_malloc tunnable is set to 1, malloc(9) instead of
  uma(9) will be used for memory allocation.
  In case of problems or tracking bugs, there are more useful tools for
  malloc(9) debugging than for uma(9) debugging, like memguard(9) and
  redzone(9).

- Use proper defines instead of magic values.
2006-07-16 15:59:17 +00:00
pjd
1421a9a9b1 MFC: sys/geom/raid3/g_raid3_ctl.c 1.17,1.18
- Remove bogus assertion.
  Reported by:	Bradley W. Dutton
  PR:		kern/99846

- Always allow to specify components with /dev/ prefix.
2006-07-16 15:52:03 +00:00
pjd
0802c79e9e MFC: sys/geom/mirror/g_mirror.c 1.84,1.85
- Use proper G_MIRROR_DESTROY_* defines instead of magic values.

- Allow to close access even if device is already destroyed.
  Reported by:	Ulrich Spoerlein <uspoerlein@gmail.com>
  PR:		kern/98093
2006-07-16 15:47:46 +00:00
pjd
204d4c8cee MFC: sys/geom/mirror/g_mirror_ctl.c 1.17
Always allow to specify components with /dev/ prefix.
2006-07-16 15:43:52 +00:00
simon
f39cc84bd1 MFC rev 1.90:
In g_dev_strategy(), when failing an IO request with EINVAL due to
offset or request size which is not a multiple of the sector size, make
sure that the bio is set to indicate that no data has actually been
transferred.

The result of this is that the file offset is no longer incremented for
these requests.  The fact that the file offset was incremented broke
fdisk(8)'s probing of sector size for non-512 byte sector sizes.
2006-07-12 18:51:51 +00:00
cvs2svn
d0023ab87e This commit was manufactured by cvs2svn to create branch 'RELENG_6'. 2006-06-12 22:58:51 +00:00
marcel
40a2f9e3ed MFC rev 1.38:
Fix unaligned memory accesses on Alpha and possible other platforms.

Tested by: wilko@
2006-06-11 20:02:58 +00:00
pjd
0303ba3815 MFC: sys/geom/eli/g_eli.c 1.22,1.23,1.24
sys/geom/eli/g_eli_crypto.c	1.3

Sync geli with HEAD.

- geli(8) provides keys on newsession time, so remove CRD_F_KEY_EXPLICIT flag
  as HW crypto drivers don't support it.

- Correct debug: we are sending child bio here, not parent bio.

- Pass BIO_GETATTR requests down.
2006-05-10 07:22:36 +00:00
pjd
94bc1342b1 MFC: sys/geom/raid3/g_raid3.c 1.60,1.62,1.63,1.66
sys/geom/raid3/g_raid3.h	1.18
	sys/geom/raid3/g_raid3_ctl.c	1.16

Sync graid3 with HEAD.

- Introduce and use delayed-destruction functionality from a pre-sync hook,
  which means that devices will be destroyed on last close.
  This fixes destruction order problems when, eg. RAID3 array is build on
  top of RAID1 arrays.

  Requested, reviewed and tested by:	ru

- Be sure to not destroy device twice. This is only possible in theory, but
  with this change there is even no theoretical race.

- Remove dead code.
- Comment possible event miss, which isn't critical, but probably can be
  fixed by replacing the event lock usage with the queue lock.

- Use G_RAID3_FOREACH_SAFE_BIO() macro instead of G_RAID3_FOREACH_BIO() in
  two places where g_io_request() is called. g_io_request() can free bio
  structure so we can't reference it after and G_RAID3_FOREACH_BIO() macro
  was doing this.

  Found by:	Coverity Prevent analysis tool (with my new models)
2006-05-10 07:15:37 +00:00
pjd
54f2c508d7 MFC: sys/geom/mirror/g_mirror.c 1.81,1.82,1.83
sys/geom/mirror/g_mirror.h	1.23
	sys/geom/mirror/g_mirror_ctl.c	1.16

Sync gmirror with HEAD:

- Introduce and use delayed-destruction functionality from a pre-sync hook,
  which means that devices will be destroyed on last close.
  This fixes destruction order problems when, eg. RAID3 array is build on
  top of RAID1 arrays.

  Requested, reviewed and tested by:	ru

- Be sure to not destroy device twice. This is only possible in theory, but
  with this change there is even no theoretical race.

- Remove dead code.
- Comment possible event miss, which isn't critical, but probably can be
  fixed by replacing the event lock usage with the queue lock.
2006-05-10 07:10:03 +00:00
pjd
b192452a65 MFC: sys/geom/raid3/g_raid3.c 1.65
We shouldn't lock the topology here - we will panic on assertion inside
g_raid3_bump_syncid().

Reported by:	Bradley W. Dutton <brad-fbsd-stable@duttonbros.com>
Approved by:	re (kensmith)
2006-05-02 20:41:49 +00:00
pjd
7a7ed975bf MFC: sys/geom/raid3/g_raid3.c 1.64
- Don't hold the device sx lock when going to sleep.
- Prevent possible live-lock in case of memory problems by freeing
  already completed requests first.

Reported and tested by:	markus, Bradley W. Dutton <brad-fbsd-stable@duttonbros.com>
Approved by:	re (hrs)
2006-04-29 17:50:42 +00:00
pjd
3c67ff929d Don't destroy device twice. This can lead to kernel panic on reboot/shutdown.
This is not an MFC, because the code in HEAD has other changes and there is
no such problem there.

Reported and tested by:	ken
Approved by:	re (hrs)
2006-04-26 06:35:11 +00:00
pjd
b25d80c5c8 MFC: sys/geom/raid3/g_raid3.c 1.61
Fix storing offset of already synchronized data. Offset in entire array was
stored in metadata instead of an offset in single disk.
After reboot/crash synchronization process started from a wrong offset
skipping (not synchronizing) part of the component which can lead to data
corrutpion (when synchronization process was interrupted on initial
synchronization) or other strange situations like 'graid3 status' showing
value more than 100%.

Reported, reviewed and tested by:	ru
Reported by:	Dmitry Morozovsky <marck@rinet.ru>
Approved by:	re (hrs)
2006-04-25 22:11:10 +00:00
pjd
ac5e0fe84c Sync with HEAD.
Approved by:	re (scottl)
2006-04-05 22:12:29 +00:00
sobomax
4257df9039 MFC: also look for BSD label at 512-byte offset, if we can't find
it on the very beginning of the second sector. This makes it compatible
with labels created by disklabel(8) on non-512-byte-per-sector
devices.

Approved by:	re
2006-03-23 22:40:28 +00:00
pjd
a56f321071 MFC: graid3(8)
Synchronize graid3(8) with HEAD:
- Speed up synchronization process by using configurable number of parallel
  I/O requests.
- Reimplement graid3 softc synchronization by using per-device sx(9) lock.
- Stop synchronization from pre-sync hook.
- Fix possible race between synchronization and regular requests.

Approved by:	re (mux)
2006-03-20 15:50:02 +00:00
pjd
c2dead3970 MFC: gmirror(8)
Synchronize gmirror(8) with HEAD:
- Speed up synchronization process by using configurable number of parallel
  I/O requests.
- Allow for kernel dumps to the mirror.
- Reimplement gmirror softc synchronization by using per-device sx(9) lock.
- Stop synchronization from pre-sync hook.
- Fix possible race between synchronization and regular requests.

Approved by:	re (mux)
2006-03-20 15:48:55 +00:00
jeff
1c6ee1f102 MFC Rev 1.10
VFS SMP fixes, stack api, softupdates fixes.

Sponsored by:	Isilon Systems, Inc.
Approved by:	re (scottl)
2006-03-13 03:07:01 +00:00
pjd
c44fa9d800 MFC: sys/geom/label/g_label_ufs.c 1.10
We need to check if file system size is equal to provider's size, because
sysinstall(8) still bogusly puts the first partition at offset 0 instead of 16,
so glabel/ufs will find file system on a slice instead of partition.

Before sysinstall is fixed, we must keep this code, which means that we
wont't be able to detect UFS file systems created with 'newfs -s ...'.

PS. bsdlabel(8) creates partitions properly.

Approved by:	re (hrs)
2006-03-08 14:20:14 +00:00
pjd
87912fc17a MFC: sys/geom/geom_slice.c 1.59
sys/geom/geom_slice.h	1.18

Allow to use g_slice_orphan() from outside.

Approved by:	re (scottl)
2006-03-01 17:57:11 +00:00
pjd
0536624c24 MFC: Sync with HEAD.
Approved by:	re (scottl)
2006-03-01 17:55:29 +00:00
yar
dbcb706f58 Work around the shortness of the size argument to
vnode_create_vobject() while preserving the binary ABI
to filesystem modules in RELENG_6: introduce a new function
vnode_create_vobject_off() that takes the size argument
as off_t; move all stock file systems to it; re-implement
the old vnode_create_vobject() using vnode_create_vobject_off()
so that old or binary-only FS modules can work w/o hitting the
bug.  The trick is to pass a size of 0 to vnode_create_vobject_off()
so that it will call VOP_GETATTR() and thus get the actual,
untruncated file size even if the calling module still uses
the old vnode_create_vobject().

PR:		kern/92243
Approved by:	re (scottl)
2006-02-20 00:53:15 +00:00
brueffer
72689fc263 MFC: rev. 1.18
Clean up some sysctl descriptions, debug messages etc.

Approved by:	re (scottl)
2006-02-11 08:25:22 +00:00
pjd
2e624d60b6 MFC: sys/geom/uzip/g_uzip.c 1.9
Fix bio leak in case of malloc(9) failure.

Found by:	Coverity Prevent(tm)
Coverity ID:	CID794
2006-01-25 15:55:27 +00:00
pjd
bd6b042283 MFC: sys/geom/mirror/g_mirror.c 1.69
sys/geom/raid3/g_raid3.c	1.45

Remove dead code.

Found by:	Coverity Prevent(tm)
Coverity ID:	CID104, CID105
2006-01-25 15:54:02 +00:00
pjd
d16c8aabc8 MFC: Sync with HEAD. 2006-01-17 11:49:09 +00:00
pjd
c4be8154d5 MFC: Sync with HEAD. 2006-01-17 09:28:57 +00:00
pjd
b11d89f3f9 MFC: Sync with HEAD. 2006-01-17 09:11:30 +00:00
pjd
947bbe05ee MFC: Sync with HEAD. 2006-01-17 08:59:55 +00:00
sobomax
4cfd00e6b6 MFC: NTFS label recognition module for geom_label(4). 2005-12-29 06:22:38 +00:00
sobomax
348bb8c4b9 MFC: check for g_read_data(9) errors properly. 2005-12-29 05:59:51 +00:00
sobomax
222f0ca986 MFC: kill leading witespace. 2005-12-29 05:34:46 +00:00
le
0ed7cd39d9 MFC:
Since we want a vinum geom created anytime the module loads, move the
  geom creation to a seperate init function and ignore the tasting.

  The config is now parsed only in the vinumdrive geom, which hopefully
  fixes the problem, that the drive class tasted before the vinum class
  had a chance, for good.

  Also restore the behaviour that the module can be loaded at boot time
  and on a running system.

--

  Check for g_read_data(9) errors properly;  don't pass error value
  pointer to g_read_data(9) at all if we don't have any use of it.
2005-12-10 14:36:17 +00:00
cvs2svn
5b47c5585e This commit was manufactured by cvs2svn to create branch 'RELENG_6'. 2005-12-02 00:17:35 +00:00
jdp
9bb59aa42a MFC: Fix a bug that caused some /dev entries to continue to exist after
the underlying drive had been hot-unplugged from the system.

This merges the following revisions:

  Revision  Path
  1.94      src/sys/cam/scsi/scsi_cd.c
  1.181     src/sys/cam/scsi/scsi_da.c
  1.98      src/sys/geom/geom_disk.c
  1.5       src/sys/geom/geom_disk.h
  1.88      src/sys/geom/geom_subr.c
2005-11-26 22:55:20 +00:00
le
6a3b6cb6cd MFC:
Finally bring in what was produced during Google SoC 2005:

  Add functions to rename objects and to move a subdisk from one drive
  to another.

Plus several whitespace/style fixes.
2005-11-26 11:06:11 +00:00
cvs2svn
2b0dd32330 This commit was manufactured by cvs2svn to create branch 'RELENG_6'. 2005-11-22 19:17:43 +00:00
pjd
cf1a35e6f5 Fix possible live-lock under heavy load where we can't allocate more
memory for request.
I was sure graid3 should handle such situations well, but green@ reported
it is not and we want to fix it before 6.0.

Submitted by:	green
Approved by:	re (scottl)
2005-10-28 20:27:53 +00:00
delphij
6dbb98c55a MFC (by le)
| Set the G_PF_WITHER flag on the subdisk provider that is about to
| be destroyed.  That way the GEOM system handles all deallocations
| and we don't have to do it ourselves.
|
| Revision  Changes    Path
| 1.8       +1 -34     src/sys/geom/vinum/geom_vinum_rm.c

Approved by:	re (scottl)
2005-10-09 04:37:34 +00:00
delphij
e27db9d6b8 MFC (by le)
|  Prevent that sync operations can be started when they are already
|  in progress, and be a bit more user friendly in terms of error
|  messages returned from the kernel.
|
|  Revision  Changes    Path
|  1.11      +81 -71    src/sys/geom/vinum/geom_vinum_init.c

Approved by:	re (scottl)
2005-10-09 04:36:44 +00:00
delphij
5cd27adb61 MFC (by le)
| Correct the check if a plex is accessible in case it is not up.
| This makes degraded RAID5 plexes actually work.
|
| Revision  Changes    Path
| 1.10      +1 -1      src/sys/geom/vinum/geom_vinum_volume.cle

Approved by:	re (scottl)
2005-10-09 04:35:42 +00:00
delphij
18a5a36c5c MFC (by le)
| Shuffle around the order in which the components are compiled.
|
| This way, the VINUMDRIVE class is loaded before the VINUM class,
| but since geom does the tasting for newly arrived classes
| last-in-first-out, the VINUM class tastes first.
|
| This removes the need to call gv_parse_config() in the drive
| taste path.
|
| Revision  Changes    Path
| 1.20      +4 -14     src/sys/geom/vinum/geom_vinum_drive.c
| 1.2       +1 -1      src/sys/modules/geom/geom_vinum/Makefile

Approved by:	re (scottl)
2005-10-09 04:34:29 +00:00