From: Alan Cox Subject: [PATCH] hfsplus: Missing O_LARGEFILE check (correct diff this time) Date: Tue, 23 Sep 2008 14:13:44 +0100 Message-ID: <20080923141344.6492d4fe@lxorguk.ukuu.org.uk> References: <20080923134959.1b37c38e@lxorguk.ukuu.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org, akpm@osdl.org To: Alan Cox Return-path: Received: from earthlight.etchedpixels.co.uk ([81.2.110.250]:45142 "EHLO lxorguk.ukuu.org.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751205AbYIWNNs (ORCPT ); Tue, 23 Sep 2008 09:13:48 -0400 In-Reply-To: <20080923134959.1b37c38e@lxorguk.ukuu.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Sorry wrong version. Correct one attached hfsplus: O_LARGEFILE checking is missing From: Alan Cox Closes #8490 --- fs/hfsplus/inode.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index b085d64..963be64 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c @@ -254,6 +254,8 @@ static int hfsplus_file_open(struct inode *inode, struct file *file) { if (HFSPLUS_IS_RSRC(inode)) inode = HFSPLUS_I(inode).rsrc_inode; + if (!(file->f_flags & O_LARGEFILE) && i_size_read(inode) > MAX_NON_LFS) + return -EOVERFLOW; atomic_inc(&HFSPLUS_I(inode).opencnt); return 0; }