Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6265499imu; Mon, 21 Jan 2019 06:05:29 -0800 (PST) X-Google-Smtp-Source: ALg8bN7WTq/WXqaWbCGVsXYLt7nvbPHbgOBR2uxw3Ud7q0sd/M9H/8N9TSh/cdupk3NghRWCY5Rs X-Received: by 2002:a62:9683:: with SMTP id s3mr29651130pfk.60.1548079529328; Mon, 21 Jan 2019 06:05:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548079529; cv=none; d=google.com; s=arc-20160816; b=ACcrE68fm5gOBUfQFOiuAy3Rw2CxQjf442vtJkv6iOmaCLCQ1WGePgCnGihGrCK3+Z YvNQGy0h97IIPc0Snat7Lzcb4bV7UVpzUOLEVKo8aZY5nbL/d8jDZ2y3kRKg0wZrfkMA CO+E7Apn2Cpls9AyAzYnK9/c/+rwUA3PVak7WnIPk8kNsZJZSm8DXoeaApah8Hom2g22 QTFZMLVDWbQMshxfasLOfko8t8Zd8xPrN7kJ2lhyRojPurfdvOSZqopUJwpT5XuEW4Vb cJbQCjZo6UZrOHScSYEF+SPtSDwdKPLulC2Z0osNZ/NlmyuSCnMWzpzpsrT/eprktpk1 XZRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NTHi0gszS1W4TY4Jb+fngmzkjstmi/uhcGd1lyKvsKA=; b=xT7Fz18HBV/i4Q2Cl/QMtWdNuM/ibf72AJggzS0ZJjFpOJ3Bg3xGjyoepSkaZlGW6G sNuVgiABGqsYhR7IFEoCA9zHg1oLxlWcqfNrXOgrzraq7oEd1vPR8jBJD6HJZr4dpblh hPxJbCApothQYlWCLh8Yjo2siIuY9Ual30qvCqVQE22mtEUkPF5dKZgbytOOqnPUCL8Z JClpoZCcJE4HL2s4IDBpcsMizhmSvTq9Hwsv6fUSYcD6KdJXc43Dd3vu6jIaOEfhaBfq YamfSNw0wSuGJys6KlJ++LqDG4Kbt36ZtVcCjFnTkpci5Yp4dnDoxHB/XzfcD/tzSIjB EUXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sbu0Q90s; 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 i2si13039512pgl.153.2019.01.21.06.05.05; Mon, 21 Jan 2019 06:05:29 -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; dkim=pass header.i=@kernel.org header.s=default header.b=sbu0Q90s; 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 S1732384AbfAUOCv (ORCPT + 99 others); Mon, 21 Jan 2019 09:02:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:50588 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732861AbfAUOCs (ORCPT ); Mon, 21 Jan 2019 09:02:48 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 106D52089F; Mon, 21 Jan 2019 14:02:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548079367; bh=kM9QCzN3tq46dsK1D1Ab99NgMHpCwKAq6ZqHjPOhHNw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sbu0Q90sYRLIS8Y8xSsN1IeReyguSlMsmclwUwtHQjQ3E6qFIUGYIJ3Nf3r7sRCCe 4XIbshKnAGdemYF5TIMm8NiggPb/t1qPazf6DrkuRPjtIty/O0iYoGhKVL4+FQJQBE V+MP3Ne6098tY6lMirMJoFDBtrUmcBYE44r4ctR8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tetsuo Handa , Jan Kara , Jens Axboe Subject: [PATCH 4.19 80/99] block/loop: Dont grab "struct file" for vfs_getattr() operation. Date: Mon, 21 Jan 2019 14:49:12 +0100 Message-Id: <20190121134917.134272239@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190121134913.924726465@linuxfoundation.org> References: <20190121134913.924726465@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tetsuo Handa commit b1ab5fa309e6c49e4e06270ec67dd7b3e9971d04 upstream. vfs_getattr() needs "struct path" rather than "struct file". Let's use path_get()/path_put() rather than get_file()/fput(). Signed-off-by: Tetsuo Handa Reviewed-by: Jan Kara Signed-off-by: Jan Kara Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- drivers/block/loop.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -1205,7 +1205,7 @@ loop_set_status(struct loop_device *lo, static int loop_get_status(struct loop_device *lo, struct loop_info64 *info) { - struct file *file; + struct path path; struct kstat stat; int ret; @@ -1230,16 +1230,16 @@ loop_get_status(struct loop_device *lo, } /* Drop lo_ctl_mutex while we call into the filesystem. */ - file = get_file(lo->lo_backing_file); + path = lo->lo_backing_file->f_path; + path_get(&path); mutex_unlock(&lo->lo_ctl_mutex); - ret = vfs_getattr(&file->f_path, &stat, STATX_INO, - AT_STATX_SYNC_AS_STAT); + ret = vfs_getattr(&path, &stat, STATX_INO, AT_STATX_SYNC_AS_STAT); if (!ret) { info->lo_device = huge_encode_dev(stat.dev); info->lo_inode = stat.ino; info->lo_rdevice = huge_encode_dev(stat.rdev); } - fput(file); + path_put(&path); return ret; }