Message ID | 20200725162450.95999-1-colyli@suse.de (mailing list archive) |
---|---|
State | Mainlined |
Commit | 231609785cbfb341e7d6d24a74d6ab8cc518835f |
Headers | show |
Series | [v3] dax: print error message by pr_info() in __generic_fsdax_supported() | expand |
Hi, On 7/25/2020 9:24 AM, Coly Li wrote: > It is not simple to make dax_supported() from struct dax_operations > or __generic_fsdax_supported() to return exact failure type right now. > So the simplest fix is to use pr_info() to print all the error messages > inside __generic_fsdax_supported(). Then users may find informative clue > from the kernel message at least. I happen to notice that some servers set their printk levels at 4 by default to minimize console messages: # cat /proc/sys/kernel/printk 4 4 1 7 So I'm wondering if you would consider pr_error() instead of pr_info() ? thanks, -jane
On Mon 27-07-20 10:02:11, Jane Chu wrote: > Hi, > > On 7/25/2020 9:24 AM, Coly Li wrote: > > It is not simple to make dax_supported() from struct dax_operations > > or __generic_fsdax_supported() to return exact failure type right now. > > So the simplest fix is to use pr_info() to print all the error messages > > inside __generic_fsdax_supported(). Then users may find informative clue > > from the kernel message at least. > > I happen to notice that some servers set their printk levels at 4 by default > to minimize console messages: > # cat /proc/sys/kernel/printk > 4 4 1 7 > So I'm wondering if you would consider pr_error() instead of pr_info() ? I don't think this is a good reason to raise priority of this message - with this logic applied, all info messages should be raised to error level because someone may find them useful :). And then people raise printk loglevel because the kernel is too noisy... Personally I think that pr_info() is fine because there will be error message about unsupported dax setup from the filesystem and if sysadmin wishes, (s)he can always lookup info messages in dmesg. Honza
On 7/27/2020 2:44 PM, Jan Kara wrote: > On Mon 27-07-20 10:02:11, Jane Chu wrote: >> Hi, >> >> On 7/25/2020 9:24 AM, Coly Li wrote: >>> It is not simple to make dax_supported() from struct dax_operations >>> or __generic_fsdax_supported() to return exact failure type right now. >>> So the simplest fix is to use pr_info() to print all the error messages >>> inside __generic_fsdax_supported(). Then users may find informative clue >>> from the kernel message at least. >> >> I happen to notice that some servers set their printk levels at 4 by default >> to minimize console messages: >> # cat /proc/sys/kernel/printk >> 4 4 1 7 >> So I'm wondering if you would consider pr_error() instead of pr_info() ? > > I don't think this is a good reason to raise priority of this message - > with this logic applied, all info messages should be raised to error level > because someone may find them useful :). And then people raise printk > loglevel because the kernel is too noisy... Personally I think that > pr_info() is fine because there will be error message about unsupported dax > setup from the filesystem and if sysadmin wishes, (s)he can always lookup > info messages in dmesg. > Okay, sounds like the nature of the error isn't severe enough, and it isn't rare and random, rather, it's reproducible such that sysadmin can easily catch when raising the printk level. thanks, -jane > Honza >
diff --git a/drivers/dax/super.c b/drivers/dax/super.c index 8e32345be0f7..de0d02ec0347 100644 --- a/drivers/dax/super.c +++ b/drivers/dax/super.c @@ -80,14 +80,14 @@ bool __generic_fsdax_supported(struct dax_device *dax_dev, int err, id; if (blocksize != PAGE_SIZE) { - pr_debug("%s: error: unsupported blocksize for dax\n", + pr_info("%s: error: unsupported blocksize for dax\n", bdevname(bdev, buf)); return false; } err = bdev_dax_pgoff(bdev, start, PAGE_SIZE, &pgoff); if (err) { - pr_debug("%s: error: unaligned partition for dax\n", + pr_info("%s: error: unaligned partition for dax\n", bdevname(bdev, buf)); return false; } @@ -95,7 +95,7 @@ bool __generic_fsdax_supported(struct dax_device *dax_dev, last_page = PFN_DOWN((start + sectors - 1) * 512) * PAGE_SIZE / 512; err = bdev_dax_pgoff(bdev, last_page, PAGE_SIZE, &pgoff_end); if (err) { - pr_debug("%s: error: unaligned partition for dax\n", + pr_info("%s: error: unaligned partition for dax\n", bdevname(bdev, buf)); return false; } @@ -106,7 +106,7 @@ bool __generic_fsdax_supported(struct dax_device *dax_dev, dax_read_unlock(id); if (len < 1 || len2 < 1) { - pr_debug("%s: error: dax access failed (%ld)\n", + pr_info("%s: error: dax access failed (%ld)\n", bdevname(bdev, buf), len < 1 ? len : len2); return false; } @@ -139,7 +139,7 @@ bool __generic_fsdax_supported(struct dax_device *dax_dev, } if (!dax_enabled) { - pr_debug("%s: error: dax support not enabled\n", + pr_info("%s: error: dax support not enabled\n", bdevname(bdev, buf)); return false; }