]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mkcephfs: error when creating journal file in a directory that differs from OSD...
authorCC Lien <cc_lien@tcloudcomputing.com>
Thu, 3 Jun 2010 16:45:10 +0000 (09:45 -0700)
committerSage Weil <sage@newdream.net>
Thu, 3 Jun 2010 16:45:10 +0000 (09:45 -0700)
mkcephfs creates osd data directory automatically, but it doesn't create a
directory for the osd journal file.

When you have a journal file in a directory that differs from the osd data
directory in your configuration, like:

       osd data = /osd/osd$id
       osd journal = /journal/osd$id

You will receive a "mount failed to open journal /journal/osd0/journal: No
such file or directory" error when doing mkcephfs

Signed-off-by: CC Lien <cc_lien@tcloudcomputing.com>
src/mkcephfs.in

index 1caddf190a7d19a2a28639ee3c8702e550e29526..6c1f2dc97223cc736ed00a666f0fccca67a58086 100644 (file)
@@ -220,6 +220,7 @@ for name in $what; do
 
     if [ "$type" = "osd" ]; then
        get_conf osd_data "" "osd data"
+       get_conf osd_journal "" "osd journal"
        get_conf keyring "" "keyring"
        get_conf btrfs_path "$osd_data" "btrfs path"  # mount point defaults so osd data
        get_conf btrfs_devs "" "btrfs devs"
@@ -228,6 +229,7 @@ for name in $what; do
        [ -n "$btrfs_opt" ] && btrfs_opt="-o $btrfs_opt"
        
        do_cmd "test -d $osd_data || mkdir -p $osd_data"
+       [ -n "$osd_journal" ] && do_cmd "test -d $osd_journal || mkdir -p `dirname $osd_journal`"
 
        if [ $mkbtrfs -eq 1 ]; then
            get_conf osd_user "root" "user"