linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: dsterba@suse.cz, David Sterba <dsterba@suse.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: switch to common message helpers in open_ctree, adjust messages
Date: Tue, 10 May 2016 16:01:05 +0800	[thread overview]
Message-ID: <57319541.7000300@oracle.com> (raw)
In-Reply-To: <20160510074203.GP29353@twin.jikos.cz>



On 05/10/2016 03:42 PM, David Sterba wrote:
> On Tue, May 10, 2016 at 10:34:19AM +0800, Anand Jain wrote:
>> On 05/09/2016 05:39 PM, David Sterba wrote:
>>> Currently we lack the identification of the filesystem in most if not
>>> all mount messages, done via printk/pr_* functions. We can use the
>>> btrfs_* helpers in open_ctree, as the fs_info <-> sb link is established
>>> at the beginning of the function.
>>
>>    While here I also recommend to pass fs_devices instead of fs_info
>>    to btrfs_printk(). That's mainly because before the fs is mounted
>>    we don't have fs_info, however fs_devices exists in both the mounted
>>    and unmount context.  If you agree, I could send a patch on top of
>>    your patch.
>
> Yeah, before we mount we don't have fs_info. My idea was to provide
> another set of functions that would take something else than fs_info to
> print the filesystem identifier.
>
> Switching btrfs_err & others to fs_devices everywhere would be too
> invasive.

  right.

> In more detail:
>
> * introduce _btrfs_printk that takes a string pointer as 1st argument
>    (this could be used for messages before fs_info exists)
> * _btrfs_printk(NULL, ...) will be valid
> * then btrfs_printk(fs_info, ...) will become a wrapper
>    _btrfs_printk(btrfs_sb(fs_info)->s_id, ...)
> * _btrfs_err & others do not need to be introduced, we can use the
>    standard KERN_ERR


  Does it mean logs when fs_info is not available won't have fsid ?

  Except for the logs in the context such as modload.. which does not
  involve a disk. Consistency in logging would help. Like fishing-out
  all logs related to a FSID.


Thanks, Anand

>>    Otherwise the rest below looks fine.
>
> Thnaks.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

  reply	other threads:[~2016-05-10  8:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-09  9:39 [PATCH] btrfs: switch to common message helpers in open_ctree, adjust messages David Sterba
2016-05-10  2:34 ` Anand Jain
2016-05-10  7:42   ` David Sterba
2016-05-10  8:01     ` Anand Jain [this message]
2016-05-10  8:21       ` David Sterba
2016-05-10  8:40         ` Anand Jain
2016-05-10 14:28           ` David Sterba
2016-05-10 15:00             ` Anand Jain
2016-05-11 10:56               ` David Sterba
2016-05-11 11:55                 ` Anand Jain
2016-05-17 12:42                   ` David Sterba
2016-05-19  1:09                     ` Anand Jain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57319541.7000300@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=dsterba@suse.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).