From patchwork Fri Dec 15 17:42:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 849327 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="aqqtfn6o"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="gE8s4i4L"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="cWMn0yPl"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yyylQ00bbz9s03 for ; Sat, 16 Dec 2017 04:55:45 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=UgfDmukDXhFeZIieaezT0Wtp/1F64OaETdTK+A0k0L0=; b=aqqtfn6oFKhT+QaZ6sHEXwH4r2 CGgyyG/BZceNKClcbsGSSGVjHlsBo2WWggsHJlzag2pGqw1yRMGbYd+uyiIX0AaryeNA8o80NCrBe Gcrl1uDzRQsY+brkNtoO1M4wCrGP/vaUYEw4TlwocWDUbLFU0XzAgRgyPkLz8+sKzXGoxRHADKYeA doS8euhO2nxl0gSMsjN3rX0VZC6OSMn/7KYXVuOBETHFgzVyEGFcaVxw1aVnttL6GRg1lCg/ieL20 N4x0ir3oYvyq9CJUL7vbMngJUjTot6EIK7Tw+E2XEl4AlbWSyp8lxm0L8T5X3pZS2HbxnJ+VGydw4 IPFIy7OQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ePuCS-0007i3-4x; Fri, 15 Dec 2017 17:55:08 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ePu5H-0000Av-E2 for linux-mtd@bombadil.infradead.org; Fri, 15 Dec 2017 17:47:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=SO17RDeFg/DO4IA1nWfCsbC8oc/lzZcFEL2XI6jgMwI=; b=gE8s4i4LWjZlLN6kyQ3GrE6ZQ +sh0pXtado/TlZmR76kqPCAMm8kWWMYm25hKss8lpUIZyvTUAlMNsxHlGmamaYJE9qygheayYjUVo OXP/RqSXXfoqX5vopavi5cdNBEcxdXuY9vEyIJYFESx8+ZP5JvBRFA/wSDI+bpSlWRCrKTWLH5ncW EW5CtetvO8Mc3CQT4hIGcezsZabRL5A5TMAvyutqqVeRu1nmpzDZfNG3gOHA8NFohkcsZ6EC0ibnR WMzg1PFNFctcOuGuOUZ8gmQPQB/kG8hzB8eWTYEsBBgkxUFyl3bH3nvTXGlv1L0qqThX/0JtolHxn p2/Pat4bg==; Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]) by merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ePu4v-0007mY-9w for linux-mtd@lists.infradead.org; Fri, 15 Dec 2017 17:47:22 +0000 Received: by mail-pg0-x242.google.com with SMTP id g7so6264596pgs.0 for ; Fri, 15 Dec 2017 09:47:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SO17RDeFg/DO4IA1nWfCsbC8oc/lzZcFEL2XI6jgMwI=; b=cWMn0yPl4KMTaJwN9k1Ia0qN9ZOXYm+L28fVMvnB3GPn81n0PiHyOy7EA8UysauSPi /IKaokesjYlwMn2phOTw0KPyvAIDBpdnWol/ij6Xf/KXxnw8JQWks3aEVSKNxgOkX2m1 P9v8ttb13nkTcXEXADzpa9R098MYQv2kYxi1+7OAf3txUTSYg8zvFWUkZCVi77e4fljL zabM/0h66yKSaQqM8/XMeUavC2UPjTjGMclVSGWjDPKG1BsXYL7+Yyd0w1Up8Z/QsT+t KAlpsYxbORStN9T5OlJxmAuBii6c9bJh3RQTxXSEtmnLnzXclPbTuPCqKhj6TcwI534N OJCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=SO17RDeFg/DO4IA1nWfCsbC8oc/lzZcFEL2XI6jgMwI=; b=EEZjKHcQASQP5nthaBAaLtdFYUUiLAiLM0/FWKBV4hKBvLVerl3s5ceaqBPCJuH+5n hZjBHZI/U4hT3aArrBC+L/4bYN4mta00lFjjM8pk14eTVfkIF2psD1ejvC+oZgSzkV3L F9MKHsxcsGVQXLrVjCsBxAAN56V6LCb1ID8mHXtInJxsG4zZnBJw9XdizjA1OgS/+Uyn 0LfZdNgTZRLGqCkar+4UwkHYNjHdm+DQ9DAXToR0si71WU1gniFvpzo3y7uYvs6bLd92 REt+uUIx4OO4cAQ2arUXfR9KHS0cfCz9/DGE1HoDSQIzv2fxVDISKM4qqlXU7vYPUDO9 3gMw== X-Gm-Message-State: AKGB3mIVQ8t1HZjiunqb6DEzXB3i9hn0KHKgKipLLCszRbActVblESAt TeImGc85AnHHoiOhZEGQvqo= X-Google-Smtp-Source: ACJfBos2PYhPt1J42O2kQGexeyVfNBhSiICYfEyvDFhqBmDoXDq4mNZtoupnpaqSOJ+TB8kx+km9mw== X-Received: by 10.84.245.138 with SMTP id j10mr14152219pll.281.1513360019202; Fri, 15 Dec 2017 09:46:59 -0800 (PST) Received: from zzz.localdomain (c-67-185-97-198.hsd1.wa.comcast.net. [67.185.97.198]) by smtp.gmail.com with ESMTPSA id j62sm12980149pfc.18.2017.12.15.09.46.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Dec 2017 09:46:58 -0800 (PST) From: Eric Biggers To: linux-fscrypt@vger.kernel.org Subject: [PATCH 19/24] fscrypt: remove fscrypt_fname_usr_to_disk() Date: Fri, 15 Dec 2017 09:42:20 -0800 Message-Id: <20171215174225.31583-20-ebiggers3@gmail.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171215174225.31583-1-ebiggers3@gmail.com> References: <20171215174225.31583-1-ebiggers3@gmail.com> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.4.1 on merlin.infradead.org summary: Content analysis details: (-1.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:400e:c05:0:0:0:242 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (ebiggers3[at]gmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (ebiggers3[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Theodore Y . Ts'o" , Eric Biggers , linux-f2fs-devel@lists.sourceforge.net, linux-mtd@lists.infradead.org, Jaegeuk Kim , linux-ext4@vger.kernel.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Eric Biggers fscrypt_fname_usr_to_disk() sounded very generic but was actually only used to encrypt symlinks. Remove it now that all filesystems have been switched over to fscrypt_encrypt_symlink(). Signed-off-by: Eric Biggers --- fs/crypto/fname.c | 29 ----------------------------- include/linux/fscrypt_notsupp.h | 7 ------- include/linux/fscrypt_supp.h | 2 -- 3 files changed, 38 deletions(-) diff --git a/fs/crypto/fname.c b/fs/crypto/fname.c index 62f13d533439..cae7d1bcc8c5 100644 --- a/fs/crypto/fname.c +++ b/fs/crypto/fname.c @@ -311,35 +311,6 @@ int fscrypt_fname_disk_to_usr(struct inode *inode, } EXPORT_SYMBOL(fscrypt_fname_disk_to_usr); -/** - * fscrypt_fname_usr_to_disk() - converts a filename from user space to disk - * space - * - * The caller must have allocated sufficient memory for the @oname string. - * - * Return: 0 on success, -errno on failure - */ -int fscrypt_fname_usr_to_disk(struct inode *inode, - const struct qstr *iname, - struct fscrypt_str *oname) -{ - if (fscrypt_is_dot_dotdot(iname)) { - oname->name[0] = '.'; - oname->name[iname->len - 1] = '.'; - oname->len = iname->len; - return 0; - } - if (inode->i_crypt_info) - return fname_encrypt(inode, iname, oname); - /* - * Without a proper key, a user is not allowed to modify the filenames - * in a directory. Consequently, a user space name cannot be mapped to - * a disk-space name - */ - return -ENOKEY; -} -EXPORT_SYMBOL(fscrypt_fname_usr_to_disk); - /** * fscrypt_setup_filename() - prepare to search a possibly encrypted directory * @dir: the directory that will be searched diff --git a/include/linux/fscrypt_notsupp.h b/include/linux/fscrypt_notsupp.h index dd106640c6ea..0962f504aa91 100644 --- a/include/linux/fscrypt_notsupp.h +++ b/include/linux/fscrypt_notsupp.h @@ -159,13 +159,6 @@ static inline int fscrypt_fname_disk_to_usr(struct inode *inode, return -EOPNOTSUPP; } -static inline int fscrypt_fname_usr_to_disk(struct inode *inode, - const struct qstr *iname, - struct fscrypt_str *oname) -{ - return -EOPNOTSUPP; -} - static inline bool fscrypt_match_name(const struct fscrypt_name *fname, const u8 *de_name, u32 de_name_len) { diff --git a/include/linux/fscrypt_supp.h b/include/linux/fscrypt_supp.h index dc2babf3f7d3..e00191deb0d6 100644 --- a/include/linux/fscrypt_supp.h +++ b/include/linux/fscrypt_supp.h @@ -113,8 +113,6 @@ extern int fscrypt_fname_alloc_buffer(const struct inode *, u32, extern void fscrypt_fname_free_buffer(struct fscrypt_str *); extern int fscrypt_fname_disk_to_usr(struct inode *, u32, u32, const struct fscrypt_str *, struct fscrypt_str *); -extern int fscrypt_fname_usr_to_disk(struct inode *, const struct qstr *, - struct fscrypt_str *); #define FSCRYPT_FNAME_MAX_UNDIGESTED_SIZE 32