[DRBD-cvs] r1900 - in trunk: . debian drbd drbd/linux testing/CTH
user
www-data
www-data at linbit.com
Tue Jul 26 14:05:30 CEST 2005
Author: lars
Date: 2005-07-26 14:05:27 +0200 (Tue, 26 Jul 2005)
New Revision: 1900
Modified:
trunk/
trunk/ChangeLog
trunk/Makefile
trunk/debian/changelog
trunk/drbd.spec.in
trunk/drbd/Makefile
trunk/drbd/drbd_actlog.c
trunk/drbd/drbd_fs.c
trunk/drbd/drbd_int.h
trunk/drbd/drbd_main.c
trunk/drbd/drbd_receiver.c
trunk/drbd/drbd_req.c
trunk/drbd/linux/drbd.h
trunk/testing/CTH/CTH_bash.helpers
trunk/testing/CTH/functions.sh
trunk/user/drbd_limits.h
trunk/user/drbdadm.h
trunk/user/drbdadm_main.c
trunk/user/drbdadm_parser.y
trunk/user/drbdadm_scanner.fl
trunk/user/drbdsetup.c
Log:
monster merge of changes from the drbd-0.7 branch
supervised svnp run r1763 to r1899
r1763 | phil | 2005-02-17 15:14:10 +0100
M /branches/drbd-0.7/drbd.spec.in
To make building RPMs on RHAS4 work.
r1766 | phil | 2005-03-08 09:29:24 +0100
M /branches/drbd-0.7/drbd/drbd_int.h
M /branches/drbd-0.7/drbd/drbd_main.c
The busy_blocks construct was replaces by the resync lru_cache,
long before drbd-0.7 became stable. Removed that little leftover.
r1773 | phil | 2005-04-01 11:38:50 +0200
M /branches/drbd-0.7/user/drbd_limits.h
The limit on MAX_BUFFERS was ways too restrictive.
r1794 | phil | 2005-05-12 09:08:49 +0200
M /branches/drbd-0.7/ChangeLog
Preparing 0.7.11
r1798 | lars | 2005-05-23 15:23:33 +0200
M /branches/drbd-0.7/ChangeLog
M /branches/drbd-0.7/drbd/linux/drbd_config.h
M /branches/drbd-0.7/drbd.spec.in
prepare release 0.7.11
r1800 | lars | 2005-05-23 21:46:50 +0200
M /branches/drbd-0.7/ChangeLog
M /branches/drbd-0.7/debian/changelog
M /branches/drbd-0.7/drbd.spec.in
added missing changelog updates
added mv /lib/modules/*/extra/drbd.ko -> *.orig rename
to post install of drbd-km-
r1803 | phil | 2005-05-24 10:28:52 +0200
M /branches/drbd-0.7/drbd.spec.in
Building on SuSE-9.3 needs the LOCALVERSION ...
r1804 | lars | 2005-05-30 19:00:13 +0200
M /branches/drbd-0.7/Makefile
M /branches/drbd-0.7/user/drbdadm_scanner.fl
* makefile update for internal use
* fixed flex input buffer overflow:
drbdadm_scanner.fl produced tokens of arbitrary length due to excessive use
of "+" and "*" modifiers. Now these are replaced with "{x,y}" modifiers, so
it should no longer segfault.
Though it may now produce parse errors where it suceeded before, if you
happen to use 90 character long resource names or the like.
r1805 | lars | 2005-05-30 19:07:34 +0200
M /branches/drbd-0.7/Makefile
* missing parts of Makefile update
r1806 | lars | 2005-06-07 19:19:05 +0200
M /branches/drbd-0.7/ChangeLog
M /branches/drbd-0.7/drbd.spec.in
changelog updates
r1821 | lars | 2005-06-30 11:44:27 +0200
M /branches/drbd-0.7/Makefile
M /branches/drbd-0.7/drbd/Makefile
M /branches/drbd-0.7/drbd/drbd_fs.c
M /branches/drbd-0.7/drbd/drbd_int.h
M /branches/drbd-0.7/user/drbdadm.h
M /branches/drbd-0.7/user/drbdadm_main.c
M /branches/drbd-0.7/user/drbdadm_parser.y
M /branches/drbd-0.7/user/drbdadm_scanner.fl
M /branches/drbd-0.7/user/drbdsetup.c
* make sure new la_size is written to meta data early
* test on feature instead of version code (TASK_ZOMBIE)
* add "verify_ips" flag to drbdadm commands, so it annoys us with warnings only part of the time.
* don't report the "is ip present" bash magic as failed command
* remove .tmp_versions on clean
* minor cleanups and adjustments
r1826 | lars | 2005-06-30 12:22:30 +0200
M /branches/drbd-0.7/Makefile
minor makefile fix
r1850 | lars | 2005-07-11 15:56:46 +0200
M /branches/drbd-0.7/drbd/drbd_actlog.c
sector_t in printk: %llu, not %ld
r1859 | phil | 2005-07-13 10:23:59 +0200
M /branches/drbd-0.7/drbd/drbd_actlog.c
Very very seldom the ERR in drbd_actlog.c:607 triggered. The reason
was that the rs_left member of one of the bm_extents got negative.
How could this happen:
Two parallel threads of exeution in __drbd_set_in_sync(). Both of them
already cleared some bits, therefore having a positive count [named
cleared in drbd_try_clear_on_disk_bm()].
Before they can enter drbd_try_clear_on_disk_bm() they get serialized
by the al_lock spin lock. In drbd_try_clear_on_disk_bm() it has to
recount the bits worth a BM_EXT. While counting the bits, it sees
of course that both bits where already cleared!
Then thread 1 leaves drbd_try_clear_on_disk_bm() and releases the
al_lock.
Now the other thread finds the bm_ext in the cache and substracts
its count [aka cleared] from rs_left.
=> So with this race condition, rs_left is one too low.
Fixed the race condition by serializing before clearing bits in
the bitmap...
r1861 | lars | 2005-07-13 18:18:50 +0200
M /branches/drbd-0.7/drbd/drbd_receiver.c
if I cannot set it, I may not clear it ...
(the lockout flag in _drbd_process_ee)
r1869 | phil | 2005-07-14 12:11:19 +0200
M /branches/drbd-0.7/drbd/drbd_fs.c
While resizing, if we shrunk we need to empty the AL.
Otherwise we do stupid things in drbd_al_to_on_disk_bm() later.
(access beyond end of meta data and stuff)
r1876 | lars | 2005-07-14 16:40:26 +0200
M /branches/drbd-0.7/drbd/drbd_bitmap.c
M /branches/drbd-0.7/drbd/drbd_fs.c
M /branches/drbd-0.7/drbd/drbd_int.h
M /branches/drbd-0.7/drbd/drbd_main.c
M /branches/drbd-0.7/testing/CTH/CTH_bash.helpers
M /branches/drbd-0.7/testing/CTH/functions.sh
* handle out of memory condition in do_determin_dev_size slightly more gracefully
* some adjustments to the CTH,
on startup, it first attaches all devices,
only then it connects
on large/many devices it would otherwise trigger timeouts more likely,
since we still read/write the bitmap synchronous.
r1881 | lars | 2005-07-18 11:48:44 +0200
M /branches/drbd-0.7/drbd/drbd_main.c
just in case: struct meta_data_on_disk shoud be 'packed'
r1882 | lars | 2005-07-18 11:53:28 +0200
M /branches/drbd-0.7/drbd/drbd_receiver.c
you could get a flip-flop connection established/connection loss,
in case both peers have different, non-zero, usize uppon first connect!
sort-of solved it:
"expected" (first) param exchange: use the minimum.
"unexpected" (resize) param exchange:
just do what the peer tells us to do.
r1885 | lars | 2005-07-18 12:19:46 +0200
M /branches/drbd-0.7/drbd/drbd_fs.c
while resizing the bitmap, we have to write everything, if the meta data has moved.
we have to shrink the al, if we are smaller now,
and we have to write at least the bitmap, if we are bigger now.
just do all this if (la_size_changed || md_moved)
r1889 | lars | 2005-07-18 14:24:12 +0200
M /branches/drbd-0.7/Makefile
M /branches/drbd-0.7/drbd/Makefile
get rid of one Makefile warning
generate drbd_buildtag.c unconditionally again
r1898 | lars | 2005-07-26 09:29:49 +0200
M /branches/drbd-0.7/drbd/drbd_fs.c
M /branches/drbd-0.7/drbd/drbd_int.h
M /branches/drbd-0.7/drbd/drbd_main.c
M /branches/drbd-0.7/drbd/drbd_req.c
M /branches/drbd-0.7/user/drbdadm.h
M /branches/drbd-0.7/user/drbdadm_main.c
M /branches/drbd-0.7/user/drbdadm_parser.y
M /branches/drbd-0.7/user/drbdadm_scanner.fl
M /branches/drbd-0.7/user/drbdsetup.c
on special demand of a paying customer...
* make it possible to disable bd_claim on 2.6. kernels
this allows for read-only (raw) access on the mirroring target (Secondary)
your application needs to be able to cope with all distributed locking and
coherency issues
* you can "disable-ip-verification" in the global section of drbd.conf,
so the drbdadm does not bug you with warning messages if it does not find
the configured ip on the host.
* you may now specify a "size" parameter in the disk sections of resources
in drbd.conf, in case you think you need it.
I'd suggest to not use it, though.
+ still TODO: documentation update for these changes
- took the opportunity to get rid of the useless "disable-io-hints" module
parameter
r1899 | lars | 2005-07-26 13:37:12 +0200
M /branches/drbd-0.7/Makefile
oops, traces of drbd-plus in the main branch...
Property changes on: trunk
___________________________________________________________________
Name: propagate:at
- 1745
+ 1899
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2005-07-26 11:37:12 UTC (rev 1899)
+++ trunk/ChangeLog 2005-07-26 12:05:27 UTC (rev 1900)
@@ -1,29 +1,116 @@
Latest:
------
- ChangeLog last updated: r1594 2004-10-15
+ ChangeLog last updated: r1806 2005-05-23
Cumulative changes since last tarball.
For even more detail, use "svn log" and "svn diff".
0.8_pre1
--------
* remove all kernel 2.4.x compatibility crap
- * ioctl sanity checks about Unconfigured and CAP_SYS_ADMIN
- * drbddisk start retries several times,
- in case drbd ping timeout is longer than heartbeat deadtime.
+ FIXME mention all those things we did so far
+
+
0.7 branch
----------
+
+0.7.11 (api:77/proto:74)
+-----
+ * The upper limit of the runtime tuning parameter max_buffers
+ was ways too low for today's IBM storage controllers.
+ Was 32 - 10000 ; Now it is 32 - 131072 ( Now one could
+ allow DRBD to allocate up to half a gigabyte of memory as
+ receive buffers)
+ * A fix to the Makefiles to make building of RPMs work on RAHS4.
+ * A workaround to have DBRD running on PPC64 with Linux-2.4.x kernels,
+ on Linux-2.6.x everything was fine already.
+ * Removal of dead code (busy_blocks).
+ * LINBIT drbd rpms now conflict with km_drbd
+ (SuSE's kernel module source hook)
+ * possibly existing /lib/modules/*/extra/drbd.ko are renamed to .orig in the
+ post-install scripts to avoid conflicts with existing modules from
+ distribution kernel packages
+ * fixed flex input buffer overflow
+ drbdadm_scanner.fl produced tokens of arbitrary length due to excessive use
+ of "+" and "*" modifiers. Now these are replaced with "{x,y}" modifiers, so
+ it should no longer segfault, which was actually observed e.g. with long
+ continuous comment blocks (~5k).
+
+0.7.10 (api:77/proto:74)
+-----
+ * 0.7.9 had a memory corruption bug and memory leakage (BIOs).
+ This time I did the clone_bio() fix myself, and this release is
+ supposed to work with SLES9 SP1, Linux-2.6.11 and Linux-2.6.12.
+
+0.7.9 (api:77/proto:74)
+-----
+ * A fix that makes DRBD work on SLES9 SP1 kernel, and
+ probabely will be also necessary for Linux-2.6.11
+
+0.7.8 (api:77/proto:74)
+-----
+ * Fixed a bug that caused the syncer to starve on devices
+ bigger than 2 TB on 32bit systems (=CONFIG_LBA).
+ * Made online resizing actually work. Now it makes a lot
+ more sense to put DRBD on top of LVM.
+ * Made the user dialog to work on RedHat based distributions.
+ * A small optimization that improves the performance of the
+ syncer when woking with IBM's ServRaid Controllers (ips).
+ May have a positive effect with other Controllers as well.
+ * Made epoch_size atomic. This removes a SMP race condition that
+ could lead on some Xeon CPUs to an ASSERT printk, but did no other
+ harm than printing messages to the syslog
+ * Fixed write_gc.pl to work with the perl version delivered
+ with RHAS3.
+ * Made the initscript to abort if one of the setup commands fails.
+
+0.7.7 (api:77/proto:74)
+-----
+ * "drbdadm adjust [res...]" now does the calls to drbdsetup
+ in an improved order, first the disk config of all devices,
+ then the syncer and net config last. With the old scheme
+ drbdadm run in a timeout when setting up more than about
+ 6 devices at once (startup script...).
+ * New progress indication in the startup script.
+ * Bugfix to a race that could cause a OOPS on a BUG() macro
+ in mod_timer while starting resync. The more devices you have
+ the higher the probability to hit this race condition.
+ * Fixed a bug in the sync-groups conde, that only showed up
+ when you have more than 4 resources in your config.
+ The resync process was continued too early on the node in
+ SyncTarget state.
+ * Fixed a stupid typo in the range-check code, that was intoduced
+ in 0.7.6. Drbdsetup allowed "max-buffers" to be in the range
+ from 32 to 32.
+ * Makefiles are gcc-2.95 compatible again.
+
+0.7.6 (api:77/proto:74)
+-----
+ * Fixed bug that could cause a lockup of the receiver and
+ asender threads, the visible outcome was that the syncer
+ starves.
+ * Fixed a bug that under specific circumstandes caused that the
+ SyncSource node did not recognised that a resync process was
+ finished.
+ * "drbdadm invalidate [res]" was not working correct, while
+ "drbdadm invalidate_remote [res]" works. Fixed the former.
+ * Make DRBD work on Linux-2.6.10-rc2 and newer: Replaced
+ sock_alloc() by sock_create(), replaced TASK_ZOMBIE by
+ EXIT_ZOMBIE.
+ * Range checks in drbdadm for all numeric configure parameters.
* A fix to make ioctl()s work on machines with 64bit kernel space
and 32bit user space.
- * Ioctl()s are only alloes if the caller has CAP_SYS_ADMIN set.
+ * Ioctl()s are only allowed if the caller has CAP_SYS_ADMIN set.
* Removal of warnings on 64bit architectures.
* Backport of find_first_bit() for x86_64 aka AMD64 for use on
that architecture under Linux-2.4.x
+ * Changed drbdadm to do the syncer config before the net config.
* Changed the way drbdadm determines the minor_count parameter for
module loading.
* Improvements to the drbddisk script, to do the right thing
in case Heartbeat is configured with a small timeout than DRBD.
- * Lots of updates to the way Debian's DRBD packages works.
+ * On request of the debian package maintainers, the debian directory
+ from SVN is not longer included in the tar.gz releases.
0.7.5 (api:76/proto:74)
-----
Modified: trunk/Makefile
===================================================================
--- trunk/Makefile 2005-07-26 11:37:12 UTC (rev 1899)
+++ trunk/Makefile 2005-07-26 12:05:27 UTC (rev 1900)
@@ -32,11 +32,16 @@
# or to forcefully include the svn-last-changed-date in the tgz name:
# make distclean doc tgz FORCE=1
#
-REL_VERSION := $(REL_VERSION)-$(shell svn info| \
- sed -ne 's/^Last Changed Date: \([0-9]*\)-\([0-9]*\)-\([0-9]*\).*/\1\2\3/p')
+REL_VERSION := $(REL_VERSION)-$(shell LANG= svn info| \
+ sed -n -e 's/^Last Changed Date: \([0-9]*\)-\([0-9]*\)-\([0-9]*\).*/\1\2\3/p' \
+ )-$(shell svnversion .)
endif
DIST_VERSION := $(subst -,_,$(REL_VERSION))
+FDIST_VERSION := $(shell test -e .filelist && sed -ne 's,^drbd-\([^/]*\)/.*,\1,p;q' < .filelist)
+ifeq ($(FDIST_VERSION),)
+FDIST_VERSION := $(DIST_VERSION)
+endif
LN_S = ln -s
RPMBUILD=rpmbuild
@@ -100,21 +105,7 @@
# update of drbd_buildtag.c is forced:
.PHONY: drbd/drbd_buildtag.c
drbd/drbd_buildtag.c:
- @is_tarball=`test -e .svn/. && echo false || echo true`; \
- set -e; exec > $@.new; \
- echo -e "/* automatically generated. DO NOT EDIT. */"; \
- echo -e "const char * drbd_buildtag(void)\n{"; \
- if $$is_tarball; then \
- if ! test -e $@ ; then \
- echo >&2 "your DRBD source tree is broken. unpack again."; \
- exit 1; \
- fi; \
- grep return $@ ; \
- else \
- echo -ne "\treturn \"SVN Revision: "; svnversion -n .; echo \"; \
- fi ; \
- echo -e "\t\t\" build by $$USER@$$HOSTNAME, `date "+%F %T"`\";\n}"; \
- mv $@{.new,}
+ $(MAKE) -C drbd drbd_buildtag.c
# update of .filelist is forced:
.PHONY: .filelist
@@ -122,7 +113,7 @@
@ svn info >/dev/null || { echo "you need a svn checkout to do this." ; false ; }
@find $$(svn st -v | sed '/^?/d;s/^.\{8\} \+[0-9]\+ \+[0-9]\+ [a-z]\+ *//;$(if $(PRESERVE_DEBIAN),,/^debian/d)' ) \
\! -type d -maxdepth 0 |\
- sed 's:^:drbd-$(DIST_VERSION)/:' > .filelist
+ sed 's#^#drbd-$(DIST_VERSION)/#' > .filelist
@[ -s .filelist ] # assert there is something in .filelist now
@find documentation -name "[^.]*.[58]" -o -name "*.html" | \
sed "s/^/drbd-$(DIST_VERSION)\//" >> .filelist ;\
@@ -139,24 +130,31 @@
tgz:
test -e .filelist
ln -sf drbd/linux/drbd_config.h drbd_config.h
- rm -f drbd-$(DIST_VERSION)
- ln -s . drbd-$(DIST_VERSION)
- set -e ; for f in $$(<.filelist) ; do [ -e $$f ] ; done
- tar --owner=0 --group=0 -czf drbd-$(DIST_VERSION).tar.gz -T .filelist
- rm drbd-$(DIST_VERSION)
+ rm -f drbd-$(FDIST_VERSION)
+ ln -s . drbd-$(FDIST_VERSION)
+ for f in $$(<.filelist) ; do [ -e $$f ] && continue ; echo missing: $$f ; exit 1; done
+ grep debian .filelist >/dev/null 2>&1 && _DEB=-debian || _DEB="" ; \
+ tar --owner=0 --group=0 -czf - -T .filelist > drbd-$(FDIST_VERSION)$$_DEB.tar.gz
+ rm drbd-$(FDIST_VERSION)
ifeq ($(FORCE),)
tgz: check_changelogs_up2date doc
endif
check_all_committed:
- @modified=`svn st -q`; \
+ @$(if $(FORCE),-,)modified=`svn st -q`; \
if test -n "$$modified" ; then \
echo "$$modified"; \
false; \
fi
-tarball: check_all_committed distclean doc .filelist tgz
+prepare_release:
+ $(MAKE) tarball
+ $(MAKE) tarball PRESERVE_DEBIAN=1
+
+tarball: check_all_committed distclean doc .filelist
+ $(MAKE) tgz
+
all tools doc .filelist: drbd/drbd_buildtag.c
KDIR := $(shell echo /lib/modules/`uname -r`/build)
@@ -181,11 +179,11 @@
dist/TMP \
dist/install \
dist/SRPMS
- [ -h dist/SOURCES/drbd-$(DIST_VERSION).tar.gz ] || \
- $(LN_S) $(PWD)/drbd-$(DIST_VERSION).tar.gz \
- $(PWD)/dist/SOURCES/drbd-$(DIST_VERSION).tar.gz
+ [ -h dist/SOURCES/drbd-$(FDIST_VERSION).tar.gz ] || \
+ $(LN_S) $(PWD)/drbd-$(FDIST_VERSION).tar.gz \
+ $(PWD)/dist/SOURCES/drbd-$(FDIST_VERSION).tar.gz
if test drbd.spec.in -nt dist/SPECS/drbd.spec ; then \
- sed -e "s/^\(Version:\).*/\1 $(DIST_VERSION)/;" \
+ sed -e "s/^\(Version:\).*/\1 $(FDIST_VERSION)/;" \
-e "s/^\(Packager:\).*/\1 $(USER)@$(HOSTNAME)/;" < drbd.spec.in \
> dist/SPECS/drbd.spec ; \
fi
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2005-07-26 11:37:12 UTC (rev 1899)
+++ trunk/debian/changelog 2005-07-26 12:05:27 UTC (rev 1900)
@@ -1,13 +1,67 @@
+drbd (0.7.11-0) unstable; urgency=low
+
+ * (Philipp Reisner)
+ - New upstream release
+
+ -- Philipp Reisner <phil at linbit.com> Mon, 23 May 2005 15:29:21 +0200
+
+drbd (0.7.10-0) unstable; urgency=low
+
+ * (Philipp Reisner)
+ - New upstream release
+
+ -- Philipp Reisner <phil at linbit.com> Mon, 31 Jan 2005 10:17:00 +0100
+
+drbd (0.7.9-0) unstable; urgency=low
+
+ * (Philipp Reisner)
+ - New upstream release
+
+ -- Philipp Reisner <phil at linbit.com> Tue, 25 Jan 2005 11:31:00 +0100
+
+drbd (0.7.8-1) unstable; urgency=low
+
+ * (Cyril Bouthors)
+ - New upstream release
+
+ -- Cyril Bouthors <cyril at bouthors.org> Mon, 17 Jan 2005 18:50:49 +0400
+
+drbd (0.7.7-1) unstable; urgency=low
+
+ * (Cyril Bouthors)
+ - New upstream release
+
+ -- Cyril Bouthors <cyril at bouthors.org> Wed, 15 Dec 2004 17:15:35 +0300
+
+drbd (0.7.6-2) unstable; urgency=low
+
+ * (Cyril Bouthors)
+ - drbd0.7-module-source: Moved debhelper from Recommends to Depends
+
+ -- Cyril Bouthors <cyril at bouthors.org> Thu, 9 Dec 2004 20:37:41 +0300
+
+drbd (0.7.6-1) unstable; urgency=low
+
+ * (Cyril Bouthors)
+ - New upstream release
+ - debian/control.modules.in: updated description
+ - debian/TODO: removed
+
+ -- Cyril Bouthors <cyril at bouthors.org> Tue, 30 Nov 2004 19:43:27 +0300
+
drbd (0.7.5-2) unstable; urgency=low
- * debian/control: Added Conflict with drbd-util and drbd-module-source
- * debian/control.in.modules: Fixed description for kernel module
- * debian/control.in.modules: Added Conflict line in kernel module package
- * debian/control.in.modules: Change depends to drbd0.7-util
- * debian/rules: don't use top-level makefile
- * call depmod in postinst of kernel module
- * remove obsolete upstream ./debian/ in clean
- * added module-assistant override file
+ * (Philipp Hug)
+ - debian/control: Added Conflict with drbd-util and drbd-module-source
+ - debian/control.in.modules: Fixed description for kernel module
+ - debian/control.in.modules: Added Conflict line in kernel module package
+ - debian/control.in.modules: Change depends to drbd0.7-util
+ - debian/rules: don't use top-level makefile, to prevent re-creation of
+ drbd_buildtag.c
+ - call depmod in postinst of kernel module
+ - debian/rules: remove obsolete upstream ./debian/ files in clean target
+ - added module-assistant override file
+ - this version is ready for sarge (Closes: #277669)
-- Philipp Hug <debian at hug.cx> Tue, 19 Oct 2004 20:50:49 +0200
@@ -18,7 +72,7 @@
- debian/drbd0.7.dirs: removed usr/bin (closes: #276643).
- debian/control: changed Section from misc to admin.
- scripts/drbd: prevent the "stop" target from failing if drbd is not running
- - debian/rules: call upstream Makefile targets instead of doing hardcoded stuff, clean.
+ - debian/rules: call upstream Makefile targets instead of doing hardcoded stuff, clean.
- debian/drbd0.7.docs: added upgrade_0.6.x_to_0.7.0.txt and upgrade_0.7.0_to_0.7.1.txt.
- The package drbd as been renamed to drbd0.7-utils and drbd-source as
been renamed to drbd0.7-module-source. We'll introduce drbd0.6-*
@@ -41,11 +95,11 @@
drbd (0.7.4-1) unstable; urgency=low
* Fixed a critical bug with Linux-2.4.x and HIGHMEM!
- * Fixed a bug that only showed up with the HIGHMEM problem on
+ * Fixed a bug that only showed up with the HIGHMEM problem on
Linux-2.4.x -> It caused the resync process to starve.
* The drbd.spec file now creates /dev/drbd in the post-install stage.
* Fixed support for more than 2TB storage. Now DRBD supports up to
- 3.99TB storage. It will also tell you, that it is not supported if
+ 3.99TB storage. It will also tell you, that it is not supported if
you try to set up a bigger device.
* Debian's build rules file now knows about the adjust_drbd_config_h.sh
file.
@@ -75,7 +129,7 @@
drbd (0.7.2-1) unstable; urgency=low
- * Proper handling of backing storage devices that occasionally fail
+ * Proper handling of backing storage devices that occasionally fail
READA (=read ahead) requests. (E.g. LVM and MD)
* DRBD now fails READA requests itself, if a resynchronisation is running
and it would need to fetch the block from its peer.
@@ -94,7 +148,7 @@
* Handle the human and the timeout count correctly in the new init script.
* The implementation of the incon-degr-cmd was missing, added.
* Fix for integer overflow in /proc/drbd syncer progress display
- * Longer timeouts in drbdadm for drbdsetup commands witch operate on
+ * Longer timeouts in drbdadm for drbdsetup commands witch operate on
meta data.
* New major number 147 (officially registered at lanana.org).
* Added a missing w_resume_next_wg() in case we stop syncing because
@@ -116,7 +170,7 @@
calling to __*, giving file and line information,
to be able to easily track causes of "strange state"s there.
* rs_total is now != 0 only if we actually ARE syncing.
- it is reset
+ it is reset
* when sync is done
* when connection is lost
* when storage is lost on either node
@@ -152,54 +206,54 @@
-- Lars Ellenberg <l.g.e at web.de> Fri, 09 Jul 2004 20:00:19 +0200
drbd (0.7_pre8-2) unstable; urgency=low
-
+
* fix up the modules source package
-
- -- Bernd Schubert <bernd-schubert at web.de> Mon, 05 Jul 2004 00:57:38 -0100
+ -- Bernd Schubert <bernd-schubert at web.de> Mon, 05 Jul 2004 00:57:38 -0100
+
drbd (0.7_pre8-1) unstable; urgency=low
-
+
* initial 0.7 debian package
-
- -- Bernd Schubert <bernd-schubert at web.de> Mon, 21 Jun 2004 19:57:38 -0400
+ -- Bernd Schubert <bernd-schubert at web.de> Mon, 21 Jun 2004 19:57:38 -0400
+
drbd (0.6.12-5) unstable; urgency=low
-
+
* Changed default drbd.conf file to set a negative inittimeout value and
- updated the README.Debian file to reflect this change.
+ updated the README.Debian file to reflect this change.
(Closes Bug#221751)
-
+
-- David Krovich <dkrovich at csee.wvu.edu> Tue, 25 May 2004 12:51:15 -0400
drbd (0.6.12-4) unstable; urgency=low
-
- * Refactored rules file in an attempt to use binary-arch and binary-indep
- targets more wisely. This is an attempt to fix Bug#244392.
+
+ * Refactored rules file in an attempt to use binary-arch and binary-indep
+ targets more wisely. This is an attempt to fix Bug#244392.
* Listed /etc/ha.d/resource.d/drbd in debian/conffiles. (Closes Bug#247606)
* Moved drbdsetup from /usr/bin/ to /usr/sbin. I think I introduced this
- when I overhauled the debian directory in the 0.6.12-1 release.
+ when I overhauled the debian directory in the 0.6.12-1 release.
(Closes Bug#247607)
-
- -- David Krovich <dkrovich at csee.wvu.edu> Sun, 16 May 2004 15:20:59 -0400
+ -- David Krovich <dkrovich at csee.wvu.edu> Sun, 16 May 2004 15:20:59 -0400
+
drbd (0.6.12-3) unstable; urgency=low
-
+
* After discussing with upstream, tweak /etc/init.d/drbd script so the
stop target works if the module is not loaded. (Closes: Bug#243417)
* Put the drbd script in the /etc/ha.d/resource.d directory. (Closes: Bug#245219)
-
+
-- David Krovich <dkrovich at csee.wvu.edu> Thu, 22 Apr 2004 18:12:47 -0400
drbd (0.6.12-2) unstable; urgency=low
-
+
* Create /dev/nb[0-7] devices in postinst script. (Closes: Bug#221545)
-
+
-- David Krovich <dkrovich at csee.wvu.edu> Sat, 17 Apr 2004 15:18:29 -0400
-
+
drbd (0.6.12-1) unstable; urgency=low
-
+
* new upstream release. (Closes: Bug#239804)
- * Completely overhauled the debian/ directory.
+ * Completely overhauled the debian/ directory.
* Changed sequence number in the runlevel to start at 70 and stop
at 08. drbd should start after things like ssh, but before
heartbeat.
@@ -208,12 +262,12 @@
drbd (0.6.10-3) unstable; urgency=low
* Added back the drbd.postinst, drbd.postrm, and drbd.prerm scripts until
- I figure out why they aren't being handled by dh_installinit.
- * As of drbd-0.6.9, The drbd module no longer builds against just the
+ I figure out why they aren't being handled by dh_installinit.
+ * As of drbd-0.6.9, The drbd module no longer builds against just the
kernel-headers package and now needs a full kernel-source tree.
- -- David Krovich <dkrovich at csee.wvu.edu> Mon, 26 Jan 2004 00:32:49 -0500
-
+ -- David Krovich <dkrovich at csee.wvu.edu> Mon, 26 Jan 2004 00:32:49 -0500
+
drbd (0.6.10-2) unstable; urgency=low
* noel: fixed lintian warning:
@@ -223,19 +277,19 @@
* Lintian/Linda fixes.
* Tweaked the drbd-0.6.10.orig.tar.gz to not have a debian/ directory in it.
- * Stopped tweaking the copyright notice on drbd_fs.c and drbd_receiver.c.
+ * Stopped tweaking the copyright notice on drbd_fs.c and drbd_receiver.c.
I'm not sure how that got there in the first place.
- * Removed mystery report_to_html.pl.debdiff file.
+ * Removed mystery report_to_html.pl.debdiff file.
* Put the datadisk in the correct location. (Closes: Bug#221544)
-
+
* Removed drbd.postinst, drbd.postrm, and drbd.prerm as they are
being generated by dh_installinit during the build process and do not
need to part of the source package.
* removed dependancy on automake and autoconf
* Changed control.modules to require debhelper >= 4.
- * Stop settting $KSRC in the rules file.
+ * Stop settting $KSRC in the rules file.
- * Removed conffiles, files, kernel-patch-wup.substvars as they are
+ * Removed conffiles, files, kernel-patch-wup.substvars as they are
unneccessary.
* Tightened the build dependancy on debhelper. >=4
* Updated Debian packages up to newest upstream version. (Closes: Bug#197906)
@@ -243,18 +297,18 @@
* Verified support for devfs. (Closes: Bug#203552)
* I'd like to become a Debian Developer and take over maintenance for
this package. I'm working with Debian Devolpers on making this happen.
-
+
-- David Krovich <dkrovich at csee.wvu.edu> Tue, 20 Jan 2004 01:36:58 -0500
drbd (0.6.10-1) unstable; urgency=low
- * With 0.6.9 there was a bug introduced which prevented the sending
+ * With 0.6.9 there was a bug introduced which prevented the sending
of ACK packets during resync. Fixed.
* A fix to drbdsetup's wait_connect command.
- * Replaced all invocations of the sleep_on() family functions with the
- invocations of the wait_event() macros. This removes lost wakup events
+ * Replaced all invocations of the sleep_on() family functions with the
+ invocations of the wait_event() macros. This removes lost wakup events
and race conditions.
- * New implementation of drbd_wait_ee(). This makes the
+ * New implementation of drbd_wait_ee(). This makes the
"(BUG?) Moving bh=%p to done_ee" go away.
* Handle the case if vmalloc() of the bitmap fails.
@@ -263,14 +317,14 @@
drbd (0.6.9-1) unstable; urgency=low
* New module build system (using kernel source tree build system)
- * New net section option 'ko-count'. It allows you to kick out a
- secondary node which does no longer process data in acceptable time.
+ * New net section option 'ko-count'. It allows you to kick out a
+ secondary node which does no longer process data in acceptable time.
Its default value is 0 which disables this feature.
* Changing syncgroups while resync runs has shows now the correct behaviour.
* In case thread creations fails DRBD would deadlock on its own
semaphore. Fixed now.
* BKL is no longer used on Linux-2.4.x.
- * Now you can stack mapping block devices like LVM2 (and maybe md) on
+ * Now you can stack mapping block devices like LVM2 (and maybe md) on
top of drbd (a one character fix).
* drbdsetup wait_connect on a StandAlone node looked like a timeout and
forced primary. fixed.
@@ -292,7 +346,7 @@
drbd (0.6.7-1) unstable; urgency=low
- * A fix to a bug that could cause data corruption if you use a
+ * A fix to a bug that could cause data corruption if you use a
other blocksize than 4k to access the DRBD device.
* A fix to a SMP race in the syncer code. The problem was tirggered
when using DRBD on QLogic fiber channel adapters.
@@ -307,7 +361,7 @@
* In the 0.6.5 release the secondary_remote command was badly broken,
it succeeded when it should fail silently. This is fixed now.
* Probabely in all previous releases, the resyncer thread did not
- exit properly if the secondary node goes away during resync.
+ exit properly if the secondary node goes away during resync.
This was not fatal sind the resyncher thread did exit at soon
as it gets a network error. This is fixed now.
* Some new switches to the drbd script.
@@ -383,7 +437,7 @@
-pre versions sanely
* uploading to unstable. (Closes: Bug#130031)
- -- Jan Niehusmann <jan at debian.org> Wed, 11 Sep 2002 13:10:03 +0200
+ -- Jan Niehusmann <jan at debian.org> Wed, 11 Sep 2002 13:10:03 +0200
drbd (cvs20010511-1) unstable; urgency=low
Modified: trunk/drbd/Makefile
===================================================================
--- trunk/drbd/Makefile 2005-07-26 11:37:12 UTC (rev 1899)
+++ trunk/drbd/Makefile 2005-07-26 12:05:27 UTC (rev 1900)
@@ -64,19 +64,11 @@
KDIR := /lib/modules/$(shell uname -r)/build
endif
- KDIR_Makefile_PATCHLEVEL = $(shell grep "^PATCHLEVEL = " $(KDIR)/Makefile | cut -d " " -f 3 )
+ KDIR_Makefile_PATCHLEVEL = $(shell test -e $(KDIR)/Makefile && grep "^PATCHLEVEL = " $(KDIR)/Makefile | cut -d " " -f 3)
ifneq ($(findstring $(KDIR_Makefile_PATCHLEVEL),12345),)
$(error "won't compile with this kernel version")
endif
- # shell ls, because some of them may be missing
- # inside a patched kernel source tree
- SRC_FILES := $(shell ls 2>/dev/null\
- linux/drbd_config.h linux/drbd.h drbd_actlog.c drbd_bitmap.c drbd_fs.c \
- drbd_main.c drbd_proc.c drbd_receiver.c drbd_req.c drbd_worker.c \
- drbd_strings.c lru_cache.c drbd_compat_wrappers.h drbd_int.h \
- lru_cache.h )
-
.PHONY: drbd.o default all greeting clean kbuild install dep
drbd.o: greeting kbuild
@@ -87,17 +79,31 @@
@echo "" ;\
echo " Calling toplevel makefile of kernel source tree, which I believe is in" ;\
echo " KDIR=$(KDIR)" ; \
- echo ""
+ echo "";
+ @if ! test -e $(KDIR)/Makefile ; then \
+ echo -e " SORRY, kernel makefile not found. You need to tell me a correct KDIR!\n" ;\
+ false;\
+ fi
- drbd_buildtag.c: $(SRC_FILES)
- @if grep ^drbd/drbd_buildtag.c: ../Makefile &>/dev/null; then \
- $(MAKE) -C .. drbd/drbd_buildtag.c ;\
- else \
- echo "drbd_buildtag.c outdated." ;\
- echo "you probably need to do a 'make' in DRBDs toplevel directory.";\
- false ;\
- fi
+.PHONY: drbd_buildtag.c
+ drbd_buildtag.c:
+ @is_tarball=`test -e .svn/. -a -e ../.svn/. && echo false || echo true`;\
+ set -e; exec > $@.new; \
+ echo -e "/* automatically generated. DO NOT EDIT. */"; \
+ echo -e "const char * drbd_buildtag(void)\n{"; \
+ if $$is_tarball; then \
+ if ! test -e $@ ; then \
+ echo >&2 "your DRBD source tree is broken. unpack again."; \
+ exit 1; \
+ fi; \
+ grep return $@ ; \
+ else \
+ echo -ne "\treturn \"SVN Revision: "; svnversion -n ..; echo \"; \
+ fi ; \
+ echo -e "\t\t\" build by $$USER@$$HOSTNAME, `date "+%F %T"`\";\n}"; \
+ mv $@{.new,}
+
kbuild: drbd_buildtag.c
@rm -f .kernelrelease*
# previous to 2.6.6 (suse: 2.6.5-dunno), this should be:
@@ -118,6 +124,7 @@
@echo "done."
clean:
+ rm -rf .tmp_versions
rm -f *.[oas] *.ko .*.cmd .*.d .*.tmp *.mod.c .*.flags .depend .kernel*
distclean: clean
Modified: trunk/drbd/drbd_actlog.c
===================================================================
--- trunk/drbd/drbd_actlog.c 2005-07-26 11:37:12 UTC (rev 1899)
+++ trunk/drbd/drbd_actlog.c 2005-07-26 12:05:27 UTC (rev 1900)
@@ -121,15 +121,15 @@
if (sector < drbd_md_ss(mdev) ||
sector > drbd_md_ss(mdev)+MD_BM_OFFSET+BM_SECT_TO_EXT(capacity)) {
- ALERT("%s [%d]:%s(,%ld,%s) out of range md access!\n",
+ ALERT("%s [%d]:%s(,%llu,%s) out of range md access!\n",
current->comm, current->pid, __func__,
- (long)sector, rw ? "WRITE" : "READ");
+ (unsigned long long)sector, rw ? "WRITE" : "READ");
}
ok = _drbd_md_sync_page_io(mdev,iop,sector,rw,hardsect);
if (unlikely(!ok)) {
- ERR("drbd_md_sync_page_io(,%lu,%s) failed!\n",
- (unsigned long)sector,rw ? "WRITE" : "READ");
+ ERR("drbd_md_sync_page_io(,%llu,%s) failed!\n",
+ (unsigned long long)sector,rw ? "WRITE" : "READ");
}
if( hardsect != MD_HARDSECT && rw == READ ) {
@@ -643,6 +643,7 @@
unsigned long sbnr,ebnr,lbnr,bnr;
unsigned long count = 0;
sector_t esector, nr_sectors;
+ int wake_up=0;
if (size <= 0 || (size & 0x1ff) != 0 || size > PAGE_SIZE) {
ERR("drbd_set_in_sync: sector=%lu size=%d nonsense!\n",
@@ -680,23 +681,24 @@
* ok, (capacity & 7) != 0 sometimes, but who cares...
* we count rs_{total,left} in bits, not sectors.
*/
+ spin_lock_irq(&mdev->al_lock);
for(bnr=sbnr; bnr <= ebnr; bnr++) {
if (drbd_bm_clear_bit(mdev,bnr)) count++;
}
if (count) {
// we need the lock for drbd_try_clear_on_disk_bm
- spin_lock_irq(&mdev->al_lock);
if(jiffies - mdev->rs_mark_time > HZ*10) {
/* should be roling marks, but we estimate only anyways. */
mdev->rs_mark_time = jiffies;
mdev->rs_mark_left = drbd_bm_total_weight(mdev);
}
drbd_try_clear_on_disk_bm(mdev,sector,count);
- spin_unlock_irq(&mdev->al_lock);
/* just wake_up unconditional now,
* various lc_chaged(), lc_put() in drbd_try_clear_on_disk_bm(). */
- wake_up(&mdev->al_wait);
+ wake_up=1;
}
+ spin_unlock_irq(&mdev->al_lock);
+ if(wake_up) wake_up(&mdev->al_wait);
}
/*
Modified: trunk/drbd/drbd_fs.c
===================================================================
--- trunk/drbd/drbd_fs.c 2005-07-26 11:37:12 UTC (rev 1899)
+++ trunk/drbd/drbd_fs.c 2005-07-26 12:05:27 UTC (rev 1900)
@@ -52,16 +52,29 @@
int drbd_determin_dev_size(struct Drbd_Conf* mdev)
{
sector_t pmdss; // previous meta data start sector
+ sector_t la_size;
+ int md_moved, la_size_changed;
int rv;
wait_event(mdev->al_wait, lc_try_lock(mdev->act_log));
pmdss = drbd_md_ss(mdev);
+ la_size = mdev->la_size;
+
rv = do_determin_dev_size(mdev);
- if ( pmdss != drbd_md_ss(mdev) && mdev->md_index == -1 ) {
+
+ la_size_changed = (la_size != mdev->la_size);
+ md_moved = pmdss != drbd_md_ss(mdev) /* && mdev->md_index == -1 */;
+
+ if ( md_moved ) {
WARN("Moving meta-data.\n");
+ D_ASSERT(mdev->md_index == -1);
+ }
+
+ if ( la_size_changed || md_moved ) {
drbd_al_shrink(mdev); // All extents inactive.
drbd_bm_write(mdev); // write bitmap
- drbd_md_write(mdev); // Write mdev->la_size to disk.
+ // Write mdev->la_size to [possibly new position on] disk.
+ drbd_md_write(mdev);
}
lc_unlock(mdev->act_log);
@@ -421,6 +434,7 @@
drbd_determin_dev_size(mdev);
/* FIXME
* what if we now have la_size == 0 ?? eh?
+ * BOOM?
*/
if (drbd_md_test_flag(mdev,MDF_FullSync)) {
@@ -755,6 +769,8 @@
* become Secondary. */
if (bd_claim(mdev->this_bdev,drbd_sec_holder))
return -EBUSY;
+ if (disable_bd_claim)
+ bd_release(mdev->this_bdev);
}
spin_lock_irq(&mdev->req_lock);
Modified: trunk/drbd/drbd_int.h
===================================================================
--- trunk/drbd/drbd_int.h 2005-07-26 11:37:12 UTC (rev 1899)
+++ trunk/drbd/drbd_int.h 2005-07-26 12:05:27 UTC (rev 1900)
@@ -38,6 +38,7 @@
// module parameter, defined in drbd_main.c
extern int minor_count;
+extern int disable_bd_claim;
extern int major_nr;
extern int use_nbd_major;
@@ -748,7 +749,6 @@
struct list_head resync_reads;
atomic_t pp_in_use;
wait_queue_head_t ee_wait;
- struct list_head busy_blocks;
struct page *md_io_page; // one page buffer for md_io
struct page *md_io_tmpp; // in case hardsect != 512 [ s390 only? ]
struct semaphore md_io_mutex; // protects the md_io_buffer
@@ -931,11 +931,15 @@
#define BM_EXT_PER_SECT ( 512 / BM_BYTES_PER_EXTENT ) // 4
*/
-#if ( !defined(CONFIG_LBD) ) && ( BITS_PER_LONG == 32 )
-# define DRBD_MAX_SECTORS (0xffffffffLU)
+#define DRBD_MAX_SECTORS_32 (0xffffffffLU)
+#define DRBD_MAX_SECTORS_BM \
+ ( (MD_RESERVED_SIZE*2LL - MD_BM_OFFSET) * (1LL<<(BM_EXT_SIZE_B-9)) )
+#if DRBD_MAX_SECTORS_BM < DRBD_MAX_SECTORS_32
+#define DRBD_MAX_SECTORS DRBD_MAX_SECTORS_BM
+#elif ( !defined(CONFIG_LBD) ) && ( BITS_PER_LONG == 32 )
+#define DRBD_MAX_SECTORS DRBD_MAX_SECTORS_32
#else
-# define DRBD_MAX_SECTORS \
- ( (MD_RESERVED_SIZE*2LL - MD_BM_OFFSET) * (1LL<<(BM_EXT_SIZE_B-9)) )
+#define DRBD_MAX_SECTORS DRBD_MAX_SECTORS_BM
#endif
/* Sector shift value for hash functions for tl_hash table and ee_hash
Modified: trunk/drbd/drbd_main.c
===================================================================
--- trunk/drbd/drbd_main.c 2005-07-26 11:37:12 UTC (rev 1899)
+++ trunk/drbd/drbd_main.c 2005-07-26 12:05:27 UTC (rev 1900)
@@ -82,6 +82,7 @@
MODULE_ALIAS_BLOCKDEV_MAJOR(LANANA_DRBD_MAJOR);
#include <linux/moduleparam.h>
+MODULE_PARM_DESC(disable_bd_claim, "DONT USE! disables block device claiming" );
/*
* please somebody explain to me what the "perm" of the module_param
* macro is good for (yes, permission for it in the "driverfs", but what
@@ -96,6 +97,7 @@
* this becomes the boot parameter drbd.minor_count
*/
module_param(minor_count, int,0);
+module_param(disable_bd_claim,bool,0);
// module parameter, defined
int major_nr = LANANA_DRBD_MAJOR;
@@ -104,6 +106,7 @@
#else
int minor_count = 8;
#endif
+int disable_bd_claim = 0;
// devfs name
char* drbd_devfs_name = "drbd";
@@ -1671,7 +1674,6 @@
INIT_LIST_HEAD(&mdev->done_ee);
INIT_LIST_HEAD(&mdev->read_ee);
INIT_LIST_HEAD(&mdev->net_ee);
- INIT_LIST_HEAD(&mdev->busy_blocks);
INIT_LIST_HEAD(&mdev->app_reads);
INIT_LIST_HEAD(&mdev->resync_reads);
INIT_LIST_HEAD(&mdev->data.work.q);
@@ -1784,7 +1786,6 @@
D_ASSERT(list_empty(&mdev->done_ee));
D_ASSERT(list_empty(&mdev->read_ee));
D_ASSERT(list_empty(&mdev->net_ee));
- D_ASSERT(list_empty(&mdev->busy_blocks));
D_ASSERT(list_empty(&mdev->app_reads));
D_ASSERT(list_empty(&mdev->resync_reads));
D_ASSERT(list_empty(&mdev->data.work.q));
@@ -2003,6 +2004,7 @@
int i,err;
#if 0
+#warning "DEBUGGING"
/* I am too lazy to calculate this by hand -lge
*/
#define SZO(x) printk(KERN_ERR "sizeof(" #x ") = %d\n", sizeof(x))
@@ -2107,6 +2109,8 @@
if (bd_claim(mdev->this_bdev,drbd_sec_holder)) {
// Initial we are Secondary -> should claim myself.
WARN("Could not bd_claim() myself.");
+ } else if (disable_bd_claim) {
+ bd_release(mdev->this_bdev);
}
blk_queue_make_request(q, drbd_make_request_26);
@@ -2249,7 +2253,7 @@
u32 al_offset; // offset to this block
u32 al_nr_extents; // important for restoring the AL
u32 bm_offset; // offset to the bitmap, from here
-};
+} __attribute((packed));
/*
Modified: trunk/drbd/drbd_receiver.c
===================================================================
--- trunk/drbd/drbd_receiver.c 2005-07-26 11:37:12 UTC (rev 1899)
+++ trunk/drbd/drbd_receiver.c 2005-07-26 12:05:27 UTC (rev 1900)
@@ -357,7 +357,6 @@
if( test_and_set_bit(PROCESS_EE_RUNNING,&mdev->flags) ) {
if(!be_sleepy) {
- clear_bit(PROCESS_EE_RUNNING,&mdev->flags);
return 3;
}
spin_unlock_irq(&mdev->ee_lock);
@@ -1436,7 +1435,7 @@
{
Drbd_Sizes_Packet *p = (Drbd_Sizes_Packet*)h;
unsigned int max_seg_s;
- sector_t p_size;
+ sector_t p_size, p_usize;
drbd_conns_t nconn;
ERR_IF(h->length != (sizeof(*p)-sizeof(*h))) return FALSE;
@@ -1454,14 +1453,30 @@
drbd_bm_lock(mdev); // {
mdev->p_size=p_size;
- if( mdev->lo_usize != be64_to_cpu(p->u_size) ) {
- mdev->lo_usize = be64_to_cpu(p->u_size);
+ p_usize=be64_to_cpu(p->u_size);
+ /*
+ * you may get a flip-flop connection established/connection loss, in
+ * case both really have different usize uppon first connect!
+ * try to solve it thus:
+ ***/
+#define min_not_zero(l, r) (l == 0) ? r : ((r == 0) ? l : min(l, r))
+ if (mdev->state.s.conn == WFReportParams) {
+ /* this is first connect, or an otherwise expected param
+ * exchange. choose the minimum */
+ p_usize = min_not_zero(mdev->lo_usize, p_usize);
+ } else {
+ /* this was an "unexpected" param packet,
+ * just do what the peer suggests */
+ }
+#undef min_not_zero
+ if( mdev->lo_usize != p_usize ) {
+ mdev->lo_usize = p_usize;
INFO("Peer sets u_size to %lu KB\n",
(unsigned long)mdev->lo_usize);
}
drbd_determin_dev_size(mdev);
drbd_bm_unlock(mdev); // }
-
+
if (mdev->p_uuid) {
nconn=drbd_sync_handshake(mdev);
kfree(mdev->p_uuid);
Modified: trunk/drbd/drbd_req.c
===================================================================
--- trunk/drbd/drbd_req.c 2005-07-26 11:37:12 UTC (rev 1899)
+++ trunk/drbd/drbd_req.c 2005-07-26 12:05:27 UTC (rev 1900)
@@ -177,11 +177,15 @@
return 0;
}
- /* FIXME
- * not always true, e.g. someone trying to mount on Secondary
- * maybe error out immediately here?
- */
- D_ASSERT(mdev->state.s.role == Primary);
+ if (mdev->state.s.role != Primary &&
+ ( !disable_bd_claim || rw == WRITE ) ) {
+ if (DRBD_ratelimit(5*HZ,5)) {
+ ERR("Not in Primary state, no %s requests allowed\n",
+ disable_bd_claim ? "WRITE" : "IO");
+ }
+ drbd_bio_IO_error(bio);
+ return 0;
+ }
/*
* Paranoia: we might have been primary, but sync target, or
Modified: trunk/drbd/linux/drbd.h
===================================================================
--- trunk/drbd/linux/drbd.h 2005-07-26 11:37:12 UTC (rev 1899)
+++ trunk/drbd/linux/drbd.h 2005-07-26 12:05:27 UTC (rev 1900)
@@ -221,11 +221,11 @@
typedef union {
struct {
- unsigned role : 2 ; // 3/3 primary/secondary/unknown
- unsigned peer : 2 ; // 3/3 primary/secondary/unknown
+ unsigned role : 2 ; // 3/4 primary/secondary/unknown
+ unsigned peer : 2 ; // 3/4 primary/secondary/unknown
unsigned conn : 5 ; // 17/32 cstates
- unsigned disk : 3 ; // 7/7 from Diskless to UpToDate
- unsigned pdsk : 3 ; // 7/7 from Diskless to UpToDate
+ unsigned disk : 3 ; // 7/8 from Diskless to UpToDate
+ unsigned pdsk : 3 ; // 7/8 from Diskless to UpToDate
unsigned susp : 1 ; // 2/2 IO suspended no/yes
unsigned _pad : 16; // 0 unused
} s;
Modified: trunk/drbd.spec.in
===================================================================
--- trunk/drbd.spec.in 2005-07-26 11:37:12 UTC (rev 1899)
+++ trunk/drbd.spec.in 2005-07-26 12:05:27 UTC (rev 1900)
@@ -51,6 +51,8 @@
#Release: %{release}_%{krelver}
Group: System Environment/Kernel
Requires: %{name} = %{version}, /sbin/depmod
+# conflicts with the suse km_drbd package. use either theirs, or ours...
+Conflicts: km_drbd
#%{?ksmp:Provides: kernel-module-drbd = %{version}-%{release}_%{krelver}}
#%description -n kernel%{?ksmp}-module-drbd
@@ -76,8 +78,13 @@
make clean
# note: MANDIR is not used anywhere in the makefiles
# maybe this should be changed
-make all doc PREFIX=%{buildroot}/ MANDIR=%{_mandir} KDIR=%{kdir}
-
+if [ -e /etc/redhat-release ]; then
+ # unset LOCALVERSION for building on RHEL AS 4
+ make all doc PREFIX=%{buildroot}/ MANDIR=%{_mandir} KDIR=%{kdir} LOCALVERSION=""
+else
+ # LOCALVERSION necessary for building on SuSE-9.3
+ make all doc PREFIX=%{buildroot}/ MANDIR=%{_mandir} KDIR=%{kdir}
+fi
%install
make install PREFIX=%{buildroot}/ MANDIR=%{_mandir}
cd drbd
@@ -137,6 +144,12 @@
%doc drbd/k-config-%{kernelversion}.gz
%post
+# hack for distribution kernel packages,
+# which already contain some (probably outdated) drbd module
+EXTRA_DRBD_KO=/lib/modules/%{kernelversion}/extra/drbd.ko
+if test -e $EXTRA_DRBD_KO; then
+ mv $EXTRA_DRBD_KO $EXTRA_DRBD_KO.orig
+fi
chkconfig --add drbd
for i in `seq 0 15` ; do
@@ -163,6 +176,12 @@
#%post -n kernel%{?ksmp}-module-drbd
%post km-%{krelver}
+# hack for distribution kernel packages,
+# which already contain some (probably outdated) drbd module
+EXTRA_DRBD_KO=/lib/modules/%{kernelversion}/extra/drbd.ko
+if test -e $EXTRA_DRBD_KO; then
+ mv $EXTRA_DRBD_KO $EXTRA_DRBD_KO.orig
+fi
uname -r | grep BOOT ||
/sbin/depmod -a -F /boot/System.map-%{kernelversion} %{kernelversion} >/dev/null 2>&1 || true
@@ -171,11 +190,110 @@
/sbin/depmod -a -F /boot/System.map-%{kernelversion} %{kernelversion} >/dev/null 2>&1 || true
%changelog
-* Fri Oct 15 2004 19:53:21 +0200 Lars Ellenberg <l.g.e at web.de>
-- drbd (0.8_pre1-1)
+* Tue Jul 26 2005 11:53:11 +0200 Lars Ellenberg <lars at linbit.com>
+- drbd (0.8_pre1-3)
* remove all kernel 2.4.x compatibility crap
- * ioctl sanity checks about Unconfigured and CAP_SYS_ADMIN
+ FIXME mention all the great things we did so far
+
+* Tue Jun 7 2005 19:13:00 +0200 Lars Ellenberg <lars at linbit.com>
+- drbd (0.7.11-1)
+ * The upper limit of the runtime tuning parameter max_buffers
+ was ways too low for today's IBM storage controllers.
+ Was 32 - 10000 ; Now it is 32 - 131072 ( Now one could
+ allow DRBD to allocate up to half a gigabyte of memory as
+ receive buffers)
+ * A fix to the Makefiles to make building of RPMs work on RAHS4.
+ * A workaround to have DBRD running on PPC64 with Linux-2.4.x kernels,
+ on Linux-2.6.x everything was fine already.
+ * Removal of dead code (busy_blocks).
+ * LINBIT drbd rpms now conflict with km_drbd
+ (SuSE's kernel module source hook)
+ * possibly existing /lib/modules/*/extra/drbd.ko are renamed to .orig in the
+ post-install scripts to avoid conflicts with existing modules from
+ distribution kernel packages
+ * fixed flex input buffer overflow
+ drbdadm_scanner.fl produced tokens of arbitrary length due to excessive use
+ of "+" and "*" modifiers. Now these are replaced with "{x,y}" modifiers, so
+ it should no longer segfault, which was actually observed e.g. with long
+ continuous comment blocks (~5k).
+
+* Mon Jan 31 2005 10:17:00 +0200 Philipp Reisner <phil at linbit.com>
+- drbd (0.7.10-1)
+ * 0.7.9 had a memory corruption bug and memory leakage (BIOs).
+ This time I did the clone_bio() fix myself, and this release is
+ supposed to work with SLES9 SP1, Linux-2.6.11 and Linux-2.6.12.
+
+* Tue Jan 25 2005 11:31:00 +0200 Philipp Reisner <phil at linbit.com>
+- drbd (0.7.9-1)
+ * A fix that makes DRBD work on SLES9 SP1 kernel, and
+ probabely will be also necessary for Linux-2.6.11
+
+* Mon Jan 17 2005 12:55:01 +0200 Philipp Reisner <phil at linbit.com>
+- drbd (0.7.8-1)
+ * Fixed a bug that caused the syncer to starve on devices
+ bigger than 2 TB on 32bit systems (=CONFIG_LBA).
+ * Made online resizing actually work. Now it makes a lot
+ more sense to put DRBD on top of LVM.
+ * Made the user dialog to work on RedHat based distributions.
+ * A small optimization that improves the performance of the
+ syncer when woking with IBM's ServRaid Controllers (ips).
+ May have a positive effect with other Controllers as well.
+ * Made epoch_size atomic. This removes a SMP race condition that
+ could lead on some Xeon CPUs to an ASSERT printk, but did no other
+ harm than printing messages to the syslog
+ * Fixed write_gc.pl to work with the perl version delivered
+ with RHAS3.
+ * Made the initscript to abort if one of the setup commands fails.
+
+* Tue Dec 15 2004 15:50:00 +0200 Philipp Reisner <phil at linbit.com>
+- drbd (0.7.7-1)
+ * "drbdadm adjust [res...]" now does the calls to drbdsetup
+ in an improved order, first the disk config of all devices,
+ then the syncer and net config last. With the old scheme
+ drbdadm run in a timeout when setting up more than about
+ 6 devices at once (startup script...).
+ * New progress indication in the startup script.
+ * Bugfix to a race that could cause a OOPS on a BUG() macro
+ in mod_timer while starting resync. The more devices you have
+ the higher the probability to hit this race condition.
+ * Fixed a bug in the sync-groups conde, that only showed up
+ when you have more than 4 resources in your config.
+ The resync process was continued too early on the node in
+ SyncTarget state.
+ * Fixed a stupid typo in the range-check code, that was intoduced
+ in 0.7.6. Drbdsetup allowed "max-buffers" to be in the range
+ from 32 to 32.
+ * Makefiles are gcc-2.95 compatible again.
+
+* Tue Nov 16 2004 14:59:00 +0200 Philipp Reisner <phil at linbit.com>
+- drbd (0.7.6-1)
+ * Fixed bug that could cause a lockup of the receiver and
+ asender threads, the visible outcome was that the syncer
+ starves.
+ * Fixed a bug that under specific circumstandes caused that the
+ SyncSource node did not recognised that a resync process was
+ finished.
+ * "drbdadm invalidate [res]" was not working correct, while
+ "drbdadm invalidate_remote [res]" works. Fixed the former.
+ * Make DRBD work on Linux-2.6.10-rc2 and newer: Replaced
+ sock_alloc() by sock_create(), replaced TASK_ZOMBIE by
+ EXIT_ZOMBIE.
+ * Range checks in drbdadm for all numeric configure parameters.
+ * A fix to make ioctl()s work on machines with 64bit kernel space
+ and 32bit user space.
+ * Ioctl()s are only allowed if the caller has CAP_SYS_ADMIN set.
+ * Removal of warnings on 64bit architectures.
+ * Backport of find_first_bit() for x86_64 aka AMD64 for use on
+ that architecture under Linux-2.4.x
+ * Changed drbdadm to do the syncer config before the net config.
+ * Changed the way drbdadm determines the minor_count parameter for
+ module loading.
+ * Improvements to the drbddisk script, to do the right thing
+ in case Heartbeat is configured with a small timeout than DRBD.
+ * On request of the debian package maintainers, the debian directory
+ from SVN is not longer included in the tar.gz releases.
+
* Fri Oct 1 2004 11:33:00 +0200 Philipp Reisner <phil at linbit.com>
- drbd (0.7.5-1)
* Fix a bug that could case read requests to return wrong data
Modified: trunk/testing/CTH/CTH_bash.helpers
===================================================================
--- trunk/testing/CTH/CTH_bash.helpers 2005-07-26 11:37:12 UTC (rev 1899)
+++ trunk/testing/CTH/CTH_bash.helpers 2005-07-26 12:05:27 UTC (rev 1900)
@@ -321,7 +321,7 @@
# configure all dm disks
for d in ${!Disk_*} ; do Heal_Disk $d ; done
- # reset and up all DRBDs
+ # reset and attach all DRBDs
for d in ${!Drbd_*} ; do
drbd_to_env $d
echo "$conf" | on ${!left}: drbd_append_config USIZE=$USIZE \
@@ -332,6 +332,13 @@
START_CLEAN=$DRBD_SKIP_INITIAL_SYNC
done
+ # configure syncer and network
+ for d in ${!Drbd_*} ; do
+ drbd_to_env $d
+ on ${!left}: drbdadm_adjust name=$name
+ on ${!right}: drbdadm_adjust name=$name
+ done
+
# wait for connect and initial sync (which should be skipped automatically)
for d in ${!Drbd_*} ; do
drbd_to_env $d
Modified: trunk/testing/CTH/functions.sh
===================================================================
--- trunk/testing/CTH/functions.sh 2005-07-26 11:37:12 UTC (rev 1899)
+++ trunk/testing/CTH/functions.sh 2005-07-26 12:05:27 UTC (rev 1900)
@@ -104,7 +104,7 @@
local cmd=`type $2|tail +2`
local env="\
set -o errexit $DEBUG
-PATH=/root/bin:/usr/bin:/bin:/usr/sbin:/sbin
+PATH=/root/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/bin:/bin
$(printf '%q\n' "${@:3}")
"
local err
@@ -339,11 +339,19 @@
fi
sync
echo .
- drbdadm up $RES
+ drbdadm attach $RES
# cat /proc/drbd
- echo "up'ed drbd $RES on $HOSTNAME"
+ echo "attached drbd $RES on $HOSTNAME"
}
+drbdadm_adjust() # {{{3
+{
+ : ${name:?unknown resource name}
+ drbdadm adjust $name
+ # cat /proc/drbd
+ echo "adjusted drbd $name on $HOSTNAME"
+}
+
drbdadm_up() # {{{3
{
: ${name:?unknown resource name}
Modified: trunk/user/drbd_limits.h
===================================================================
--- trunk/user/drbd_limits.h 2005-07-26 11:37:12 UTC (rev 1899)
+++ trunk/user/drbd_limits.h 2005-07-26 12:05:27 UTC (rev 1900)
@@ -49,8 +49,8 @@
/* I don't think that a tcp send buffer of more than 10M is usefull */
RANGE(SNDBUF_SIZE, 1, 10000000);
- /* arbitrary. */
- RANGE(MAX_BUFFERS, 32, 10000);
+ /* @4k PageSize -> 128kB - 512MB */
+ RANGE(MAX_BUFFERS, 32, 131072);
/* 0 is disabled.
* 200 should be more than enough even for very short timeouts */
Modified: trunk/user/drbdadm.h
===================================================================
--- trunk/user/drbdadm.h 2005-07-26 11:37:12 UTC (rev 1899)
+++ trunk/user/drbdadm.h 2005-07-26 12:05:27 UTC (rev 1900)
@@ -22,6 +22,8 @@
SLEEPS_FOREVER = 4,
SUPRESS_STDERR = 16,
+
+ DONT_REPORT_FAILED = 0x80,
};
/* for check_uniq(): Check for uniqueness of certain values...
@@ -31,9 +33,11 @@
/* for verify_ips(): are not verifyable ips fatal? */
#define INVALID_IP_IS_INVALID_CONF 0
+
struct d_globals
{
int disable_io_hints;
+ int disable_ip_verification;
int minor_count;
int dialog_refresh;
};
Modified: trunk/user/drbdadm_main.c
===================================================================
--- trunk/user/drbdadm_main.c 2005-07-26 11:37:12 UTC (rev 1899)
+++ trunk/user/drbdadm_main.c 2005-07-26 12:05:27 UTC (rev 1900)
@@ -63,8 +63,9 @@
struct adm_cmd {
const char* name;
int (* function)(struct d_resource*,const char* );
- int show_in_usage;
- int res_name_required;
+ int show_in_usage :1;
+ int res_name_required :1;
+ int verify_ips :1;
};
struct deferred_cmd
@@ -75,6 +76,7 @@
};
extern int yyparse();
+extern int yydebug;
extern FILE* yyin;
int adm_attach(struct d_resource* ,const char* );
@@ -102,7 +104,7 @@
struct utsname nodeinfo;
int line=1;
int fline, c_resource_start;
-struct d_globals global_options = { 0, 0, 1 };
+struct d_globals global_options = { 0, 0, 0, 1 };
char *config_file = NULL;
struct d_resource* config = NULL;
struct d_resource* common = NULL;
@@ -110,6 +112,7 @@
int highest_minor;
int config_valid=1;
int dry_run;
+int do_verify_ips;
char* drbdsetup;
char* drbdmeta;
char* setup_opts[10];
@@ -172,39 +175,40 @@
};
struct adm_cmd cmds[] = {
- { "attach", adm_attach, 1, 1 },
- { "detach", adm_generic_s, 1, 1 },
- { "connect", adm_connect, 1, 1 },
- { "disconnect", adm_generic_s, 1, 1 },
- { "up", adm_up, 1, 1 },
- { "down", adm_generic_s, 1, 1 },
- { "primary", adm_generic_s, 1, 1 },
- { "secondary", adm_generic_s, 1, 1 },
- { "invalidate", adm_generic_l, 1, 1 },
- { "invalidate_remote", adm_generic_l, 1, 1 },
- { "outdate", adm_generic_b, 1, 1 },
- { "resize", adm_resize, 1, 1 },
- { "syncer", adm_syncer, 1, 1 },
- { "adjust", adm_adjust, 1, 1 },
- { "wait_connect", adm_wait_c, 1, 1 },
- { "state", adm_generic_s, 1, 1 },
- { "cstate", adm_generic_s, 1, 1 },
- { "dump", adm_dump, 1, 1 },
- { "create-md", admm_generic, 1, 1 },
- { "show-gi", adm_generic_b, 1, 1 },
- { "get-gi", adm_generic_b, 1, 1 },
- { "dump-md", admm_generic, 1, 1 },
- { "set-gi", admm_generic, 0, 1 },
- { "pri-on-incon-degr", adm_khelper, 0, 1 },
- { "pri-sees-sec-with-higher-gc", adm_khelper, 0, 1 },
- { "outdate-peer", adm_khelper, 0, 1 },
- { "wait_con_int", adm_wait_ci, 1, 0 },
- { "sh-resources", sh_resources, 0, 0 },
- { "sh-mod-parms", sh_mod_parms, 0, 0 },
- { "sh-dev", sh_dev, 0, 1 },
- { "sh-ll-dev", sh_ll_dev, 0, 1 },
- { "sh-md-dev", sh_md_dev, 0, 1 },
- { "sh-md-idx", sh_md_idx, 0, 1 }
+/* name, function, show, needs res, verify_ips */
+ { "attach", adm_attach, 1,1,1 },
+ { "detach", adm_generic_s, 1,1,1 },
+ { "connect", adm_connect, 1,1,1 },
+ { "disconnect", adm_generic_s, 1,1,0 },
+ { "up", adm_up, 1,1,1 },
+ { "down", adm_generic_s, 1,1,0 },
+ { "primary", adm_generic_s, 1,1,1 },
+ { "secondary", adm_generic_s, 1,1,1 },
+ { "invalidate", adm_generic_l, 1,1,1 },
+ { "invalidate_remote", adm_generic_l, 1,1,1 },
+ { "outdate", adm_generic_b, 1,1,0 },
+ { "resize", adm_resize, 1,1,1 },
+ { "syncer", adm_syncer, 1,1,1 },
+ { "adjust", adm_adjust, 1,1,1 },
+ { "wait_connect", adm_wait_c, 1,1,1 },
+ { "state", adm_generic_s, 1,1,0 },
+ { "cstate", adm_generic_s, 1,1,1 },
+ { "dump", adm_dump, 1,1,1 },
+ { "create-md", admm_generic, 1,1,0 },
+ { "show-gi", adm_generic_b, 1,1,0 },
+ { "get-gi", adm_generic_b, 1,1,0 },
+ { "dump-md", admm_generic, 1,1,0 },
+ { "set-gi", admm_generic, 0,1,0 },
+ { "pri-on-incon-degr", adm_khelper, 0,1,0 },
+ { "pri-sees-sec-with-higher-gc", adm_khelper, 0,1,0 },
+ { "outdate-peer", adm_khelper, 0,1,0 },
+ { "wait_con_int", adm_wait_ci, 1,0,1 },
+ { "sh-resources", sh_resources, 0,0,0 },
+ { "sh-mod-parms", sh_mod_parms, 0,0,0 },
+ { "sh-dev", sh_dev, 0,1,0 },
+ { "sh-ll-dev", sh_ll_dev, 0,1,0 },
+ { "sh-md-dev", sh_md_dev, 0,1,0 },
+ { "sh-md-idx", sh_md_idx, 0,1,0 },
};
/*** These functions are used to the print the config ***/
@@ -250,17 +254,17 @@
static void dump_global_info()
{
- if (global_options.minor_count || global_options.disable_io_hints)
- {
- printI("global {\n"); ++indent;
- if (global_options.disable_io_hints)
- printI("disable-io-hints;\n");
- if (global_options.minor_count)
- printI("minor-count %i;\n", global_options.minor_count);
- if (global_options.dialog_refresh != 1)
- printI("dialog-refresh %i;\n", global_options.dialog_refresh);
- --indent; printI("}\n\n");
- }
+ if ( !global_options.minor_count
+ && !global_options.disable_ip_verification
+ && global_options.dialog_refresh == 1 ) return;
+ printI("global {\n"); ++indent;
+ if (global_options.disable_ip_verification)
+ printI("disable-ip-verification;\n");
+ if (global_options.minor_count)
+ printI("minor-count %i;\n", global_options.minor_count);
+ if (global_options.dialog_refresh != 1)
+ printI("dialog-refresh %i;\n", global_options.dialog_refresh);
+ --indent; printI("}\n\n");
}
static void dump_common_info()
@@ -540,7 +544,7 @@
if( flags & SLEEPS_FINITE ) {
alarm(0);
sigaction(SIGALRM,&so,NULL);
- if(rv >= 10 && !(flags & SUPRESS_STDERR) ) {
+ if(rv >= 10 && !(flags & (DONT_REPORT_FAILED|SUPRESS_STDERR))) {
fprintf(stderr,"Command '");
while(*argv) {
fprintf(stderr,"%s",*argv++);
@@ -937,15 +941,21 @@
pids[i++]=m_system(argv,RETURN_PID);
}
- wtime = global_options.dialog_refresh ?
+ wtime = global_options.dialog_refresh ?
global_options.dialog_refresh : -1;
start = time(0);
- rr = gets_timeout(pids,0,0,3*1000); // no string, but timeout of 3 seconds.
- check_exit_codes(pids);
+ for (i = 0; i < 10; i++) {
+ // no string, but timeout
+ rr = gets_timeout(pids,0,0,1*1000);
+ if (rr < 0) break;
+ putchar('.');
+ fflush(stdout);
+ check_exit_codes(pids);
+ }
if(rr == 0) {
- printf("***************************************************************\n"
+ printf("\n***************************************************************\n"
" DRBD's startup script waits for the peer node(s) to appear.\n"
" - In case this node was already a degraded cluster before the\n"
" reboot the timeout is %s seconds. [degr-wfc-timeout]\n"
@@ -973,7 +983,6 @@
printf(" To abort waiting enter 'yes' [ -- ]:");
}
}
-
} while( rr != -1 );
printf("\n");
}
@@ -986,7 +995,7 @@
return 0;
}
-void print_usage()
+void print_usage_and_exit(const char* addinfo)
{
int i;
struct option *opt;
@@ -1018,6 +1027,9 @@
printf("\nVersion: "REL_VERSION" (api:%d)\n%s\n",
API_VERSION, drbd_buildtag());
+ if (addinfo)
+ printf("\n%s\n",addinfo);
+
exit(E_usage);
}
@@ -1031,7 +1043,8 @@
char *argv[] = { "/bin/bash", "-c", NULL, "drbdadm:verify_ips", NULL };
int ex;
- if (dry_run == 1) return;
+ if (global_options.disable_ip_verification) return;
+ if (dry_run == 1 || do_verify_ips == 0) return;
if (!(res && res->me && res->me->address
&& res->peer && res->peer->address)) {
@@ -1053,7 +1066,7 @@
"fi >/dev/null",
my_ip);
if (ex < 0) { perror("asprintf"); exit(E_thinko); }
- ex = m_system(argv,SLEEPS_SHORT);
+ ex = m_system(argv,SLEEPS_SHORT|DONT_REPORT_FAILED);
free(argv[2]); argv[2] = NULL;
if (ex != 0) {
@@ -1191,6 +1204,7 @@
int i,rv=0;
struct adm_cmd *cmd;
struct d_resource *res,*tmp;
+ char *env_drbd_nodename = NULL;
drbdsetup=NULL;
drbdmeta=NULL;
@@ -1198,11 +1212,20 @@
yyin=NULL;
uname(&nodeinfo); /* FIXME maybe fold to lower case ? */
+ env_drbd_nodename = getenv("__DRBD_NODE__");
+ if (env_drbd_nodename && *env_drbd_nodename) {
+ strncpy(nodeinfo.nodename,env_drbd_nodename,sizeof(nodeinfo.nodename)-1);
+ nodeinfo.nodename[sizeof(nodeinfo.nodename)] = 0;
+ fprintf(stderr, "\n"
+ " found __DRBD_NODE__ in environment\n"
+ " PRETENDING that I am >>%s<<\n\n",nodeinfo.nodename);
+ }
+
if( (progname=strrchr(argv[0],'/')) )
argv[0] = ++progname;
else
progname=argv[0];
- if(argc == 1) print_usage(); // arguments missing.
+ if(argc == 1) print_usage_and_exit("missing arguments"); // arguments missing.
opterr=1;
optind=0;
@@ -1249,19 +1272,20 @@
case '?':
// commented out, since opterr=1
//fprintf(stderr,"Unknown option %s\n",argv[optind-1]);
+ fprintf(stderr,"try '%s help'\n",progname);
return 20;
break;
}
}
- if ( optind == argc ) print_usage();
+ if ( optind == argc ) print_usage_and_exit(0);
while(argv[optind][0]=='-' || argv[optind][0]==':' ||
isdigit(argv[optind][0]) ) {
setup_opts[soi++]=argv[optind++];
- if (optind == argc) print_usage();
+ if (optind == argc) print_usage_and_exit(0);
}
- if (optind == argc) print_usage();
+ if (optind == argc) print_usage_and_exit(0);
cmd=NULL;
for(i=0;i<ARRY_SIZE(cmds);i++) {
@@ -1272,10 +1296,12 @@
}
if(cmd==NULL) {
+ if (!strncmp("help",argv[optind],5)) print_usage_and_exit(0);
fprintf(stderr,"Unknown command '%s'.\n",argv[optind]);
exit(E_usage);
}
optind++;
+ do_verify_ips = cmd->verify_ips;
if (!config_file) {
i=0;
@@ -1315,11 +1341,17 @@
exit(E_exec_error);
};
+ //yydebug = 1;
yyparse();
if(!config_valid) exit(E_config_invalid);
- {
+ if (config == NULL) {
+ fprintf(stderr, "no resources defined!\n");
+ exit(0); /* THINK exit here? what code? */
+ }
+
+ { /* block for mc to avoid compiler warnings */
int mc=global_options.minor_count;
highest_minor=0;
@@ -1349,11 +1381,12 @@
if(cmd->res_name_required)
{
- if (optind + 1 > argc && cmd->function != adm_dump)
- print_usage (argv[0]); // arguments missing.
+ int is_dump = (cmd->function == adm_dump);
+ if (optind + 1 > argc && !is_dump)
+ print_usage_and_exit("missing arguments"); // arguments missing.
- if(optind==argc || !strcmp(argv[optind],"all")) {
- if (cmd->function == adm_dump) {
+ if ( optind==argc || !strcmp(argv[optind],"all") ) {
+ if (is_dump) {
dump_global_info();
dump_common_info();
} else {
Modified: trunk/user/drbdadm_parser.y
===================================================================
--- trunk/user/drbdadm_parser.y 2005-07-26 11:37:12 UTC (rev 1899)
+++ trunk/user/drbdadm_parser.y 2005-07-26 12:05:27 UTC (rev 1900)
@@ -1,5 +1,7 @@
%{
+#define _GNU_SOURCE
+
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -11,6 +13,8 @@
extern void yyerror(char* text);
extern int yylex(void);
+#define YYDEBUG 1
+
#define APPEND(LIST,ITEM) ({ \
typeof((LIST)) _l = (LIST); \
typeof((ITEM)) _i = (ITEM); \
@@ -25,6 +29,7 @@
})
static struct d_resource* c_res;
+static struct d_resource* c_config;
static struct d_host_info* c_host;
static char* c_hostname;
static int c_section_start, n_hosts;
@@ -223,7 +228,7 @@
#define CHKU(what,val) \
c_host->what = val; \
- check_uniq( #what, "%s:%s",c_hostname,val)
+ check_uniq( #what, "%s:%s:%s", #what, c_hostname,val)
#define CHKS(sname) \
check_uniq(sname " section","%s:" sname, c_res->name)
@@ -238,6 +243,7 @@
%token TK_GLOBAL TK_RESOURCE
%token TK_ON TK_NET TK_DISK_S TK_SYNCER TK_STARTUP
%token TK_DISABLE_IO_HINTS
+%token TK_DISABLE_IP_VERIFICATION
%token TK_PROTOCOL TK_HANDLERS TK_COMMON
%token TK_ADDRESS TK_DISK TK_DEVICE TK_META_DISK
%token <txt> TK_MINOR_COUNT TK_INTEGER TK_STRING
@@ -272,7 +278,14 @@
;
glob_stmt: TK_DISABLE_IO_HINTS
- { global_options.disable_io_hints=1; }
+ {
+ fprintf(stderr,
+ "%s:%d: in global section, "
+ "useless use of no longer available option \"disable_io_hints\".\n",
+ config_file, line);
+ }
+ | TK_DISABLE_IP_VERIFICATION
+ { global_options.disable_ip_verification=1; }
| TK_MINOR_COUNT TK_INTEGER
{
range_check(R_MINOR_COUNT,$1,$2);
@@ -290,8 +303,8 @@
res_stmts { common = c_res; }
;
-resources: /* empty */ { $$ = NULL; }
- | resources resource { $$=APPEND($1,$2); }
+resources: /* empty */ { $$ = 0; c_config = 0; }
+ | resources resource { $$=APPEND($1,$2); c_config=$$; }
;
resource: TK_RESOURCE { n_hosts = 0; } resource_name res_stmts
Modified: trunk/user/drbdadm_scanner.fl
===================================================================
--- trunk/user/drbdadm_scanner.fl 2005-07-26 11:37:12 UTC (rev 1899)
+++ trunk/user/drbdadm_scanner.fl 2005-07-26 12:05:27 UTC (rev 1900)
@@ -31,16 +31,6 @@
* -- lge
*/
-/*
- * Philipp dislikes syntax diversity, and wants terminating semicolons.
- * So I drop what I thought would be nice to have: plain English and
- * punctuation...
-ASSIGN {LS}*[:=]{LS}*|{LS}(is{LS})?
-DISK disk|"on top of"
-IGNORE ({WSC}*(use|with)*)+
-NDELIM [^ \t\n#=:;{}]+
-*/
-
%}
%option noyywrap
@@ -51,29 +41,31 @@
%x SEMICOLON ASSIGN NUM NUM_U NAME STRING PROTO IO_ERROR ON_DISCONNECT
%x IP_AND_PORT PORT META_DISK META_IDX
%x LS LBRACE IGNORE_SECTION
+%x COMMENT
-LS [ \t]+
-WS [ \t\n]+
-COMMENT \#[^\n]*
-WSC ({WS}|{COMMENT}\n)+
+LS [ \t]{1,80}
+WS ({LS}|\n)
+COMMENT_START \#
ASSIGN {LS}
OUT_OF_RANGE_NUM [0-9]{10,}[kmgKMG]?
NUM [0-9]{1,9}
NUM_U [0-9]{1,9}[kmgKMG]?
-NAME [/_.A-Za-z0-9-]+
-STRING ({NAME}|\"([^\"\\\n]*|\\.)*\")+
-USTRING \"([^\"\\\n]*|\\.)*
+NAME [/_.A-Za-z0-9-]{1,80}
+ENAME [/_.A-Za-z0-9-]{81}
+L_NO_DQUOTES [^\"\\\n]
+STRING ({NAME}|\"{L_NO_DQUOTES}{1,80}\")
+ESTRING (\"{L_NO_DQUOTES}{81}|\"\")
DISK disk
INTERN internal|\"internal\"
-META_IDX {LS}*\[{LS}*{NUM}{LS}*\]
-O_IDX {WSC}meta-index{ASSIGN}
-IGNORE {WSC}
-SKIP skip({LS}[^{\n]*)?
-NDELIM [^ \t\n#;{}]+
-_1_254 [1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]
-_0_255 0|[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-5]
+META_IDX {LS}?\[{LS}?{NUM}{LS}?\]
+O_IDX {WS}meta-index{ASSIGN}
+IGNORE {WS}
+SKIP skip({LS}[^{\n]{0,80})?
+NDELIM [^ \t\n#;{}]{1,50}
+_1_254 [1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-4]
+_0_255 0|[1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]
IPV4ADDR {_1_254}\.{_0_255}\.{_0_255}\.{_1_254}
-PORT {WSC}port{ASSIGN}{NUM}
+PORT {WS}port{ASSIGN}{NUM}
COMMON common
%%
@@ -82,9 +74,16 @@
{SKIP} section(IGNORE_SECTION);
}
+<INITIAL,ASSIGN,LBRACE,META_IDX,RESOURCE,GLOBAL,STARTUP,DISK,NET,SYNCER,HOST,PORT>{
+ {COMMENT_START} {
+ char c;
+ while ((c = input()) != '\n' && c != EOF);
+ if (c == '\n') ++line;
+ }
+}
+
<INITIAL>{
- {COMMENT} /* discard last comment if no eol at eof */
- {WSC} update_lcnt();
+ {WS} update_lcnt();
global section(GLOBAL); return TK_GLOBAL;
resource named_section(RESOURCE); return TK_RESOURCE;
\} syntax_error("unmached closing brace.");
@@ -98,8 +97,9 @@
}
<NAME>{
+ {ENAME} syntax_error("name too long.\n");
{NAME} yy_pop_state(); CP; return TK_STRING;
- [^ \t\n#]+ expect_error("name"); /* not referenced currently */
+ [^ \t\n#]{1,80} expect_error("name"); /* not referenced currently */
}
<SEMICOLON>{
@@ -112,7 +112,7 @@
<ASSIGN>{
{ASSIGN} yy_pop_state(); fline = line;
= syntax_error("don't use '=' signs anymore!");
- {WSC} syntax_error("linebreak between option and value not allowed.\n");
+ {WS} syntax_error("linebreak between option and value not allowed.\n");
{NDELIM} expect_error("whitespace");
}
@@ -134,8 +134,9 @@
}
<STRING>{
+ {ENAME} syntax_error("name too long.\n");
+ {ESTRING} syntax_error("string terminator missing or string too long.\n");
{STRING} yy_pop_state(); unescape(); CP; return TK_STRING;
- {USTRING} syntax_error("string terminator missing.\n");
{NDELIM} expect_error("string"); yy_pop_state();
}
@@ -147,7 +148,8 @@
<PORT>{
: BEGIN(NUM); /* this is only reached when I have a colon */
- {WSC}port{ASSIGN} {
+ {WS} update_lcnt();
+ port{ASSIGN} {
/* or a 'port = ' following the 'address = ' */
update_lcnt(); BEGIN(NUM);
PRINTF("'port=<port>' deprecated, "
@@ -156,16 +158,17 @@
}
<IP_AND_PORT>{
+ {LS} /* ignore */
+ \" syntax_error("please do not quote IP:PORT.\n");
{IPV4ADDR}/:{NUM} BEGIN(PORT); CP; return TK_IPADDR;
{IPV4ADDR}/{PORT} BEGIN(PORT); CP; return TK_IPADDR;
{IPV4ADDR} syntax_error("':PORT' missing from IP:PORT.\n");
- \"{IPV4ADDR}[^ \t\n]+ syntax_error("please do not quote IP:PORT.\n");
- [0-9.:]+ expect_error("valid IP");
{NDELIM} expect_error("IP and port 'XXX.XXX.XXX.XXX:PORT'");
}
<META_IDX>{
{META_IDX} unescape_midx(); yy_pop_state(); CP; return TK_INTEGER;
+ {WS} update_lcnt();
{O_IDX} {
update_lcnt(); BEGIN(NUM);
PRINTF("'meta-index=<idx>' deprecated, "
@@ -177,9 +180,10 @@
{INTERN} unescape(); yy_pop_state(); CP; return TK_STRING;
{INTERN}{META_IDX} |
{INTERN}{O_IDX} syntax_error("don't give an index for internal meta-data.");
+ {ESTRING} syntax_error("string terminator missing or string too long.\n");
{STRING}/{META_IDX} |
{STRING}/{O_IDX}{NUM} unescape(); BEGIN(META_IDX); CP; return TK_STRING;
- {STRING}{LS}*{NDELIM} expect_error("meta-disk: index missing; either 'internal' or '/dev/ice/name [index]'");
+ {STRING}{LS}?{NDELIM} expect_error("meta-disk: index missing; either 'internal' or '/dev/ice/name [index]'");
{NDELIM} expect_error("either 'internal' or '/dev/ice/name [index]'");
}
@@ -189,12 +193,14 @@
}
<LBRACE>{
- {WSC}*\{{WSC}* update_lcnt(); yy_pop_state();
- {WSC}*[^{ \t\n]+ expect_error("'{'");
+ {WS} update_lcnt();
+ \{ update_lcnt(); yy_pop_state();
+ [^{ \t\n]{1,40} expect_error("'{'");
}
<IGNORE_SECTION>{
- [^{}]+ update_lcnt(); /* no ECHO */
+ [^{}\n]{1,80} /* no ECHO */
+ {WS} update_lcnt(); /* no ECHO */
\{ yy_push_state(IGNORE_SECTION);
}
@@ -202,6 +208,7 @@
minor-count do_assign(NUM); CP; return TK_MINOR_COUNT;
disable-io-hints yy_push_state(SEMICOLON); return TK_DISABLE_IO_HINTS;
dialog-refresh do_assign(NUM); CP; return TK_DIALOG_REFRESH;
+ disable-ip-verification yy_push_state(SEMICOLON); return TK_DISABLE_IP_VERIFICATION;
{NDELIM} expect_error("'minor-count|disable-io-hints|dialog-refresh'");
}
@@ -231,7 +238,8 @@
<DISK>{
on-io-error do_assign(IO_ERROR); CP; return TK_ON_IO_ERROR;
split-brain-fix yy_push_state(SEMICOLON); CP; return TK_SPLIT_BRAIN_FIX;
- {NDELIM} expect_error("'on-io-error|split-brain-fix'");
+ size do_assign(NUM_U); CP; return TK_SIZE;
+ {NDELIM} expect_error("'on-io-error|split-brain-fix|size'");
}
<IO_ERROR>{
Modified: trunk/user/drbdsetup.c
===================================================================
--- trunk/user/drbdsetup.c 2005-07-26 11:37:12 UTC (rev 1899)
+++ trunk/user/drbdsetup.c 2005-07-26 12:05:27 UTC (rev 1900)
@@ -411,7 +411,7 @@
switch(c)
{
case 'd':
- cn->config.disk_size = m_strtoll_range(optarg,'K', "disk-size",
+ cn->config.disk_size = m_strtoll_range(optarg,'K', "size",
DRBD_DISK_SIZE_SECT_MIN>>1,
DRBD_DISK_SIZE_SECT_MAX>>1 ) << 1;
break;
@@ -1042,7 +1042,7 @@
switch(c)
{
case 'd':
- u_size=m_strtoll_range(optarg,'K', "disk-size",
+ u_size=m_strtoll_range(optarg,'K', "size",
DRBD_DISK_SIZE_SECT_MIN>>1,
DRBD_DISK_SIZE_SECT_MAX>>1 ) << 1;
break;
More information about the drbd-cvs
mailing list