Linux-BTRFS Archive on lore.kernel.org
 help / Atom feed
* [PATCH v2] btrfs: add kernel scrub log messages
@ 2019-01-03  8:17 Anand Jain
  2019-01-11  3:43 ` Anand Jain
  2019-01-24 20:21 ` David Sterba
  0 siblings, 2 replies; 4+ messages in thread
From: Anand Jain @ 2019-01-03  8:17 UTC (permalink / raw)
  To: linux-btrfs

scrub kernel messages helps debug and audit, add them to the log.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
v1->v2: fix btrfs_info, using string directly. Add spacing.
 fs/btrfs/scrub.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index 6dcd36d7b849..aadafc3e52c7 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -3903,6 +3903,7 @@ int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start,
 	 */
 	nofs_flag = memalloc_nofs_save();
 	if (!is_dev_replace) {
+		btrfs_info(fs_info, "scrub: devid %llu started", devid);
 		/*
 		 * by holding device list mutex, we can
 		 * kick off writing super in log tree sync.
@@ -3925,6 +3926,10 @@ int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start,
 	if (progress)
 		memcpy(progress, &sctx->stat, sizeof(*progress));
 
+	if (!is_dev_replace)
+		btrfs_info(fs_info, "scrub: devid %llu %s:%d",
+			devid, ret ? "not finished" : "finished", ret);
+
 	mutex_lock(&fs_info->scrub_lock);
 	dev->scrub_ctx = NULL;
 	scrub_workers_put(fs_info);
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] btrfs: add kernel scrub log messages
  2019-01-03  8:17 [PATCH v2] btrfs: add kernel scrub log messages Anand Jain
@ 2019-01-11  3:43 ` Anand Jain
  2019-01-24 20:21 ` David Sterba
  1 sibling, 0 replies; 4+ messages in thread
From: Anand Jain @ 2019-01-11  3:43 UTC (permalink / raw)
  To: linux-btrfs, dsterba



On 01/03/2019 04:17 PM, Anand Jain wrote:
> scrub kernel messages helps debug and audit, add them to the log.
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>

Ping.

Thanks.

> ---
> v1->v2: fix btrfs_info, using string directly. Add spacing.
>   fs/btrfs/scrub.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
> index 6dcd36d7b849..aadafc3e52c7 100644
> --- a/fs/btrfs/scrub.c
> +++ b/fs/btrfs/scrub.c
> @@ -3903,6 +3903,7 @@ int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start,
>   	 */
>   	nofs_flag = memalloc_nofs_save();
>   	if (!is_dev_replace) {
> +		btrfs_info(fs_info, "scrub: devid %llu started", devid);
>   		/*
>   		 * by holding device list mutex, we can
>   		 * kick off writing super in log tree sync.
> @@ -3925,6 +3926,10 @@ int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start,
>   	if (progress)
>   		memcpy(progress, &sctx->stat, sizeof(*progress));
>   
> +	if (!is_dev_replace)
> +		btrfs_info(fs_info, "scrub: devid %llu %s:%d",
> +			devid, ret ? "not finished" : "finished", ret);
> +
>   	mutex_lock(&fs_info->scrub_lock);
>   	dev->scrub_ctx = NULL;
>   	scrub_workers_put(fs_info);
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] btrfs: add kernel scrub log messages
  2019-01-03  8:17 [PATCH v2] btrfs: add kernel scrub log messages Anand Jain
  2019-01-11  3:43 ` Anand Jain
@ 2019-01-24 20:21 ` David Sterba
  2019-01-24 22:30   ` Anand Jain
  1 sibling, 1 reply; 4+ messages in thread
From: David Sterba @ 2019-01-24 20:21 UTC (permalink / raw)
  To: Anand Jain; +Cc: linux-btrfs

On Thu, Jan 03, 2019 at 04:17:40PM +0800, Anand Jain wrote:
> scrub kernel messages helps debug and audit, add them to the log.
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>
> ---
> v1->v2: fix btrfs_info, using string directly. Add spacing.

>  fs/btrfs/scrub.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
> index 6dcd36d7b849..aadafc3e52c7 100644
> --- a/fs/btrfs/scrub.c
> +++ b/fs/btrfs/scrub.c
> @@ -3903,6 +3903,7 @@ int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start,
>  	 */
>  	nofs_flag = memalloc_nofs_save();
>  	if (!is_dev_replace) {
> +		btrfs_info(fs_info, "scrub: devid %llu started", devid);
>  		/*
>  		 * by holding device list mutex, we can
>  		 * kick off writing super in log tree sync.
> @@ -3925,6 +3926,10 @@ int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start,
>  	if (progress)
>  		memcpy(progress, &sctx->stat, sizeof(*progress));
>  
> +	if (!is_dev_replace)
> +		btrfs_info(fs_info, "scrub: devid %llu %s:%d",
> +			devid, ret ? "not finished" : "finished", ret);

I've checked how the balance status messages are formatted and unified
them so it's

+		btrfs_info(fs_info, "scrub: started on devid %llu", devid);

and

+               btrfs_info(fs_info, "scrub: %s on devid %llu with status: %d",
+                       ret ? "not finished" : "finished", devid, ret);

Patch added to misc-next, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] btrfs: add kernel scrub log messages
  2019-01-24 20:21 ` David Sterba
@ 2019-01-24 22:30   ` Anand Jain
  0 siblings, 0 replies; 4+ messages in thread
From: Anand Jain @ 2019-01-24 22:30 UTC (permalink / raw)
  To: dsterba, linux-btrfs



On 01/25/2019 04:21 AM, David Sterba wrote:
> On Thu, Jan 03, 2019 at 04:17:40PM +0800, Anand Jain wrote:
>> scrub kernel messages helps debug and audit, add them to the log.
>>
>> Signed-off-by: Anand Jain <anand.jain@oracle.com>
>> ---
>> v1->v2: fix btrfs_info, using string directly. Add spacing.
> 
>>   fs/btrfs/scrub.c | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
>> index 6dcd36d7b849..aadafc3e52c7 100644
>> --- a/fs/btrfs/scrub.c
>> +++ b/fs/btrfs/scrub.c
>> @@ -3903,6 +3903,7 @@ int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start,
>>   	 */
>>   	nofs_flag = memalloc_nofs_save();
>>   	if (!is_dev_replace) {
>> +		btrfs_info(fs_info, "scrub: devid %llu started", devid);
>>   		/*
>>   		 * by holding device list mutex, we can
>>   		 * kick off writing super in log tree sync.
>> @@ -3925,6 +3926,10 @@ int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start,
>>   	if (progress)
>>   		memcpy(progress, &sctx->stat, sizeof(*progress));
>>   
>> +	if (!is_dev_replace)
>> +		btrfs_info(fs_info, "scrub: devid %llu %s:%d",
>> +			devid, ret ? "not finished" : "finished", ret);
> 
> I've checked how the balance status messages are formatted and unified
> them so it's
> 
> +		btrfs_info(fs_info, "scrub: started on devid %llu", devid);
> 
> and
> 
> +               btrfs_info(fs_info, "scrub: %s on devid %llu with status: %d",
> +                       ret ? "not finished" : "finished", devid, ret);

oh that's even better. Thanks David.

> Patch added to misc-next, thanks.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-03  8:17 [PATCH v2] btrfs: add kernel scrub log messages Anand Jain
2019-01-11  3:43 ` Anand Jain
2019-01-24 20:21 ` David Sterba
2019-01-24 22:30   ` Anand Jain

Linux-BTRFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-btrfs/0 linux-btrfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-btrfs linux-btrfs/ https://lore.kernel.org/linux-btrfs \
		linux-btrfs@vger.kernel.org linux-btrfs@archiver.kernel.org
	public-inbox-index linux-btrfs


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-btrfs


AGPL code for this site: git clone https://public-inbox.org/ public-inbox