From patchwork Wed Nov 12 16:38:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kepplinger-Novakovic X-Patchwork-Id: 5290931 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AA13EC11AC for ; Wed, 12 Nov 2014 16:40:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E7C44201C7 for ; Wed, 12 Nov 2014 16:40:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2995F201BB for ; Wed, 12 Nov 2014 16:40:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752938AbaKLQkg (ORCPT ); Wed, 12 Nov 2014 11:40:36 -0500 Received: from mx02.posteo.de ([89.146.194.165]:49589 "EHLO mx02.posteo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752856AbaKLQkf (ORCPT ); Wed, 12 Nov 2014 11:40:35 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by mx02.posteo.de (Postfix) with ESMTP id D428025ACC21; Wed, 12 Nov 2014 17:40:31 +0100 (CET) X-Virus-Scanned: amavisd-new at posteo.de Received: from posteo.de ([10.125.125.178]) (using TLS) by localhost (amavis1.posteo.de [10.125.125.165]) (amavisd-new, port 10026) with ESMTPS id g4PCCZvgr6Wy; Wed, 12 Nov 2014 17:40:20 +0100 (CET) Received: from mail.posteo.de (localhost [127.0.0.1]) by mail.posteo.de (Postfix) with ESMTPSA id 680382C010C; Wed, 12 Nov 2014 17:40:20 +0100 (CET) From: Martin Kepplinger To: clm@fb.com Cc: linux-btrfs@vger.kernel.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, Martin Kepplinger Subject: [PATCH] btrfs: Don't check for file->private_data on open(). It is set by the core. Date: Wed, 12 Nov 2014 17:38:28 +0100 Message-Id: <1415810308-24243-1-git-send-email-martink@posteo.de> X-Mailer: git-send-email 1.7.10.4 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The miscdevice core now sets file->private_data to the struct miscdevice so don't fail when this is not NULL. Signed-off-by: Martin Kepplinger --- This is a question: what does this check provide and does overwriting file->private_data make any difference? Is miscdevice's open() by the user not allowed here, if file->private_data is set? thanks!! fs/btrfs/ioctl.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 4399f0c..066ce41 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -3752,10 +3752,6 @@ static long btrfs_ioctl_trans_start(struct file *file) if (!capable(CAP_SYS_ADMIN)) goto out; - ret = -EINPROGRESS; - if (file->private_data) - goto out; - ret = -EROFS; if (btrfs_root_readonly(root)) goto out;