Skip to contentSkip to conversation

evms plugin for hptraid support <<<pre-alpha>>>

PATCH Wilfried Weissmann 1 participant 2 messages Feb 27, 2004 – Mar 9, 2004 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

hi,

this is my attempt to add support for the ataraid devices to the 2.6 kernel. the code is as far as possible from being mature and useable as one could imagine (i have not even requested any plugin-ids for the evms engine). for now it only detects the HPT370A controller, because of i am
checking the pci-ids of the controller to prevent that any non-raid
disks are stolen by the raid module. this would happen with the current ataraid code from the kernel v2.4.

the attached patch applies against evms 2.2.2 and adds a bios module for handling the hpt-volumes. after running evms_activate the partitions on the raid volumes nodes are created as /dev/evms/hptraidXpY. X is the volume index and Y is the partition number. i succeeded in mounting a 4gb fat partition and tarring up the contents. more testing is still on my todo list.

the code is based on the local disk manager plugin and i hope i have got all the copyright stuff right.

the current features are:
* supports the HPT370A raid controller
* supports disk striping (raid-0)
* works with kernel 2.6 (tested with 2.6.2)
* the volume is scanned by the segment managers (dos & bsd) to create block devices for the partitions

todos:
* access to the last sector (kernel 2.6 only)
* add more controllers
* add mode raid levels
* create "whole disk" volume (currently only under .nodes)
* use sysfs for scanning
* get official evms plugin ids
* more modular design to make it easier to add code for other controllers
* more testing

i am sure i did it *all wrong* so comments are welcome. after all, this is the first thing that i ever did with evms. ;)

greetings,
wilfried

PS: can anyone get me a plugin id?

aclocal.m4 +14 -1
diff -Nurp evms-2.2.2/aclocal.m4 evms-2.2.2-bios/aclocal.m4
@@ -131,11 +131,16 @@ AC_ARG_ENABLE([rsct],
 			     [Disable the RSCT plugin]),
 	      [build_rsct="$enableval"],
 	      [build_rsct="yes"])
+AC_ARG_ENABLE([bios],
+	      AC_HELP_STRING([--disable-bios],
+			     [Disable the BIOS plugin]),
+	      [build_bios="$enableval"],
+	      [build_bios="yes"])
 
 # Create the list of plugin directories to build. This is where each plugin
 # can specify its dependencies.
 plugin_dirs=""
-plugin_distdirs="aix bbr bbr_seg bsd csm disk dos drivelink ext2 gpt ha jfs lvm mac md ogfs os2 reiser replace rsct s390 snapshot sparse swap xfs"
+plugin_distdirs="aix bbr bbr_seg bsd csm disk dos drivelink ext2 gpt ha jfs lvm mac md ogfs os2 reiser replace rsct s390 snapshot sparse swap xfs bios"
 
 # AIX
 if test "$build_aix" = "no"; then
@@ -355,6 +360,14 @@ elif test "$have_uuid" = "no"; then
 else
 	plugin_dirs="$plugin_dirs xfs"
 	AC_MSG_NOTICE([     building xfs])
+fi
+
+# bios
+if test "$build_bios" = "no"; then
+	AC_MSG_NOTICE([     not building bios ... disabled by user])
+else
+	plugin_dirs="$plugin_dirs bios"
+	AC_MSG_NOTICE([     building bios])
 fi
 
 AC_SUBST(plugin_dirs)
configure +21 -2
diff -Nurp evms-2.2.2/configure evms-2.2.2-bios/configure
@@ -866,6 +866,7 @@ Optional Features:
   --disable-jfs           Disable the JFS FSIM
   --disable-reiser        Disable the ReiserFS FSIM
   --disable-xfs           Disable the XFS FSIM
+  --disable-bios          Disable the BIOS plugin
   --disable-swap          Disable the Swap FSIM
   --disable-replace       Disable the Replace plugin
   --disable-ha            Disable the HA plugin
@@ -10310,6 +10311,13 @@ if test "${enable_xfs+set}" = set; then
 else
   build_xfs="yes"
 fi;
+# Check whether --enable-bios or --disable-bios was given.
+if test "${enable_bios+set}" = set; then
+  enableval="$enable_bios"
+  build_bios="$enableval"
+else
+  build_bios="yes"
+fi;
 # Check whether --enable-swap or --disable-swap was given.
 if test "${enable_swap+set}" = set; then
   enableval="$enable_swap"
@@ -10342,7 +10350,7 @@ fi;
 # Create the list of plugin directories to build. This is where each plugin
 # can specify its dependencies.
 plugin_dirs=""
-plugin_distdirs="aix bbr bbr_seg bsd csm disk dos drivelink ext2 gpt ha jfs lvm mac md ogfs os2 reiser replace rsct s390 snapshot sparse swap xfs"
+plugin_distdirs="aix bbr bbr_seg bsd csm disk dos drivelink ext2 gpt ha jfs lvm mac md ogfs os2 reiser replace rsct s390 snapshot sparse swap xfs bios"
 
 # AIX
 if test "$build_aix" = "no"; then
@@ -10626,6 +10634,16 @@ else
 echo "$as_me:      building xfs" >&6;}
 fi
 
