Commit Graph

1184 Commits

Author SHA1 Message Date
pjd
c3fbfd0542 Softc may be NULL in g_journal_orphan(), so don't be surprised. 2006-12-02 09:10:29 +00:00
pjd
fa40850739 Fix ia64 build breakage. 2006-11-02 16:24:18 +00:00
pjd
ba0f348261 - Use g_duplicate_bio() instead of g_clone_bio(), so there memory is
allocated with M_WAITOK flag.
- Check 'buf' instead of 'error' so Prevent is not confused.

CID:		1562, 1563
Found by:	Coverity Prevent analysis tool
2006-11-02 09:14:18 +00:00
pjd
9fbd00e878 I want CPU number here.
Noticed by:	ru
2006-11-02 09:01:34 +00:00
pjd
bd92877da9 Grr, fix one more build breakage. 2006-11-02 00:37:39 +00:00
pjd
b34fb80d83 Now, that we have gjournal in the tree add possibility to configure
gmirror and graid3 in a way that it is not resynchronized after a
power failure or system crash.
It is safe when gjournal is running on top of gmirror/graid3.
2006-11-01 22:51:49 +00:00
pjd
cf33008f77 Change spaces to tabs where needed. 2006-11-01 22:16:53 +00:00
pjd
d55b9d74e2 Skip disabled CPU, because after we sched_bind() to a disabled CPU,
we won't be able to exit from the thread.

Function g_eli_cpu_is_disabled() stoled from kern_pmc.c.

PR:		104669
Reported by:	Nikolay Mirin <nik@optim.com.ru>
MFC after:	1 week
2006-11-01 16:05:06 +00:00
pjd
64d3eaa81e Forgot to remove this line.
Reported by:	maxim
2006-11-01 14:09:59 +00:00
pjd
fe4b3f9ce1 Add BIO_FLUSH support to GSHSEC class. 2006-11-01 12:30:51 +00:00
pjd
457f8e4c90 Add BIO_FLUSH support to GPT class. 2006-11-01 12:29:49 +00:00
pjd
d639eb8d4b Update the code to the current sync(2) version:
- Do not modify mnt_flag without mount interlock held.
- Do not touch MNT_ASYNC flag, as this can lead to a race with nmount(2).

Pointed out by:	tegge
Reviewed by:	tegge
2006-11-01 09:37:11 +00:00
pjd
a9b80b86ae Remove debugging code I accidentally committed. 2006-11-01 01:19:13 +00:00
pjd
66101a4314 Add gjournal GEOM class (kernel side), which implements block level
journaling and can be tought about marking file system as clean before
doing journal switch, which easly allows to add journaling to file
systems that don't have this feature.

Sponsored by:	home.pl
2006-10-31 21:31:00 +00:00
pjd
c33849dc41 Implement BIO_FLUSH handling by simply passing it down to the components.
Sponsored by:	home.pl
2006-10-31 21:23:51 +00:00
pjd
67c00d09c1 Add a new disk flag - DISKFLAG_CANFLUSHCACHE, which indicates that the disk
can handle BIO_FLUSH requests.

Sponsored by:	home.pl
2006-10-31 21:12:43 +00:00
pjd
d5cc909451 Add a new I/O request - BIO_FLUSH, which basically tells providers below to
flush their caches. For now will mostly be used by disks to flush their
write cache.

Sponsored by:	home.pl
2006-10-31 21:11:21 +00:00
pjd
e4e060fa9e Guard against invalid metadata.
MFC after:	1 week
2006-10-10 15:01:47 +00:00
ru
f53bc81fe1 A GEOM cache can speed up read performance by sending fixed size
read requests to its consumer.  It has been developed to address
the problem of a horrible read performance of a 64k blocksize FS
residing on a RAID3 array with 8 data components, where a single
disk component would only get 8k read requests, thus effectively
killing disk performance under high load.  Documentation will be
provided later.  I'd like to thank Vsevolod Lobko for his bright
ideas, and Pawel Jakub Dawidek for helping me fix the nasty bug.
2006-10-06 08:27:07 +00:00
pjd
d60aaf3441 One more white space fix. 2006-09-30 08:23:06 +00:00
pjd
cb0554d5cc Remove trailing spaces. 2006-09-30 08:16:49 +00:00
pjd
8cff3b898f Remove trailing spaces. 2006-09-30 08:01:11 +00:00
pjd
5b67d8da02 Fix detecting of UFS1 label when mediasize%fragsize != 0.
Submitted by:	Stanislav Sedov
PR:		kern/84637
MFC after:	1 week
2006-09-16 11:24:41 +00:00
pjd
2e387b9b85 Add 'configure' subcommand which for now only allows setting and removing
of the BOOT flag. It can be performed on both attached and detached
providers.

Requested by:	Matthias Lederhofer <matled@gmx.net>
MFC after:	1 week
2006-09-16 10:43:17 +00:00
pjd
f5e129df20 Add __printflike() to gctl_error().
Approved by:	phk
MFC after:	1 week
2006-09-16 10:39:07 +00:00
pjd
4f982725d1 Small fixes after adding __printflike() to gctl_error().
Approved by:	phk
MFC after:	3 days
2006-09-16 09:48:29 +00:00
pjd
5d795537ae Remove extra arguments.
MFC after:	3 days
2006-09-16 07:47:57 +00:00
pjd
556424a17a Add 'show geom [addr]' ddb(4) command, which prints entire GEOM topology if
no additional argument is given or details about the given GEOM object
(class, geom, provider or consumer).

