linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jörn Engel" <joern@logfs.org>
To: Borislav Petkov <bp@alien8.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, Jeff Moyer <jmoyer@redhat.com>,
	Steve Hodgson <steve@purestorage.com>
Subject: Re: [PATCH] add blockconsole version 1.1
Date: Wed, 18 Jul 2012 14:53:35 -0400	[thread overview]
Message-ID: <20120718185335.GA1771@logfs.org> (raw)
In-Reply-To: <20120716124614.GA19497@x1.osrc.amd.com>

On Mon, 16 July 2012 14:46:15 +0200, Borislav Petkov wrote:
> On Fri, Jul 13, 2012 at 12:20:09PM -0400, Jörn Engel wrote:
> 
> > +CANDIDATES=`lsscsi |sed 's|.*/dev|/dev|'`
> 
> You probably want to check lsscsi presence on the system, wasn't
> installed by default on my debian testing image, for example. See diff
> at the end of this mail.

Ack.

> > +	echo "Usage: mkblockconsole <dev>"
> 
> 	echo "Usage: $0 <dev>"
> 
> in case the name of the script changes.

Ack.

> > +#define BLOCKCONSOLE_MAGIC_OLD	"\nLinux blockconsole version 1.0\n"
> 
> blockconsole is not yet upstream, you probably want to get rid of the
> _OLD handling completely?

Agreed.

> > +	struct kref kref;
> 
> Another build failure missing
> 
> #include <linux/kref.h>

Ack.

> With the include added, it builds fine. Then I took an usb stick and I
> did:
> 
> $ ./mkblockconsole /dev/sdc
> 
> <reboot>

You can also run hdparm -z <dev> instead.  Or replug the device.  Main
danger of hdparm is that running the command twice will cause two
instances of blockconsole to use the same device.  Not sure how to
solve that problem - or if.

> So why is that first megabyte full of zeros there?

It gives you some scratch space to store information in.  How useful
that actually is may be a matter of opinion.  But independent of that,
you will find large amounts of zeroes all over.  Every time you
reboot, the new blockconsole will start writing at a megabyte-aligned
offset and whatever remains of the last megabyte should be zero-filled
as well.  Vim treats this as a single line, which makes it only mildly
annoying to me.

> Other than that, it works like a charm and I like the idea that no
> kernel cmdline args are needed.
> 
> Also, you might want to add a step-by-step fast howto to the docs with
> concrete steps like the above so that people can try this out faster.

I will try to find a quiet moment for that.  If you happened to beat
me to it, you certainly won't hear any complaints.

> --
> diff --git a/Documentation/block/blockconsole/bcon_tail b/Documentation/block/blockconsole/bcon_tail
> index 950bfd1..e415b6f 100755
> --- a/Documentation/block/blockconsole/bcon_tail
> +++ b/Documentation/block/blockconsole/bcon_tail
> @@ -4,6 +4,12 @@ TAIL_LEN=16
>  TEMPLATE=/tmp/bcon_template
>  BUF=/tmp/bcon_buf
>  
> +if [ -z "$(which lsscsi)" ];
> +then
> +	echo "You need to install the lsscsi package on your distro."
> +	exit 1
> +fi
> +
>  end_of_log() {
>  	DEV=$1
>  	UUID=`head -c40 $DEV|tail -c8`
> diff --git a/Documentation/block/blockconsole/mkblockconsole b/Documentation/block/blockconsole/mkblockconsole
> index d9514e7..05c4ad8 100755
> --- a/Documentation/block/blockconsole/mkblockconsole
> +++ b/Documentation/block/blockconsole/mkblockconsole
> @@ -1,7 +1,7 @@
>  #!/bin/sh
>  
>  if [ ! $# -eq 1 ]; then
> -	echo "Usage: mkblockconsole <dev>"
> +	echo "Usage: $0 <dev>"
>  	exit 1
>  elif mount|fgrep -q $1; then
>  	echo Device appears to be mounted - aborting
> diff --git a/drivers/block/blockconsole.c b/drivers/block/blockconsole.c
> index d13203f..b4e995d 100644
> --- a/drivers/block/blockconsole.c
> +++ b/drivers/block/blockconsole.c
> @@ -9,6 +9,7 @@
>  #include <linux/slab.h>
>  #include <linux/string.h>
>  #include <linux/workqueue.h>
> +#include <linux/kref.h>
>  
>  #define BLOCKCONSOLE_MAGIC_OLD	"\nLinux blockconsole version 1.0\n"
>  #define BLOCKCONSOLE_MAGIC	"\nLinux blockconsole version 1.1\n"

Acked-by: Joern Engel <joern@logfs.org>

Thanks for the testing and the patch!  I will fold it in and resend
when I deal with the other two details.

Jörn

--
It does not matter how slowly you go, so long as you do not stop.
-- Confucius

  reply	other threads:[~2012-07-18 20:07 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-24 20:59 [RFC][PATCH] add blockconsole Jörn Engel
2012-04-25 13:42 ` Jeff Moyer
2012-04-25 13:25   ` Jörn Engel
2012-04-25 15:52     ` Jeff Moyer
2012-07-12 17:46       ` [PATCH] add blockconsole version 1.1 Jörn Engel
2012-07-13 13:03         ` Borislav Petkov
2012-07-13 16:20           ` Jörn Engel
2012-07-13 21:14             ` Borislav Petkov
2012-07-16 12:46             ` Borislav Petkov
2012-07-18 18:53               ` Jörn Engel [this message]
2012-07-18 21:45                 ` Borislav Petkov
2012-07-18 21:08                   ` Jörn Engel
2012-07-19  9:26                     ` Borislav Petkov
2012-07-23 20:04                   ` Jörn Engel
2012-07-24 15:42                     ` Borislav Petkov
2012-07-24 14:53                       ` Jörn Engel
2012-07-24 16:25                         ` Borislav Petkov
2012-07-24 17:52                           ` Jörn Engel
2012-07-24 20:28                             ` Borislav Petkov
2012-12-19 10:20                               ` Borislav Petkov
2012-08-14 11:54                 ` Jan Engelhardt
2012-07-23 14:33         ` Tvrtko Ursulin
2012-07-23 20:02           ` Jörn Engel
2012-07-24  8:01             ` Tvrtko Ursulin
2012-07-24 14:38               ` Jörn Engel
2012-07-25  8:17                 ` Tvrtko Ursulin
2012-07-25 16:39                   ` Jörn Engel

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=20120718185335.GA1771@logfs.org \
    --to=joern@logfs.org \
    --cc=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=jmoyer@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=steve@purestorage.com \
    /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).