Message ID | 20181122195749.14086-7-sashal@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 21D2D1709 for <patchwork-linux-mm@patchwork.kernel.org>; Thu, 22 Nov 2018 19:58:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10EB42B150 for <patchwork-linux-mm@patchwork.kernel.org>; Thu, 22 Nov 2018 19:58:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 052932B365; Thu, 22 Nov 2018 19:58:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 91A752B150 for <patchwork-linux-mm@patchwork.kernel.org>; Thu, 22 Nov 2018 19:58:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C393C6B2D02; Thu, 22 Nov 2018 14:58:19 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id BEA866B2D03; Thu, 22 Nov 2018 14:58:19 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AD8EA6B2D04; Thu, 22 Nov 2018 14:58:19 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by kanga.kvack.org (Postfix) with ESMTP id 6DD4A6B2D02 for <linux-mm@kvack.org>; Thu, 22 Nov 2018 14:58:19 -0500 (EST) Received: by mail-pl1-f199.google.com with SMTP id 4so14575431plc.5 for <linux-mm@kvack.org>; Thu, 22 Nov 2018 11:58:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references; bh=0ClGGLZ9VbO6p2c/NCr3NmErb9zDB7QT1FaYXqz5yZk=; b=BiuUyYzw5bZJiYzs3O9rH3JqRs0QnPi8yD6FlBMt/jLFIXzpCkrPOQRC49CaXfwXIu MzpcDKdGzXu30sfgaqZkeSVf7pgWIJBr3dFRS4UwNzYWN+ktoHsGDuP0VLl4B3iZqsY1 OviRXlBUiwqf+8f9+Dmv8y+2nc095XDsU3alVK5ORQcgytuPPvX+wyY+xiTMVv1EqYCN GeTNNhUaw/E+2U92s/Vn9Ts0sZu4y0OwQdr9hh7udUiB6FjP1heEejRJALfUfPcmrA0n qgBuKO4hws9DI5JVTyr0ao10KmURku1mwvHOrI9z5oBJRMr553RTI1PNFl3849kYgDua EDvQ== X-Gm-Message-State: AA+aEWY2dfHnpr0n23wb8G07eyyh5JQZgsgu2j55pmWmRrEljCb+Bdyv wiV68vYycizAFrNtn0Vans6UVOcgXXoPRXZGXo+nAmp4HrIA3Ah7htyl+DswXZvSYxlQouzkLnc UMId2u69Joe3aT+TdwpC7y3DRdw/4ZE/hoDsZFk8r86/PZ8WXlTD0XuMmHnTu2wdQDg== X-Received: by 2002:a63:e101:: with SMTP id z1mr11241465pgh.310.1542916699123; Thu, 22 Nov 2018 11:58:19 -0800 (PST) X-Google-Smtp-Source: AFSGD/XkXXvx/BMtoM4rx4Sbe8GKIoIv1pa9YTFOCgwHZVEdwDXbmgyjpDfClBsvJ5XU6z44Cc20 X-Received: by 2002:a63:e101:: with SMTP id z1mr11241437pgh.310.1542916698510; Thu, 22 Nov 2018 11:58:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542916698; cv=none; d=google.com; s=arc-20160816; b=R3qGgn+hkq2oSb47GbIvGenV0AT2MZfqsxRPwdqjJ1erB+AImQxza/ghTdjrzdKAwL nCCMLE7C0CReDjzeLeWe5l3DJVIF5W5mxzDvQH5i2SlHAO60MMEoloHPYJhFxVl50EZ6 so5k7FOAal/nndWB+B3mwKuwZIJtubEwKzyKp5LNFOm9hT6GtZs9FnIexWTXqlBSwnVn HaOqajvEPCCkr5bGZvBp9hBXqPaochMeDFiHoFnvoUsA+Y/hyqkXH0DbE90s4mkxBqYa b7NfFNCRy4tEle9NLo3WGt0teCQw9b3l7s4ZmDnpRWh/RIR7AYoQoVHKZVGb/TTRVAcs v1+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0ClGGLZ9VbO6p2c/NCr3NmErb9zDB7QT1FaYXqz5yZk=; b=hDgBKchOnG3Kp61r6Q6elssERz2lxUUKcuBuvmzGymxrlPePQIbHdKzzP2Phbdgf6C HSDmOttSU9/b9+T6PTzDvH3Ctxi5z4D7tOopzUg2xfAbJdWy9u+ejZ/SZkcCm8c1+DDT yl6tGYCUDW/kFzhmCDyg+qM0Ilkvc2rWsN83crOuIX3Jzc7hdq3Xz7tVBcxRSQTroYFq VnkTPtOkY3Gxdc7UaOrsFdQxQ+9sXwGZ7ykGWGykodOBjVhr8YD2gMf053scmm0gcddv njEo4aQVuxGCC0P9cxC0rN4B8JJVLlFRt/c5ZyowT3MVT6hWEsjvICDKzy4EkH3M89nv Gv6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=F0WxCSeg; spf=pass (google.com: domain of sashal@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=sashal@kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from mail.kernel.org (mail.kernel.org. [198.145.29.99]) by mx.google.com with ESMTPS id n67si17352056pfk.34.2018.11.22.11.58.18 for <linux-mm@kvack.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Nov 2018 11:58:18 -0800 (PST) Received-SPF: pass (google.com: domain of sashal@kernel.org designates 198.145.29.99 as permitted sender) client-ip=198.145.29.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=F0WxCSeg; spf=pass (google.com: domain of sashal@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=sashal@kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sasha-vm.mshome.net (unknown [37.142.5.207]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 64434208A3; Thu, 22 Nov 2018 19:58:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542916698; bh=LBzIsxv/TdLbjLR1viyix92nnccRuCBOZ/Kh1O2mteU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F0WxCSeg8wIXNOaS/XXixB9T20/5e+eBdJ7dC4y95Q0EIPf1ZJxAQ9jdTM0wG2vO6 wV7DW90hVdmLUza9CTtAdS5ldTm5KcCqnga1rjKDsqjo83mIkgIThxSN5+ihFA0P3l HGhSPbuo8jKghVo0l2ZynSWJZ4Dupyo5EixWBWas= From: Sasha Levin <sashal@kernel.org> To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Yufen Yu <yuyufen@huawei.com>, Al Viro <viro@zeniv.linux.org.uk>, Hugh Dickins <hughd@google.com>, William Kucharski <william.kucharski@oracle.com>, Andrew Morton <akpm@linux-foundation.org>, Linus Torvalds <torvalds@linux-foundation.org>, Sasha Levin <sashal@kernel.org>, linux-mm@kvack.org Subject: [PATCH AUTOSEL 3.18 7/7] tmpfs: make lseek(SEEK_DATA/SEK_HOLE) return ENXIO with a negative offset Date: Thu, 22 Nov 2018 14:57:49 -0500 Message-Id: <20181122195749.14086-7-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181122195749.14086-1-sashal@kernel.org> References: <20181122195749.14086-1-sashal@kernel.org> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
None
|
expand
|
diff --git a/mm/shmem.c b/mm/shmem.c index 371d5eca80ed..64c33e3dbe69 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1805,9 +1805,7 @@ static loff_t shmem_file_llseek(struct file *file, loff_t offset, int whence) mutex_lock(&inode->i_mutex); /* We're holding i_mutex so we can access i_size directly */ - if (offset < 0) - offset = -EINVAL; - else if (offset >= inode->i_size) + if (offset < 0 || offset >= inode->i_size) offset = -ENXIO; else { start = offset >> PAGE_CACHE_SHIFT;