Approved by:	phk
2006-09-15 16:36:45 +00:00
pjd
610c4b7a06 Fix synchronization in gmirror and graid3 which I broken. Synchronization
request can still have bio_to set to sc_provider (this is READ part of a
synchronization request) and in this case g_{mirror,raid3}_sync() wasn't
called as it should be.

MFC after:	1 week
2006-09-13 15:46:49 +00:00
pjd
d06bfaa1a9 Delay an orphan event if provider has still in-flight I/O requests.
This way GEOM classes can safely detach from provider when an orphan
event is received. This fixes 'detach with active requests' panic for
gstripe/gconcat under load.

PR:		kern/102766
Submitted by:	mjacob
OK'ed by:	phk
MFC after:	1 week
2006-09-10 09:11:54 +00:00
jmg
ecd9e77d3e move created/detected/activated under debug level 1 to quiet the common case..
add count of active and total components to the launched line so you can
see at a glance if your mirror/raid3 is complete...

now:
GEOM_MIRROR: Device mirror/sam launched (2/2).

Reviewed by:	pjd
2006-09-09 21:45:37 +00:00
pjd
dd3e975df2 Fix format character.
Reported by:	andre
2006-09-08 13:46:18 +00:00
pjd
454c903c07 Bump copyright year. 2006-09-08 10:20:44 +00:00
pjd
bc38d5de48 Use __FBSDID in .c files. 2006-09-08 10:19:24 +00:00
pjd
40cda51553 - Split failure probability configuration into read failure probability and
write failure probability.
- Allow to specify an error number to return of failure.

MFC after:	3 days
2006-09-08 09:21:21 +00:00
pjd
5c567602d8 Fix problems with destroy and forcible destroy functionality:
- hold/release device in start/done routines, this will probably slow
  down things a bit, but previous code was racy;
- only release device if g_gate_destroy() failed - if it succeeded device
  is dead and there is nothing to release;
- various other changes which makes forcible destruction reliable.

MFC after:	3 days
2006-09-05 21:56:00 +00:00
imp
db85f415fa while (0); -> while (0) in multi-line macros 2006-08-17 22:50:33 +00:00
pjd
c0667f3ce5 Handle MSDOS file systems properly. Before the change file systems
created on Windows XP (and others maybe) were not detected.
We detected only those created with newfs_msdos(8).

Submitted by:		Tobias Reifenberger <treif@mayn.de>
style(9)ified by:	pjd
2006-08-12 15:34:15 +00:00
pjd
f615f3af6a Verify if a label doesn't point to the parent directory. 2006-08-12 15:30:24 +00:00
pjd
3a923dc027 Before using byte offset for IV creation, covert it to little endian.
This way one will be able to use provider encrypted on eg. i386 on
eg. sparc64. This doesn't really buy us much today, because UFS isn't
endian agnostic.

We retain backward compatibility by setting G_ELI_FLAG_NATIVE_BYTE_ORDER
flag on devices with version number less than 2 and not converting the
offset.
2006-08-11 19:09:12 +00:00
pjd
d9810ee8e2 Forgot to bump version number after G_ELI_FLAG_READONLY flag addition. 2006-08-11 18:39:58 +00:00
marcel
52f0123d8d Strengthen the check for a PMBR:
o PMBR partitions count to the number of partitions on the disk, which
  means that if a PMBR entry is invalid we will not treat the MBR as a
  PMBR by virtue of it not describing any partitions.
  Previously the checks were inconsistent in that an invalid PMBR entry
  would be harmless when no other partitions exist (we would treat the
  MBR as a PMBR by virtue of it being empty), but it would be fatal when
  there is at least one other partition.
o The partition size of a PMBR partition is one less than the media size
  because the GPT starts at the second sector (LBA 1) and extends to
  the end of the media. For backward bug-compatibility we accept a size
  that's exactly the media size (FreeBSD bug).
  Also, when the partition size can not be represented in a 32-bit
  integral, the partition size in the MBR is to be set to 0xFFFFFFFF.
  Accept this as a valid size, even if the size can be represented.
2006-08-09 20:53:01 +00:00
pjd
b2ae936be5 Allow geli to operate on read-only providers.
Initial patch from:	vd
MFC after:		2 weeks
2006-08-09 18:11:14 +00:00
pjd
b539048d28 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.

MFC after:	1 week
2006-08-09 09:41:53 +00:00
marcel
e4aeb824ed Fix a phase-ordering bug: check the mediasize and sectorsize after
we obtained access. It is possible that GPT gets to taste a disk
first, which means the disk has not been opened before and it will
not get opened until after we checked the mediasize and sectorsize.
However, since the mediasize and sectorsize are determined at open
and that happens when access is optained, checking the mediasize
and sectorsize before obtaining access may result in GPT rejecting
the disk.
2006-08-08 21:33:26 +00:00
yar
209e4786e7 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)
MFC after:	1 week
2006-08-04 07:56:35 +00:00
pjd
38bff79a10 Don't use f-word in comments. We are gentlemans.
Pointed out by:	Maciej Sobczak
2006-08-01 23:17:33 +00:00
yar
99e7c62f6f Fix what looks like a typo: MODULE_DEPEND() takes module names,
not KLD file names; and GELI module's name is g_eli, not geom_eli.

Approved by:	pjd (silence)
MFC after:	5 days
2006-07-27 11:52:12 +00:00
pjd
603264d10f Don't forget to initialize crp_olen field, which is used to calculate
bio_completed value.
2006-07-22 10:05:55 +00:00
pjd
27c2ca3212 Always allow to specify components with /dev/ prefix.
MFC after:	3 days
2006-07-13 20:37:59 +00:00