lkml.org 
[lkml]   [2020]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [patch v2] mm, thp: fix defrag setting if newline is not used
From
Date
On 1/17/20 11:11 PM, David Rientjes wrote:
> If thp defrag setting "defer" is used and a newline is *not* used when
> writing to the sysfs file, this is interpreted as the "defer+madvise"
> option.
>
> This is because we do prefix matching and if five characters are written
> without a newline, the current code ends up comparing to the first five
> bytes of the "defer+madvise" option and using that instead.
>
> Use the more appropriate sysfs_streq() that handles the trailing newline
> for us. Since this doubles as a nice cleanup, do it in enabled_store()
> as well.
>
> Fixes: 21440d7eb904 ("mm, thp: add new defer+madvise defrag option")
> Cc: Vlastimil Babka <vbabka@suse.cz>
> Cc: Mel Gorman <mgorman@techsingularity.net>
> Suggested-by: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: David Rientjes <rientjes@google.com>

Acked-by: Vlastimil Babka <vbabka@suse.cz>
Thanks.

\
 
 \ /
  Last update: 2020-01-18 11:59    [W:0.057 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site