Received: by 10.223.185.116 with SMTP id b49csp5464429wrg; Wed, 7 Mar 2018 12:12:38 -0800 (PST) X-Google-Smtp-Source: AG47ELvV3VVDj90DjhN+ezcpn4ZzcSiyEWQEh7SWfIt8I+hKHZa07VpyMT+eLRI4H0CFRrPmYQGE X-Received: by 10.101.93.82 with SMTP id e18mr18897415pgt.371.1520453558156; Wed, 07 Mar 2018 12:12:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520453558; cv=none; d=google.com; s=arc-20160816; b=gzPp8lR83+CYFPxAQ/zQDoKp0E1YwWkYHHwT9k0IKxqE97kvkSAav+ttpqwYVNaNUZ dIJP22BjvUTxGjBc0h/1VELP24R0uMb9RHURjKiMXwwn0BiPocF32HdxMi8olQi7rxzO YmKX8bPNRNAnUlFRWZd7noopyRDO6WgD3zjzOqDaE6wQNEf0kJtl4AE/73ntdE/UIFAY vMZ0XUIA773PTWuEgM3sVNU9hdjbnIH6+wXLIIsbihNooFnqfcCnjB0VxvQuil9nMExw GGBa76keBdbfr6MSNm3hqZKu14g7BV3OL+A4dn3ECkAVRbiwda0/DXdwS2WtVI2SS8pS ZbGA== 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=ZnjTY1egsd/wBOwtJ5DTjXi7fQqr8/1P9Txn/JzwGgk=; b=I40AWclZpC6vo2HI70ce7q7omQjNAfbCPvhI9H5hSQn1LMPsaj67vF0DyoePE7qhse cLp1ZQfmdHgr64msra1mOJsnkqG5GY7Mg9lusbzz3cgELXpVCrBB7BX4zlRcaNK+JPdf hdumf+e99xQ2zhIEwsY+o/k/NXgKb+ylTjpwKoSl/qzrUPgFnHoRBYAGkjtndcKERNwI T6/X0fKHCYisM+myIab0qCDD+c/2AvL5zdrJYTLaCDBynG5b6uG3WNh9pJlX9O9kN2Ho CvtnJJmue0ycAO5BlhM3BiGKOgkz3n36gzN3hJWJLXWlLGpAN4cKv4ueMz76ZHgvansi xpMw== 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 w61-v6si13477210plb.733.2018.03.07.12.12.23; Wed, 07 Mar 2018 12:12:38 -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 S965296AbeCGTpT (ORCPT + 99 others); Wed, 7 Mar 2018 14:45:19 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:44118 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965284AbeCGTpP (ORCPT ); Wed, 7 Mar 2018 14:45:15 -0500 Received: from localhost (unknown [185.236.200.248]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id D09AAF30; Wed, 7 Mar 2018 19:45:14 +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.14 029/110] dax: fix vma_is_fsdax() helper Date: Wed, 7 Mar 2018 11:38:12 -0800 Message-Id: <20180307191043.476088385@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180307191039.748351103@linuxfoundation.org> References: <20180307191039.748351103@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.14-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 @@ -3185,7 +3185,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; }