Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6280258imu; Mon, 21 Jan 2019 06:18:18 -0800 (PST) X-Google-Smtp-Source: ALg8bN6w/XO1zYBgXxTb75ML67lOLbVNXx+CskDz0AzMoIMahZqW85b7+LRXEIv5cyJkOl+jpJcR X-Received: by 2002:a63:1a4b:: with SMTP id a11mr28510293pgm.254.1548080298059; Mon, 21 Jan 2019 06:18:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548080298; cv=none; d=google.com; s=arc-20160816; b=hr4ayFh7np6Vba7GDgjSFsPbOje5EcZrUq5pvgHiMVYJOd8SXfmaFopBluhcTN6mdU 1bjueJdTn0mfMP01o2bYmi7k6c0/yyaC2Z+yYZeFmbWNLBa6zsASVyIr7eYGpdDy02CF Nn0eIEwbX2K6PldYa5UpKGlKb09w2E87C5jLOb3aWoqx0CPSP5ZthG5AHxAWj+5glaby aaB+HQPyft5dl/wA54bvk3vgOf1J8ZxLy0TXaF96RuxewTKQ/b3haNsMMo5UyY21DJm/ EyjygDZnU5IxDuYKLQc681cxxwAsI5dute2I5YqmtNR+A8WH0E42zo67sqeZbCtzaTe5 UCMg== 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=7v7A02vQKLROEf+TZp4qDebCmbOATQpLEfGMx2SeanM=; b=U56A0AaR+DRTqVR3yzZPl515oP5tqlhjAbxxQTyvQK2f1/fswTNLBOw8Ft+uAwcuNK TW2kEC4J2wnUKWVUhvmbhA/edsOA32mmOvztWj4pzuH/TLBkpyfeO8kLcAjEoTwOEMuM JKBarqojWOJ11bnHqkyWkwUm5wtpp5h+6BLB6o+Bniw7rzK4+zpoHILSBi5EJjL9RqDo ywdNITiaHr8v4MC9tGweOGN3ZV9hx4JihHutgcQ+sezMlZZQLDxsS8Su4o37vEUq9las JcNiOpL7+nZ70knTnnhTmaFFdQiysJ0tfYeCr9wrD0xQLGSsO5NNoe80ZG2c1dWKj6UL od8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Rq1m1c1v; 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 f4si12446604plf.370.2019.01.21.06.18.02; Mon, 21 Jan 2019 06:18:18 -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=Rq1m1c1v; 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 S1730757AbfAUNvW (ORCPT + 99 others); Mon, 21 Jan 2019 08:51:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:34230 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729025AbfAUNvT (ORCPT ); Mon, 21 Jan 2019 08:51:19 -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 C7D422063F; Mon, 21 Jan 2019 13:51:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548078678; bh=aDmuTRdBaO+UXQJIudY8G39dCQLIA9VXDIF1IkCBaUQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rq1m1c1vApUswWZ30WHnQxCxzzIpqEcKCvgCxOk29PNJFLf9CpFQZlf4taWy6nLD4 xxaQkKPsWoVSnG5Fq6nBBZeVsTJ9Pu73HOzFKPIN+YzxQ8KG0Ra3+6siqNVmBXhtLo xYK540u7fKV32Tcafy0omScXe0DN26L8mTLvKKVU= 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.20 093/111] block/loop: Dont grab "struct file" for vfs_getattr() operation. Date: Mon, 21 Jan 2019 14:43:27 +0100 Message-Id: <20190121122506.276273828@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190121122455.819406896@linuxfoundation.org> References: <20190121122455.819406896@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.20-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 @@ -1204,7 +1204,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; @@ -1229,16 +1229,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; }