From patchwork Mon Sep 12 19:29:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 9327901 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C51CB6077F for ; Mon, 12 Sep 2016 19:35:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B805228D4C for ; Mon, 12 Sep 2016 19:35:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ACD0A28E59; Mon, 12 Sep 2016 19:35:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5963C28D4C for ; Mon, 12 Sep 2016 19:35:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932105AbcILTfB (ORCPT ); Mon, 12 Sep 2016 15:35:01 -0400 Received: from mail-wm0-f44.google.com ([74.125.82.44]:36043 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758113AbcILT33 (ORCPT ); Mon, 12 Sep 2016 15:29:29 -0400 Received: by mail-wm0-f44.google.com with SMTP id b187so152075979wme.1 for ; Mon, 12 Sep 2016 12:29:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VY3pCcnkOTorn9MqGul2Lg0Vh++fJ6Gb2P5c+6kbvMs=; b=V7GqIqO5COZ77trnvD33PJ52zMV9cRwfW1638BpHcZt2SZdDfd8Zk96wSCd/MW9Fgr i3tei+NSkEGlXUigorunGBlyP6iccEr9jiLKiQgo2JEvDKl5p2pAgzVnkQDqQuPbMtdw 4Lijd8yyFc4y9tTqOPBmWg0ahjOHghGw1Pr9JYFDRe4+i16gtWxJ3F1MlW0NlcZ9OnHQ bfyj1dsoi5atnWkRvFvvuFukabxLDNbUaby8a9haKGUoLSzr7eiQhMQbVcvltMzTlBay 7pL5vtLJEsbqylE0oAVVnu17vIgEaDHK+4k0fROJtiRsfZL5h7rz7a4MnbZyD97OOsuG R2pA== X-Gm-Message-State: AE9vXwMrKX684sJPT/LK5wLgMCfKqBeM8WNpBF2IA9bTU/Am6H7ZphZkIymo/aWvVdilmnGM X-Received: by 10.194.95.105 with SMTP id dj9mr18133232wjb.20.1473708568457; Mon, 12 Sep 2016 12:29:28 -0700 (PDT) Received: from veci.piliscsaba.szeredi.hu (pool-dsl-2c-0018.externet.hu. [217.173.44.24]) by smtp.gmail.com with ESMTPSA id f8sm19250418wjh.45.2016.09.12.12.29.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Sep 2016 12:29:27 -0700 (PDT) From: Miklos Szeredi To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Al Viro Subject: [PATCH 05/17] bad_inode: use generic_readlink Date: Mon, 12 Sep 2016 21:29:07 +0200 Message-Id: <1473708559-12714-6-git-send-email-mszeredi@redhat.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1473708559-12714-1-git-send-email-mszeredi@redhat.com> References: <1473708559-12714-1-git-send-email-mszeredi@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This will allow us to move the generic readlink logic into the VFS and get rid of the readlink method. If inode has i_link set then this patch changes behavior, because generic_readlink will return the cached contents instead of calling i_op->get_link. It would be hard to imagine that this change could break userspace in any sane setup, though. Signed-off-by: Miklos Szeredi --- fs/bad_inode.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/fs/bad_inode.c b/fs/bad_inode.c index b8db8531e837..7cf1f445fe04 100644 --- a/fs/bad_inode.c +++ b/fs/bad_inode.c @@ -78,12 +78,6 @@ static int bad_inode_rename2(struct inode *old_dir, struct dentry *old_dentry, return -EIO; } -static int bad_inode_readlink(struct dentry *dentry, char __user *buffer, - int buflen) -{ - return -EIO; -} - static int bad_inode_permission(struct inode *inode, int mask) { return -EIO; @@ -178,7 +172,7 @@ static const struct inode_operations bad_inode_ops = .rmdir = bad_inode_rmdir, .mknod = bad_inode_mknod, .rename2 = bad_inode_rename2, - .readlink = bad_inode_readlink, + .readlink = generic_readlink, .permission = bad_inode_permission, .getattr = bad_inode_getattr, .setattr = bad_inode_setattr,