From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:57200 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752593AbdKFJZm (ORCPT ); Mon, 6 Nov 2017 04:25:42 -0500 Subject: Patch "staging: lustre: llite: don't invoke direct_IO for the EOF case" has been added to the 4.4-stable tree To: yang.sheng@intel.com, alexander.levin@verizon.com, bob.glossman@intel.com, bobijam@hotmail.com, gregkh@linuxfoundation.org, jsimmons@infradead.org, oleg.drokin@intel.com Cc: , From: Date: Mon, 06 Nov 2017 10:25:14 +0100 Message-ID: <15099603146015@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled staging: lustre: llite: don't invoke direct_IO for the EOF case to the 4.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: staging-lustre-llite-don-t-invoke-direct_io-for-the-eof-case.patch and it can be found in the queue-4.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From foo@baz Mon Nov 6 10:22:56 CET 2017 From: Yang Sheng Date: Sat, 7 Oct 2017 22:37:48 +0000 Subject: staging: lustre: llite: don't invoke direct_IO for the EOF case From: Yang Sheng [ Upstream commit 77759771fb95420d23876cb104ab65c022613325 ] The function generic_file_read_iter() does not check EOF before invoke direct_IO callback. So we have to check it ourselves. Signed-off-by: Yang Sheng Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8969 Reviewed-on: https://review.whamcloud.com/24552 Reviewed-by: Bob Glossman Reviewed-by: Bobi Jam Reviewed-by: Oleg Drokin Signed-off-by: James Simmons Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/staging/lustre/lustre/llite/rw26.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/staging/lustre/lustre/llite/rw26.c +++ b/drivers/staging/lustre/lustre/llite/rw26.c @@ -376,6 +376,10 @@ static ssize_t ll_direct_IO_26(struct ki if (!lli->lli_has_smd) return -EBADF; + /* Check EOF by ourselves */ + if (iov_iter_rw(iter) == READ && file_offset >= i_size_read(inode)) + return 0; + /* FIXME: io smaller than PAGE_SIZE is broken on ia64 ??? */ if ((file_offset & ~CFS_PAGE_MASK) || (count & ~CFS_PAGE_MASK)) return -EINVAL; Patches currently in stable-queue which might be from yang.sheng@intel.com are queue-4.4/staging-lustre-llite-don-t-invoke-direct_io-for-the-eof-case.patch