mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* + elv_iosched_store-fix-strstrip-misuse.patch added to -mm tree
@ 2009-10-08 23:04 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2009-10-08 23:04 UTC (permalink / raw)
  To: mm-commits; +Cc: kosaki.motohiro, jens.axboe, lizf


The patch titled
     elv_iosched_store(): fix strstrip() misuse
has been added to the -mm tree.  Its filename is
     elv_iosched_store-fix-strstrip-misuse.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: elv_iosched_store(): fix strstrip() misuse
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>

elv_iosched_store() ignore the return value of strstrip().  It makes small
inconsistent behavior.

This patch fixes it.

 <before>
 ====================================
 # cd /sys/block/{blockdev}/queue

 case1:
 # echo "anticipatory" > scheduler
 # cat scheduler
 noop [anticipatory] deadline cfq

 case2:
 # echo "anticipatory " > scheduler
 # cat scheduler
 noop [anticipatory] deadline cfq

 case3:
 # echo " anticipatory" > scheduler
 bash: echo: write error: Invalid argument

 <after>
 ====================================
 # cd /sys/block/{blockdev}/queue

 case1:
 # echo "anticipatory" > scheduler
 # cat scheduler
 noop [anticipatory] deadline cfq

 case2:
 # echo "anticipatory " > scheduler
 # cat scheduler
 noop [anticipatory] deadline cfq

 case3:
 # echo " anticipatory" > scheduler
 noop [anticipatory] deadline cfq

Cc: Li Zefan <lizf@cn.fujitsu.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---


diff -puN block/elevator.c~elv_iosched_store-fix-strstrip-misuse block/elevator.c
--- a/block/elevator.c~elv_iosched_store-fix-strstrip-misuse
+++ a/block/elevator.c
@@ -1053,9 +1053,7 @@ ssize_t elv_iosched_store(struct request
 		return count;
 
 	strlcpy(elevator_name, name, sizeof(elevator_name));
-	strstrip(elevator_name);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-10-08 23:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-08 23:04 + elv_iosched_store-fix-strstrip-misuse.patch added to -mm tree akpm

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).