Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux-HA: Dev

[patch] Filesystem RA support for tmpfs

 

 

Linux-HA dev RSS feed   Index | Next | Previous | View Threaded


e-man at ghost

Aug 28, 2011, 5:57 AM

Post #1 of 2 (270 views)
Permalink
[patch] Filesystem RA support for tmpfs

Hi,

I needed to mount tmpfs, but the current RA would fail, so I modified
it. The params would look like this:

device="none"
fstype="tmpfs"
directory="/foo"
options="size=512m"

Changes made:

- don't check for /dev/* if fstype is tmpfs
- blockdevice="no" for tmpfs
- first check /proc/filesystems and only modprobe when necessary

Patch is attached.

Regards,
Endre Holecz
Attachments: Filesystem.patch (1.39 KB)


dejan at suse

Sep 1, 2011, 4:29 AM

Post #2 of 2 (257 views)
Permalink
Re: [patch] Filesystem RA support for tmpfs [In reply to]

Hi,

On Sun, Aug 28, 2011 at 02:57:25PM +0200, Endre Holecz wrote:
> Hi,
>
> I needed to mount tmpfs, but the current RA would fail, so I modified
> it. The params would look like this:
>
> device="none"
> fstype="tmpfs"
> directory="/foo"
> options="size=512m"
>
> Changes made:
>
> - don't check for /dev/* if fstype is tmpfs
> - blockdevice="no" for tmpfs
> - first check /proc/filesystems and only modprobe when necessary

The first two are apparently unrelated to the third. Unless I'm
missing something. I'll apply all but that hunk.

The /proc/filesystems check part needs fixing:

grep -e "$FSTYPE"'$' /proc/filesystems

If there are two filesystems sharing a suffix, that can break.
Don't know how likely that is.

Best would be to create a function, say is_fs_supported, then
put a correct check over there.

> Patch is attached.

Many thanks for the patch.

Cheers,

Dejan

> Regards,
> Endre Holecz

> --- Filesystem.orig 2011-08-25 23:20:04.000000000 +0200
> +++ Filesystem 2011-08-28 11:51:00.101691214 +0200
> @@ -236,7 +236,7 @@
> # Get the current real device name, if possible.
> # (specified devname could be -L or -U...)
> case "$FSTYPE" in
> - nfs|smbfs|cifs|none) ;;
> + nfs|smbfs|cifs|none|tmpfs) ;;
> *) DEVICE=`list_mounts | grep " $MOUNTPOINT " | cut -d' ' -f1`
> if [ -b "$DEVICE" ]; then
> blockdevice=yes
> @@ -417,7 +417,7 @@
> no) false;;
> ""|auto)
> case $FSTYPE in
> - ext4|ext4dev|ext3|reiserfs|reiser4|nss|xfs|jfs|vfat|fat|nfs|cifs|smbfs|ocfs2|gfs2|none|lustre)
> + tmpfs|ext4|ext4dev|ext3|reiserfs|reiser4|nss|xfs|jfs|vfat|fat|nfs|cifs|smbfs|ocfs2|gfs2|none|lustre)
> false;;
> *)
> true;;
> @@ -461,8 +461,11 @@
> if [ -z "$FSTYPE" -o "$FSTYPE" = none ]; then
> : No FSTYPE specified, rely on the system has the right file-system support already
> else
> - # Insert Filesystem module
> - $MODPROBE $FSTYPE >/dev/null
> + grep -e "$FSTYPE"'$' /proc/filesystems >/dev/null
> + if [ $? -ne 0 ] ; then
> + # Insert Filesystem module
> + $MODPROBE $FSTYPE >/dev/null
> + fi
> grep -e "$FSTYPE"'$' /proc/filesystems >/dev/null
> if [ $? -ne 0 ] ; then
> ocf_log err "Couldn't find filesystem $FSTYPE in /proc/filesystems"
> @@ -972,6 +975,8 @@
> ;;
> //[!/]*/*) # An SMB filesystem specification...
> ;;
> +none)
> + ;;
> /dev/null) # Special case for BSC
> blockdevice=yes
> ;;

> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev [at] lists
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/

_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Linux-HA dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.