Received: by 10.223.185.111 with SMTP id b44csp913097wrg; Fri, 9 Mar 2018 16:42:10 -0800 (PST) X-Google-Smtp-Source: AG47ELu+2r/PV2V9+Skjh62aKkB8stPA+RhbPd1fx9tqZjORH1U3AQhCw7ASbywec3fMSDBNROwQ X-Received: by 10.99.122.12 with SMTP id v12mr331067pgc.128.1520642530809; Fri, 09 Mar 2018 16:42:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520642530; cv=none; d=google.com; s=arc-20160816; b=QFj/PNsdYilXH5YgVrC/5yEaOn7dPPUf4VStFByPoDC99xR/a7AqgDSjF5KMemzl+T MnwY9DOzNDk9XA6l5OQFnvkdo57NT/0FgEUy+h95ynlj0mOCrhUzyrUYUPsE/zMByXdM fZ1IlnreJSKA/ZjPD4eY+wP2LvklplhJHpeSML+iTTFIpIUY8IZMyStsEQdpr+z1xhcV 2S4RcghGKbjDushdkgWfYRPoiDk9B+3AzST5YtjGdy0AKtwqrcFQoSxhTIjz95pb07wK TvG0hrDn1LZMbj1oiXn2aX4GFKQumzrnQFqsqdK7IgaNu2HhO7sFC4yVGyO6M1wx2z/K wafQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=UKrpAmQDHrI2xvGunUux5oND50EN2l3VPdjle7b335c=; b=RZDEMvuQI/zyOH/W5k1f7QJP42j0uz1K54RI3O4XKSfj8TFbeSbw87rtgWpLHWXqLV cG5IbHqcrBA8qbdosK210uvd2enDGlFNc0omqFmDy7DUI+JkXxTJ2tTPi+eYXlckUHpN e6M2Spurmcfy0hgPiw5JyK/0XKQYDwkkdGNTwzJK+sQNQ5BITh7uMyOl7tSZlLar4aEE bCkEtuKvPsRp3teZWpCK5k7CVd0VWtYw2FhE7sjfa2AyX7mztmUKUEMl20ahfQ26B5gs 7oo83w0QzWICNLAzhyXkFu6t5kcEJrIUYVa78ELKkbc+jmwN9iF8MCugCnu1sqLgcDJa Et/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e5si1800068pfl.5.2018.03.09.16.41.56; Fri, 09 Mar 2018 16:42:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933613AbeCJAVK (ORCPT + 99 others); Fri, 9 Mar 2018 19:21:10 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:39404 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933564AbeCJAVH (ORCPT ); Fri, 9 Mar 2018 19:21:07 -0500 Received: from localhost (unknown [185.236.200.248]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 7533510DE; Sat, 10 Mar 2018 00:21:06 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Gerd Rausch , Jane Chu , Haozhong Zhang , Jan Kara , Dan Williams Subject: [PATCH 4.9 14/65] dax: fix vma_is_fsdax() helper Date: Fri, 9 Mar 2018 16:18:14 -0800 Message-Id: <20180310001826.124371683@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180310001824.927996722@linuxfoundation.org> References: <20180310001824.927996722@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dan Williams commit 230f5a8969d8345fc9bbe3683f068246cf1be4b8 upstream. Gerd reports that ->i_mode may contain other bits besides S_IFCHR. Use S_ISCHR() instead. Otherwise, get_user_pages_longterm() may fail on device-dax instances when those are meant to be explicitly allowed. Fixes: 2bb6d2837083 ("mm: introduce get_user_pages_longterm") Cc: Reported-by: Gerd Rausch Acked-by: Jane Chu Reported-by: Haozhong Zhang Reviewed-by: Jan Kara Signed-off-by: Dan Williams Signed-off-by: Greg Kroah-Hartman --- include/linux/fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -3048,7 +3048,7 @@ static inline bool vma_is_fsdax(struct v if (!vma_is_dax(vma)) return false; inode = file_inode(vma->vm_file); - if (inode->i_mode == S_IFCHR) + if (S_ISCHR(inode->i_mode)) return false; /* device-dax */ return true; }