Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4960001pxj; Wed, 12 May 2021 17:48:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz27FXG1jwc0SREn/XCf0Iq6A2NjGmm8+RInlHbW+jmeBxVW7k2yh3UbFM4bm3JOKg45EuT X-Received: by 2002:a17:906:828b:: with SMTP id h11mr40778912ejx.305.1620866905440; Wed, 12 May 2021 17:48:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620866905; cv=none; d=google.com; s=arc-20160816; b=d9Dr7noWucvYYpHIsm6apR2svwywRMdUOFPoaXnFI55PeNjqvM0sjCcfIuDLkgNYZo Ex7bNM8uIjRYCmZgQLYZAp2E52hLna+zLscKjCHDqzXwV2EZQSRQfW22Nd40JPZ8JYQB V4wWQSBOhKDDZ73/ZxEXPNFCEgkIqs/cK/27m71J6ke+V6cC5bJy0nphoHQFAupg6Xxl +oWecE7rb85p61b3twCHI6O9FCKxs0Az6TvJkWy6Egr9JysYTvX19Id0+ypJc16i+WP1 V05uOkSozmJsaPRgJ/vJ65q1EY53ZXGbOOqx32Pt40gsgiCwGA93974wK5SOHco/9fB4 037w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=a7lqz1YMO4nJsCE7QHemad004Yq6KpTnxtK1z5Oekfs=; b=WPVo8lcNsD9ju8mXdYjWNOVBh1cgwXjWgAcS0W6OLWbvUaXPm5fdy1MAVMoR1hnUsn C6U1tjWw1ueLrnUsKQYl9D8303DrNBNX06p02+vMIMcouZ81gMKVupLO+FTOGhTAFIRF CRVw/3p9FTfGBrgf1Cweq+KRl5KQT59iaXlzP56bf6Dc9P6KlNFuGYA3iLORbtWEpcNT pj24imMeG9Duu0w/7r3EZjUqsFCRAcap0V5gMCUUPbYAVq1p7g1FgwVL05rpe02bG+W6 w68BOThSrB2kXNURbjiX/+KHPCbDCvOf0tIT5o9QhcjTHxFSBIvLkk4C+betssA5d8eJ Owng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XWnkDbHO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cz28si1212843edb.168.2021.05.12.17.48.02; Wed, 12 May 2021 17:48:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XWnkDbHO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233604AbhEMAr4 (ORCPT + 99 others); Wed, 12 May 2021 20:47:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:59296 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245698AbhEMAqi (ORCPT ); Wed, 12 May 2021 20:46:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 06A4F613CA; Thu, 13 May 2021 00:45:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620866729; bh=bInJzrzMTKEfUz71kqIhWS61jCi+MWogtSHtDwqlFXc=; h=From:To:Cc:Subject:Date:From; b=XWnkDbHOGwNKujT3ouCBL+/UL2qYQXQwpCsGEfZuLF6Y9UHT6eYU67L87ad12otRu hfLx/HoZrPYiSrhbnEJeolCYrIW7IK6CJmdXuOR1D92tcK+tYk+xMPgQt+TSGsaGBV 9nQG65XCgM0f6qLljD+JA6/9ePcid0jJ7Dt7sAim4b0C1wlk3l5wbpgudFugCzO17u LhMSmi+rMO3+E5U0ByiUFBrmkdFo8aprFmysz8w/yI6M5RB8SD97UWWTvat7ov1I2u vtjhbk15f0Lsu/a6hwl+VMOcTdXGD7OIvkg0eiP5GXfvvIMZxK2l+/xMhRKVcmZOQS Wat533KHjDEKg== From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim Subject: [PATCH] f2fs: return EINVAL for hole cases in swap file Date: Wed, 12 May 2021 17:45:27 -0700 Message-Id: <20210513004527.3721604-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.31.1.607.g51e8a6a459-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This tries to fix xfstests/generic/495. Signed-off-by: Jaegeuk Kim --- fs/f2fs/data.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 41e260680b27..009a09fb9d88 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -3896,7 +3896,7 @@ static int check_swap_activate_fast(struct swap_info_struct *sis, /* hole */ if (!(map.m_flags & F2FS_MAP_FLAGS)) { f2fs_err(sbi, "Swapfile has holes\n"); - ret = -ENOENT; + ret = -EINVAL; goto out; } @@ -4052,7 +4052,7 @@ static int check_swap_activate(struct swap_info_struct *sis, return ret; bad_bmap: f2fs_err(sbi, "Swapfile has holes\n"); - return -ENOENT; + return -EINVAL; } static int f2fs_swap_activate(struct swap_info_struct *sis, struct file *file, -- 2.31.1.607.g51e8a6a459-goog