Skip to content
Commit 052b1987 authored by Shaohua Li's avatar Shaohua Li Committed by Linus Torvalds
Browse files

swap: don't do discard if no discard option added



When swapon() was not passed the SWAP_FLAG_DISCARD option, sys_swapon()
will still perform a discard operation.  This can cause problems if
discard is slow or buggy.

Reverse the order of the check so that a discard operation is performed
only if the sys_swapon() caller is attempting to enable discard.

Signed-off-by: default avatarShaohua Li <shli@fusionio.com>
Reported-by: default avatarHolger Kiehl <Holger.Kiehl@dwd.de>
Tested-by: default avatarHolger Kiehl <Holger.Kiehl@dwd.de>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1480de03
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment