f2fs: compress: fix to disallow temp extension
authorChao Yu <yuchao0@huawei.com>
Tue, 18 May 2021 09:54:58 +0000 (17:54 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Jul 2021 14:05:50 +0000 (16:05 +0200)
commitd3c150978ead8edf85dbd671bb8f864dd89612b3
treede6ec4f27678d6454bf01bbe7074b972f9594e2f
parent43cefd126450060ff17daf69d02f50994ef70cfe
f2fs: compress: fix to disallow temp extension

[ Upstream commit 4a67d9b07ac8dce7f1034e0d887f2f4ee00fe118 ]

This patch restricts to configure compress extension as format of:

 [filename + '.' + extension]

rather than:

 [filename + '.' + extension + (optional: '.' + temp extension)]

in order to avoid to enable compression incorrectly:

1. compress_extension=so
2. touch file.soa
3. touch file.so.tmp

Fixes: 4c8ff7095bef ("f2fs: support data compression")
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/namei.c