]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
befs: make consistent use of befs_error()
authorLuis de Bethencourt <luisbg@osg.samsung.com>
Sun, 3 Jul 2016 15:29:44 +0000 (16:29 +0100)
committerLuis de Bethencourt <luisbg@osg.samsung.com>
Sat, 8 Oct 2016 09:01:16 +0000 (10:01 +0100)
befs_error() is used in potential errors that could happen in befs to
provide informational log messages. befs_debug() is silent when
CONFIG_BEFS_DEBUG=no, and very verbose when switched on, which is why it is
used for general debugging but not for errors.

Fix a few cases where the befs debug utility usage isn't following the
expected pattern. To make sure we have consistent information in the logs.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
fs/befs/btree.c
fs/befs/datastream.c
fs/befs/linuxvfs.c

index 307645f9e284c546db0e3d94e989e3064791b343..679f69df38174eb4027a08b2c299736457992135 100644 (file)
@@ -301,7 +301,8 @@ befs_btree_find(struct super_block *sb, const befs_data_stream *ds,
        kfree(this_node);
 
        if (res != BEFS_BT_MATCH) {
-               befs_debug(sb, "<--- %s Key %s not found", __func__, key);
+               befs_error(sb, "<--- %s Key %s not found", __func__, key);
+               befs_debug(sb, "<--- %s ERROR", __func__);
                *value = 0;
                return BEFS_BT_NOT_FOUND;
        }
@@ -358,7 +359,8 @@ befs_find_key(struct super_block *sb, struct befs_btree_node *node,
 
        eq = befs_compare_strings(thiskey, keylen, findkey, findkey_len);
        if (eq < 0) {
-               befs_debug(sb, "<--- %s %s not found", __func__, findkey);
+               befs_error(sb, "<--- %s %s not found", __func__, findkey);
+               befs_debug(sb, "<--- %s ERROR", __func__);
                return BEFS_BT_NOT_FOUND;
        }
 
index 26cc417cbdce678a425cb8bfd0b7109007c8b880..740fabcd57c0a6a47fdda8f3a74c4b328d6021a9 100644 (file)
@@ -275,6 +275,8 @@ befs_find_brun_direct(struct super_block *sb, const befs_data_stream *data,
                }
        }
 
+       befs_error(sb, "%s failed to find file block %lu", __func__,
+                  (unsigned long)blockno);
        befs_debug(sb, "---> %s ERROR", __func__);
        return BEFS_ERR;
 }
@@ -328,9 +330,10 @@ befs_find_brun_indirect(struct super_block *sb,
        for (i = 0; i < indirect.len; i++) {
                indirblock = sb_bread(sb, indirblockno + i);
                if (indirblock == NULL) {
-                       befs_debug(sb, "---> %s failed to read "
+                       befs_error(sb, "---> %s failed to read "
                                   "disk block %lu from the indirect brun",
                                   __func__, (unsigned long)indirblockno + i);
+                       befs_debug(sb, "<--- %s ERROR", __func__);
                        return BEFS_ERR;
                }
 
index e0979a471e846dcca077386279d44d72e28e251b..67669a81cfd19d64abf1ca440cb1601be4b099ac 100644 (file)
@@ -187,7 +187,7 @@ befs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
                return ERR_PTR(-ENOENT);
 
        } else if (ret != BEFS_OK || offset == 0) {
-               befs_warning(sb, "<--- %s Error", __func__);
+               befs_error(sb, "<--- %s Error", __func__);
                return ERR_PTR(-ENODATA);
        }