All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, NeilBrown <neilb@suse.de>,
	stable@vger.kernel.org
Subject: Re: [PATCH] sysfs: correctly handle read offset on PREALLOC attrs
Date: Thu, 23 Jun 2016 17:18:45 -0400	[thread overview]
Message-ID: <20160623211845.GL3262@mtj.duckdns.org> (raw)
In-Reply-To: <146662093622.3726.10220135910756738018.stgit@buzz>

On Wed, Jun 22, 2016 at 09:42:16PM +0300, Konstantin Khlebnikov wrote:
> Attributes declared with __ATTR_PREALLOC use sysfs_kf_read() which returns
> zero bytes for non-zero offset. This breaks script checkarray in mdadm tool
> in debian where /bin/sh is 'dash' because its builtin 'read' reads only one
> byte at a time. Script gets 'i' instead of 'idle' when reads current action
> from /sys/block/$dev/md/sync_action and as a result does nothing.
> 
> This patch adds trivial implementation of partial read: generate whole
> string and move required part into buffer head.
> 
> Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
> Fixes: 4ef67a8c95f3 ("sysfs/kernfs: make read requests on pre-alloc files use the buffer.")
> Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=787950
> Cc: Stable <stable@vger.kernel.org> # v3.19+

Acked-by: Tejun Heo <tj@kernel.org>

Thanks.

-- 
tejun

  reply	other threads:[~2016-06-23 21:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-22 18:42 [PATCH] sysfs: correctly handle read offset on PREALLOC attrs Konstantin Khlebnikov
2016-06-23 21:18 ` Tejun Heo [this message]
2016-09-05 13:25 ` Konstantin Khlebnikov
2016-09-05 13:46   ` Greg Kroah-Hartman
2016-09-05 14:02     ` Konstantin Khlebnikov
2016-09-05 14:15       ` Greg Kroah-Hartman
2016-09-05 14:13     ` Greg Kroah-Hartman
2016-09-05 14:17       ` Konstantin Khlebnikov

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=20160623211845.GL3262@mtj.duckdns.org \
    --to=tj@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=khlebnikov@yandex-team.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=stable@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.