Message ID | 20200921162035.647101714@linuxfoundation.org |
---|---|
State | Superseded |
Headers | show
Return-Path: <SRS0=lyed=C6=vger.kernel.org=stable-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D3A4C43465 for <stable@archiver.kernel.org>; Mon, 21 Sep 2020 16:59:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C083C2223E for <stable@archiver.kernel.org>; Mon, 21 Sep 2020 16:59:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600707583; bh=ovSjpe2ce2YVY9yKlvvgRCAOPx0oaHO+4EhjgHFnIVE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=1w95M+yzBQDe1lARDQ4VLHIE+pShQQj2bg29X0nyUR/QVBYVJSlsIW4WY4I0GfOfM 6/yDW3EWE6w9Wq3TMsbKylnGQKDuBMOkU9RkixZk2gSY2VsBPgv64JGafZYgXsMhL0 gU8e/0B11Oo6Pw+uUChfc9ZtllHNJSNOWbthk6cE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728922AbgIUQ7n (ORCPT <rfc822;stable@archiver.kernel.org>); Mon, 21 Sep 2020 12:59:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:44818 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729429AbgIUQlV (ORCPT <rfc822;stable@vger.kernel.org>); Mon, 21 Sep 2020 12:41:21 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 49E70235F9; Mon, 21 Sep 2020 16:41:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706480; bh=ovSjpe2ce2YVY9yKlvvgRCAOPx0oaHO+4EhjgHFnIVE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kxvcoZHQIT3+EV0a8jXAMAMjMshMaXCKwj0PToJTFoi0sEZLxHj2eOATtIYllHnSh fJxGl4ij18Y0eAi9djVHzYsadJWgHK1LV9gosOJM9hwCkUKr5xbneg0Gx83PPBuIWC gEZlqA1SrLZDp6ThM0jlmDjgFtdXrteova0LM6rw= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Gabriel Krisman Bertazi <krisman@collabora.com>, Chao Yu <yuchao0@huawei.com>, Jaegeuk Kim <jaegeuk@kernel.org>, Sasha Levin <sashal@kernel.org> Subject: [PATCH 4.19 22/49] f2fs: Return EOF on unaligned end of file DIO read Date: Mon, 21 Sep 2020 18:28:06 +0200 Message-Id: <20200921162035.647101714@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162034.660953761@linuxfoundation.org> References: <20200921162034.660953761@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
None
|
expand
|
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index c81a1f3f0a101..c63f5e32630ee 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -2490,6 +2490,9 @@ static int check_direct_IO(struct inode *inode, struct iov_iter *iter, unsigned long align = offset | iov_iter_alignment(iter); struct block_device *bdev = inode->i_sb->s_bdev; + if (iov_iter_rw(iter) == READ && offset >= i_size_read(inode)) + return 1; + if (align & blocksize_mask) { if (bdev) blkbits = blksize_bits(bdev_logical_block_size(bdev));