linux_dsm_epyc7002/include
David Rientjes 948927ee9e mm, mempolicy: make mpol_to_str robust and always succeed
mpol_to_str() should not fail.  Currently, it either fails because the
string buffer is too small or because a string hasn't been defined for a
mempolicy mode.

If a new mempolicy mode is introduced and no string is defined for it,
just warn and return "unknown".

If the buffer is too small, just truncate the string and return, the
same behavior as snprintf().

This also fixes a bug where there was no NULL-byte termination when doing
*p++ = '=' and *p++ ':' and maxlen has been reached.

Signed-off-by: David Rientjes <rientjes@google.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Chen Gang <gang.chen@asianux.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Dave Jones <davej@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-11-13 12:09:05 +09:00
..
acpi ACPI, CPER: Update cper info 2013-10-21 15:12:00 -07:00
asm-generic GPIO bulk changes for the v3.13 development cycle 2013-11-12 15:50:46 +09:00
clocksource drivers: clocksource: add support for ARM architected timer event stream 2013-09-26 09:48:00 +01:00
crypto
drm Revert "drm: mark context support as a legacy subsystem" 2013-09-20 08:32:59 +10:00
dt-bindings The clock changes for 3.13 are an even mix of framework improvements & 2013-11-12 16:11:47 +09:00
keys
kvm
linux mm, mempolicy: make mpol_to_str robust and always succeed 2013-11-13 12:09:05 +09:00
math-emu
media
memory
misc
net ipv6: reset dst.expires value when clearing expire flag 2013-10-25 19:26:59 -04:00
pcmcia
ras
rdma
rxrpc
scsi Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2013-09-12 16:11:45 -07:00
sound Merge remote-tracking branch 'asoc/topic/twl4030' into asoc-next 2013-11-08 10:43:40 +00:00
target target/iscsi: Bump versions to v4.1.0 2013-09-10 20:23:37 -07:00
trace sound updates for 3.13-rc1 2013-11-12 15:29:53 +09:00
uapi sound updates for 3.13-rc1 2013-11-12 15:29:53 +09:00
video video: exynos_dp: remove non-DT support for Exynos Display Port 2013-10-16 13:48:09 -07:00
xen
Kbuild