From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752524AbeA0JaF (ORCPT ); Sat, 27 Jan 2018 04:30:05 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:46282 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752048AbeA0JaC (ORCPT ); Sat, 27 Jan 2018 04:30:02 -0500 From: Chao Yu To: CC: , , , Chao Yu Subject: [PATCH 1/2] f2fs: restrict inline_xattr_size configuration Date: Sat, 27 Jan 2018 17:29:48 +0800 Message-ID: <20180127092949.26616-1-yuchao0@huawei.com> X-Mailer: git-send-email 2.15.0.55.gc2ece9dc4de6 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.120.216.130] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch limits to enable inline_xattr_size mount option only if both extra_attr and flexible_inline_xattr feature is on in current image. Signed-off-by: Chao Yu --- fs/f2fs/super.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 8173ae688814..a859372457eb 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -699,6 +699,13 @@ static int parse_options(struct super_block *sb, char *options) } if (test_opt(sbi, INLINE_XATTR_SIZE)) { + if (!f2fs_sb_has_extra_attr(sb) || + !f2fs_sb_has_flexible_inline_xattr(sb)) { + f2fs_msg(sb, KERN_ERR, + "extra_attr or flexible_inline_xattr " + "feature is off"); + return -EINVAL; + } if (!test_opt(sbi, INLINE_XATTR)) { f2fs_msg(sb, KERN_ERR, "inline_xattr_size option should be " -- 2.15.0.55.gc2ece9dc4de6