+# BIOS
+if test "$build_bios" = "no"; then
+	{ echo "$as_me:$LINENO:      not building bios ... disabled by user" >&5
+echo "$as_me:      not building bios ... disabled by user" >&6;}
+else
+	plugin_dirs="$plugin_dirs bios"
+	{ echo "$as_me:$LINENO:      building bios" >&5
+echo "$as_me:      building bios" >&6;}
+fi
+
 
 
 
@@ -10751,7 +10769,7 @@ fi
 
 
 
-                                                                                                                                                                                                                                                                                                                                                                                                                          ac_config_files="$ac_config_files make.rules Makefile lib/Makefile lib/dlist/Makefile engine/Makefile plugins/Makefile plugins/aix/Makefile plugins/bbr/Makefile plugins/bbr_seg/Makefile plugins/bsd/Makefile plugins/csm/Makefile plugins/disk/Makefile plugins/dos/Makefile plugins/drivelink/Makefile plugins/ext2/Makefile plugins/gpt/Makefile plugins/ha/Makefile plugins/jfs/Makefile plugins/lvm/Makefile plugins/mac/Makefile plugins/md/Makefile plugins/ogfs/Makefile plugins/os2/Makefile plugins/reiser/Makefile plugins/replace/Makefile plugins/rsct/Makefile plugins/s390/Makefile plugins/snapshot/Makefile plugins/sparse/Makefile plugins/swap/Makefile plugins/xfs/Makefile ui/Makefile ui/cli/Makefile ui/gtk/Makefile ui/ncurses/Makefile ui/ncurses2/Makefile ui/utils/Makefile include/Makefile doc/Makefile doc/man/Makefile tests/Makefile"
+                                                                                                                                                                                                                                                                                                                                                                                                                          ac_config_files="$ac_config_files make.rules Makefile lib/Makefile lib/dlist/Makefile engine/Makefile plugins/Makefile plugins/aix/Makefile plugins/bbr/Makefile plugins/bbr_seg/Makefile plugins/bsd/Makefile plugins/csm/Makefile plugins/disk/Makefile plugins/dos/Makefile plugins/drivelink/Makefile plugins/ext2/Makefile plugins/gpt/Makefile plugins/ha/Makefile plugins/jfs/Makefile plugins/lvm/Makefile plugins/mac/Makefile plugins/md/Makefile plugins/ogfs/Makefile plugins/os2/Makefile plugins/reiser/Makefile plugins/replace/Makefile plugins/rsct/Makefile plugins/s390/Makefile plugins/snapshot/Makefile plugins/sparse/Makefile plugins/swap/Makefile plugins/xfs/Makefile plugins/bios/Makefile ui/Makefile ui/cli/Makefile ui/gtk/Makefile ui/ncurses/Makefile ui/ncurses2/Makefile ui/utils/Makefile include/Makefile doc/Makefile doc/man/Makefile tests/Makefile"
 
 
 cat >confcache <<\_ACEOF
@@ -11335,6 +11353,7 @@ do
   "plugins/sparse/Makefile" ) CONFIG_FILES="$CONFIG_FILES plugins/sparse/Makefile" ;;
   "plugins/swap/Makefile" ) CONFIG_FILES="$CONFIG_FILES plugins/swap/Makefile" ;;
   "plugins/xfs/Makefile" ) CONFIG_FILES="$CONFIG_FILES plugins/xfs/Makefile" ;;
+  "plugins/bios/Makefile" ) CONFIG_FILES="$CONFIG_FILES plugins/bios/Makefile" ;;
   "ui/Makefile" ) CONFIG_FILES="$CONFIG_FILES ui/Makefile" ;;
   "ui/cli/Makefile" ) CONFIG_FILES="$CONFIG_FILES ui/cli/Makefile" ;;
   "ui/gtk/Makefile" ) CONFIG_FILES="$CONFIG_FILES ui/gtk/Makefile" ;;
plugins/bios/Makefile.in +52 -0

52 lines not on this page · raw message

plugins/bios/bios.c +1355 -0

1,355 lines not on this page · raw message

plugins/bios/bios.h +131 -0

131 lines not on this page · raw message

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 14 lines · Sergey Vlasov
Quoted 3 lines · On Fri, 27 Feb 2004 22:16:33 +0100 Wilfried Weissmann wrote:

this is my attempt to add support for the ataraid devices to the 2.6 kernel. the code is as far as possible from being mature and useable as one could imagine (i have not even requested any plugin-ids for the evms engine). for now it only detects the HPT370A controller, because of i am
checking the pci-ids of the controller to prevent that any non-raid
disks are stolen by the raid module. this would happen with the current ataraid code from the kernel v2.4.

I'm not sure if this PCI ID checking is a good thing. With ataraid drivers, if your FakeRAID controller gets broken for some reason, you can just attach the disks to any available IDE controller and get access to your data. With the proposed PCI ID check this ability will be lost.

Quoted 3 lines

The problem with stale RAID superblocks on disks may be solved by adding a command to clear the RAID superblocks without touching the rest of data.

I can create a configuration option that controls or disables the PCI check. Claiming all disks that have raid signatures is a great feature for debugging and disaster recovery, but I think that if this is the default then it is more trouble than it is worth.

Regards,
Wilfried