Return-Path: Received: from mail-wm0-f47.google.com ([74.125.82.47]:34310 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754285AbcBEQIl (ORCPT ); Fri, 5 Feb 2016 11:08:41 -0500 Received: by mail-wm0-f47.google.com with SMTP id 128so76954575wmz.1 for ; Fri, 05 Feb 2016 08:08:41 -0800 (PST) Received: from donut.arnhem.chello.nl (178-84-161-31.dynamic.upc.nl. [178.84.161.31]) by smtp.gmail.com with ESMTPSA id b203sm8071254wmh.8.2016.02.05.08.08.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 Feb 2016 08:08:40 -0800 (PST) From: Wouter van Kesteren To: linux-fsdevel@vger.kernel.org Subject: [PATCH] fs: allow no_seek_end_llseek to actually seek Date: Fri, 5 Feb 2016 17:08:34 +0100 Message-Id: <1454688514-230665-1-git-send-email-woutershep@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: '~0ULL' is a 'unsigned long long' that when converted to a loff_t, which is signed, gets turned into -1. later in vfs_setpos we have 'if (offset > maxsize)', which makes it always return EINVAL. --- fs/read_write.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/read_write.c b/fs/read_write.c index 324ec27..0c8782a 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -17,6 +17,7 @@ #include #include #include +#include #include "internal.h" #include @@ -183,7 +184,7 @@ loff_t no_seek_end_llseek(struct file *file, loff_t offset, int whence) switch (whence) { case SEEK_SET: case SEEK_CUR: return generic_file_llseek_size(file, offset, whence, - ~0ULL, 0); + OFFSET_MAX, 0); default: return -EINVAL; } -- 2.7.0