[PATCH] ext2, ext4: include filesystem block size in error messages
by Robert Elliott
Print the problematic value in messages about the filesystem
block size.
Normalize all of the blocksize messages that use "blocksize" to
use "filesystem block size". This helps distinguish this block size
from the underlying block device's logical block size (i.e.,
sector size) and physical block size.
Example old messages:
EXT2-fs (pmem0): unable to set blocksize
EXT4-fs (pmem0): error: unsupported blocksize for dax
EXT4-fs (pmem0): unsupported blocksize for fs encryption
EXT2-fs (pmem0): bad blocksize %d
Example new message:
EXT4-fs (pmem0): error: unsupported filesystem block size 2048 for dax
Signed-off-by: Robert Elliott <elliott(a)hpe.com>
---
fs/ext2/super.c | 17 +++++++++++------
fs/ext4/super.c | 33 ++++++++++++++++++++-------------
2 files changed, 31 insertions(+), 19 deletions(-)
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index 748d35a..1186a5b 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -31,6 +31,7 @@
#include <linux/mount.h>
#include <linux/log2.h>
#include <linux/quotaops.h>
+#include <linux/stringify.h>
#include <asm/uaccess.h>
#include "ext2.h"
#include "xattr.h"
@@ -822,7 +823,9 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
*/
blocksize = sb_min_blocksize(sb, BLOCK_SIZE);
if (!blocksize) {
- ext2_msg(sb, KERN_ERR, "error: unable to set blocksize");
+ ext2_msg(sb, KERN_ERR,
+ "error: unable to set filesystem block size "
+ __stringify(BLOCK_SIZE));
goto failed_sbi;
}
@@ -921,7 +924,8 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
if (sbi->s_mount_opt & EXT2_MOUNT_DAX) {
if (blocksize != PAGE_SIZE) {
ext2_msg(sb, KERN_ERR,
- "error: unsupported blocksize for dax");
+ "error: unsupported filesystem block size %d for dax",
+ blocksize);
goto failed_mount;
}
if (!sb->s_bdev->bd_disk->fops->direct_access) {
@@ -937,7 +941,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
if (!sb_set_blocksize(sb, blocksize)) {
ext2_msg(sb, KERN_ERR,
- "error: bad blocksize %d", blocksize);
+ "error: bad filesystem block size %d", blocksize);
goto failed_sbi;
}
@@ -1007,14 +1011,15 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
if (sb->s_blocksize != bh->b_size) {
if (!silent)
- ext2_msg(sb, KERN_ERR, "error: unsupported blocksize");
+ ext2_msg(sb, KERN_ERR,
+ "error: unsupported filesystem block size %lu",
+ sb->s_blocksize);
goto failed_mount;
}
if (sb->s_blocksize != sbi->s_frag_size) {
ext2_msg(sb, KERN_ERR,
- "error: fragsize %lu != blocksize %lu"
- "(not supported yet)",
+ "error: fragsize %lu != filesystem block size %lu (not supported yet)",
sbi->s_frag_size, sb->s_blocksize);
goto failed_mount;
}
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index c9ab67d..9e1c049 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -42,6 +42,7 @@
#include <linux/kthread.h>
#include <linux/freezer.h>
+#include <linux/stringify.h>
#include "ext4.h"
#include "ext4_extents.h" /* Needed for trace points definition */
@@ -1750,8 +1751,9 @@ static int parse_options(char *options, struct super_block *sb,
BLOCK_SIZE << le32_to_cpu(sbi->s_es->s_log_block_size);
if (blocksize < PAGE_CACHE_SIZE) {
- ext4_msg(sb, KERN_ERR, "can't mount with "
- "dioread_nolock if block size != PAGE_SIZE");
+ ext4_msg(sb, KERN_ERR,
+ "can't mount with dioread_nolock if filesystem block size %d != PAGE_SIZE",
+ blocksize);
return 0;
}
}
@@ -3147,7 +3149,9 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
ret = -EINVAL;
blocksize = sb_min_blocksize(sb, EXT4_MIN_BLOCK_SIZE);
if (!blocksize) {
- ext4_msg(sb, KERN_ERR, "unable to set blocksize");
+ ext4_msg(sb, KERN_ERR,
+ "unable to set filesystem block size "
+ __stringify(EXT4_MIN_BLOCK_SIZE));
goto out_fail;
}
@@ -3367,14 +3371,15 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
if (blocksize < EXT4_MIN_BLOCK_SIZE ||
blocksize > EXT4_MAX_BLOCK_SIZE) {
ext4_msg(sb, KERN_ERR,
- "Unsupported filesystem blocksize %d", blocksize);
+ "Unsupported filesystem block size %d", blocksize);
goto failed_mount;
}
if (sbi->s_mount_opt & EXT4_MOUNT_DAX) {
if (blocksize != PAGE_SIZE) {
ext4_msg(sb, KERN_ERR,
- "error: unsupported blocksize for dax");
+ "error: unsupported filesystem block size %d for dax",
+ blocksize);
goto failed_mount;
}
if (!sb->s_bdev->bd_disk->fops->direct_access) {
@@ -3393,7 +3398,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
if (sb->s_blocksize != blocksize) {
/* Validate the filesystem blocksize */
if (!sb_set_blocksize(sb, blocksize)) {
- ext4_msg(sb, KERN_ERR, "bad block size %d",
+ ext4_msg(sb, KERN_ERR, "bad filesystem block size %d",
blocksize);
goto failed_mount;
}
@@ -3495,8 +3500,8 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
if (has_bigalloc) {
if (clustersize < blocksize) {
ext4_msg(sb, KERN_ERR,
- "cluster size (%d) smaller than "
- "block size (%d)", clustersize, blocksize);
+ "cluster size (%d) smaller than filesystem block size (%d)",
+ clustersize, blocksize);
goto failed_mount;
}
sbi->s_cluster_bits = le32_to_cpu(es->s_log_cluster_size) -
@@ -3519,9 +3524,9 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
}
} else {
if (clustersize != blocksize) {
- ext4_warning(sb, "fragment/cluster size (%d) != "
- "block size (%d)", clustersize,
- blocksize);
+ ext4_warning(sb,
+ "fragment/cluster size (%d) != filesystem block size (%d)",
+ clustersize, blocksize);
clustersize = blocksize;
}
if (sbi->s_blocks_per_group > blocksize * 8) {
@@ -3769,7 +3774,8 @@ no_journal:
if ((DUMMY_ENCRYPTION_ENABLED(sbi) || ext4_has_feature_encrypt(sb)) &&
(blocksize != PAGE_CACHE_SIZE)) {
ext4_msg(sb, KERN_ERR,
- "Unsupported blocksize for fs encryption");
+ "Unsupported filesystem block size %d for fs encryption",
+ blocksize);
goto failed_mount_wq;
}
@@ -4112,7 +4118,8 @@ static journal_t *ext4_get_dev_journal(struct super_block *sb,
hblock = bdev_logical_block_size(bdev);
if (blocksize < hblock) {
ext4_msg(sb, KERN_ERR,
- "blocksize too small for journal device");
+ "filesystem block size %d too small for journal device",
+ blocksize);
goto out_bdev;
}
--
2.4.3
6 years, 5 months
[-mm PATCH] list, perf: fix list_force_poison() build regression
by Dan Williams
In file included from
/home/sfr/next/next/tools/include/linux/list.h:5:0,
from arch/../util/map.h:6,
from arch/../util/event.h:8,
from arch/../util/debug.h:7,
from arch/common.c:4:
include/linux/list.h: In function 'list_force_poison':
include/linux/list.h:123:56: error: unused parameter 'entry' [-Werror=unused-parameter]
static inline void list_force_poison(struct list_head *entry)
perf does not like the empty definition of list_force_poison. For
simplicity just switch to list_del in the non-debug case.
Fixes "mm, dax, pmem: introduce {get|put}_dev_pagemap() for dax-gup" in
-next.
Reported-by: Stephen Rothwell <sfr(a)canb.auug.org.au>
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
---
include/linux/list.h | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/include/linux/list.h b/include/linux/list.h
index d870ba3315f8..ebf5f358e8c3 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -120,9 +120,8 @@ extern void list_del(struct list_head *entry);
*/
extern void list_force_poison(struct list_head *entry);
#else
-static inline void list_force_poison(struct list_head *entry)
-{
-}
+/* fallback to the less strict LIST_POISON* definitions */
+#define list_force_poison list_del
#endif
/**
6 years, 5 months
[PATCH 0/3] fs, bdev: handle end of life
by Dan Williams
As mentioned in [PATCH 1/3] "block, fs: reliably communicate bdev
end-of-life", historically we have waited for filesystem specific
heuristics to attempt to guess when a block device is gone. Sometimes
this works, but in other cases the system can hang waiting for the fs to
trigger its shutdown protocol.
Now with DAX we need new actions, like unmapping all inodes, to be taken
upon a shutdown event. Those actions need to be taken whether the
shutdown event comes from the block device being torn down, or some
other file system specific event.
For now, the approach taken in the following patches only affects xfs
and block drivers that are converted to use del_gendisk_queue(). We can
add more filesystems and driver support over time.
Note that 'bdi_gone' was chosen over 'shutdown' so as not to be confused
with generic_shutdown_super()
---
Dan Williams (3):
block, fs: reliably communicate bdev end-of-life
xfs: handle shutdown notifications
writeback: fix false positive WARN in __mark_inode_dirty
block/genhd.c | 87 +++++++++++++++++++++++++++++++++++-------
drivers/block/brd.c | 3 -
drivers/nvdimm/pmem.c | 3 -
drivers/s390/block/dcssblk.c | 6 +--
fs/block_dev.c | 79 +++++++++++++++++++++++++++++++++-----
fs/xfs/xfs_super.c | 9 ++++
include/linux/fs.h | 4 ++
include/linux/genhd.h | 1
mm/backing-dev.c | 7 +++
9 files changed, 166 insertions(+), 33 deletions(-)
6 years, 5 months
[PATCHV4 0/3] Machine check recovery when kernel accesses poison
by Tony Luck
Ingo: I think I have fixed up everything to make all the people who
commented happy. Do you have any further suggestions, or is this ready
to go into the tip tree?
This series is initially targeted at the folks doing filesystems
on top of NVDIMMs. They really want to be able to return -EIO
when there is a h/w error (just like spinning rust, and SSD does).
I plan to use the same infrastructure in parts 1&2 to write a
machine check aware "copy_from_user()" that will SIGBUS the
calling application when a syscall touches poison in user space
(just like we do when the application touches the poison itself).
Changes V3-V4:
Andy: Simplify fixup_mcexception() by dropping used-once local variable
Andy: "Reviewed-by" tag added to part1
Boris: Moved new functions to memcpy_64.S and declaration to asm/string_64.h
Boris: Changed name s/mcsafe_memcpy/__mcsafe_copy/ to make it clear that this
is an internal function and that return value doesn't follow memcpy() semantics.
Boris: "Reviewed-by" tag added to parts 1&2
Changes V2-V3:
Andy: Don't hack "regs->ax = BIT(63) | addr;" in the machine check
handler. Now have better fixup code that computes the number
of remaining bytes (just like page-fault fixup).
Andy: #define for BIT(63). Done, plus couple of extra macros using it.
Boris: Don't clutter up generic code (like mm/extable.c) with this.
I moved everything under arch/x86 (the asm-generic change is
a more generic #define).
Boris: Dependencies for CONFIG_MCE_KERNEL_RECOVERY are too generic.
I made it a real menu item with default "n". Dan Williams
will use "select MCE_KERNEL_RECOVERY" from his persistent
filesystem code.
Boris: Simplify conditionals in mce.c by moving tolerant/kill_it
checks earlier, with a skip to end if they aren't set.
Boris: Miscellaneous grammar/punctuation. Fixed.
Boris: Don't leak spurious __start_mcextable symbols into kernels
that didn't configure MCE_KERNEL_RECOVERY. Done.
Tony: New code doesn't belong in user_copy_64.S/uaccess*.h. Moved
to new .S/.h files
Elliott:Cacheing behavior non-optimal. Could use movntdqa, vmovntdqa
or vmovntdqa on source addresses. I didn't fix this yet. Think
of the current mcsafe_memcpy() as the first of several functions.
This one is useful for small copies (meta-data) where the overhead
of saving SSE/AVX state isn't justified.
Changes V1->V2:
0-day: Reported build errors and warnings on 32-bit systems. Fixed
0-day: Reported bloat to tinyconfig. Fixed
Boris: Suggestions to use extra macros to reduce code duplication in _ASM_*EXTABLE. Done
Boris: Re-write "tolerant==3" check to reduce indentation level. See below.
Andy: Check IP is valid before searching kernel exception tables. Done.
Andy: Explain use of BIT(63) on return value from mcsafe_memcpy(). Done (added decode macros).
Andy: Untangle mess of code in tail of do_machine_check() to make it
clear what is going on (e.g. that we only enter the ist_begin_non_atomic()
if we were called from user code, not from kernel!). Done.
Tony Luck (3):
x86, ras: Add new infrastructure for machine check fixup tables
x86, ras: Extend machine check recovery code to annotated ring0 areas
x86, ras: Add __mcsafe_copy() function to recover from machine checks
arch/x86/Kconfig | 10 +++
arch/x86/include/asm/asm.h | 10 ++-
arch/x86/include/asm/mce.h | 14 ++++
arch/x86/include/asm/string_64.h | 8 ++
arch/x86/kernel/cpu/mcheck/mce-severity.c | 21 ++++-
arch/x86/kernel/cpu/mcheck/mce.c | 86 +++++++++++--------
arch/x86/kernel/vmlinux.lds.S | 6 +-
arch/x86/kernel/x8664_ksyms_64.c | 4 +
arch/x86/lib/memcpy_64.S | 133 ++++++++++++++++++++++++++++++
arch/x86/mm/extable.c | 16 ++++
include/asm-generic/vmlinux.lds.h | 12 +--
11 files changed, 276 insertions(+), 44 deletions(-)
--
2.1.4
6 years, 5 months
[-mm PATCH] dax: fix dax_pmd_dbg build warning
by Dan Williams
Fixes below warning from commit 3cb108f941deb
"dax-add-support-for-fsync-sync-v6" in -next.
fs/dax.c: In function ‘__dax_pmd_fault’:
fs/dax.c:916:15: warning: passing argument 1 of ‘__dax_dbg’ from incompatible pointer type
dax_pmd_dbg(bdev, address,
^
fs/dax.c:738:13: note: expected ‘struct buffer_head *’ but argument is of type ‘struct block_device *’
static void __dax_dbg(struct buffer_head *bh, unsigned long address,
Cc: Ross Zwisler <ross.zwisler(a)linux.intel.com>
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
---
fs/dax.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/dax.c b/fs/dax.c
index 4ff61b412383..41cf4ee0b859 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -913,7 +913,7 @@ int __dax_pmd_fault(struct vm_area_struct *vma, unsigned long address,
error = dax_radix_entry(mapping, pgoff, dax.sector,
true, true);
if (error) {
- dax_pmd_dbg(bdev, address,
+ dax_pmd_dbg(&bh, address,
"PMD radix insertion failed");
goto fallback;
}
6 years, 6 months