From patchwork Thu Jun 2 02:39:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 12867448 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2933C43334 for ; Thu, 2 Jun 2022 02:39:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233290AbiFBCjY (ORCPT ); Wed, 1 Jun 2022 22:39:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232838AbiFBCjX (ORCPT ); Wed, 1 Jun 2022 22:39:23 -0400 Received: from mail-vs1-xe36.google.com (mail-vs1-xe36.google.com [IPv6:2607:f8b0:4864:20::e36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE26B5F94 for ; Wed, 1 Jun 2022 19:39:22 -0700 (PDT) Received: by mail-vs1-xe36.google.com with SMTP id f13so3420837vsp.1 for ; Wed, 01 Jun 2022 19:39:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to:cc; bh=Js3IruM4BXSFN0IJZZDQA8cDZgJKRjJtKo73/Xc1HJc=; b=GhucqSSJJ1V+g6OtPFpDWMhKdX/V3waFjsAd9uH2r8bf4AZ388ai0+42OgDIWFxr56 bRW2V4Z57++TphOsWrRQPeltbSgr+lunV/4EJMPsJq2LF08hXoWecvvYfPCMogPu81NF S1jJ0RWeoTKqHG0fXTUJ/useBMNbhKcngc46i4MrTGApyvfWyeoYgeZwxM+rQwpUIyHY UXHNe1ZYQQItjZ2I+iUH6ORfIgPwl4ok4SWdOfXip9QUvnPl3e8+FJn/nUSk/Pjfm9qp N757Xw4kTht912+jzOgWAcU76vBbf7S1XcdxXu7EcHsb/Hdk61YQ2Dp8Skkud2dB1p3R CSeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=Js3IruM4BXSFN0IJZZDQA8cDZgJKRjJtKo73/Xc1HJc=; b=g4D+wK22GKqtpQi5R+IUlaNX2DKAfaJ8PVjmhCo/cBzjtY4Xsy2ilZANmw9ZIvjzj0 OjQkVF71+Z6p7awey3GIIEfGyY3uncKxpxhwOx4uqOuYwMskc9jgVnZBKk5q1KfYtyDz +89BelxQEwHB/U4bh1oPDE6m257tvnVEfy0L7STuoiYGxd5coDpoypXWUkQ6Vyo2qxkV u12NqBnHeKYmQZ4v+XQ6dSYdqdivEwqYhQ20ikLZOuAztJxzu6H9/ClIi67CNux1Fps7 L+FwDUBFj0feFX7vUm+qWaYcE7yvM1TUKYEt44Nh08sExfUvkY4jqByZq8T2BHDY3pPi oJYA== X-Gm-Message-State: AOAM531diKzEZMS0UKtjy2H1sgdzGWpMhEJVQEhyWCStFTgAALc7vvMk GRA209CHt9+7bBrmzRoVM1RDjf+NX0goDZw+hOv8+Xtj1yI= X-Google-Smtp-Source: ABdhPJwxMazGjzBhXnzi8qQSEJ4yxSyjgKkZ8xHA1Fi9YlXSowrFH7r4Q4PT6rNRPPrtDbURnB4WYuqHvIFaOLpD+Zw= X-Received: by 2002:a67:b607:0:b0:337:b5b7:adc9 with SMTP id d7-20020a67b607000000b00337b5b7adc9mr1283599vsm.17.1654137561435; Wed, 01 Jun 2022 19:39:21 -0700 (PDT) MIME-Version: 1.0 From: Steve French Date: Wed, 1 Jun 2022 21:39:10 -0500 Message-ID: Subject: [PATCH][CIFS] Do not build smb1ops.c if legacy support is disabled To: CIFS Cc: samba-technical Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org We should not be including unused SMB1/CIFS functions when legacy support is disabled (CONFIG_CIFS_ALLOW_INSECURE_LEGACY turned off), but especially obvious is not needing to build smb1ops.c at all when legacy support is disabled. Over time we can move more SMB1/CIFS and SMB2.0 legacy functions into ifdefs but this is a good start (and shrinks the module size a few percent). Reviewed-by: Tom Talpey From 41db7a9e28f09d57c145df814f0fb6f200c8d2a6 Mon Sep 17 00:00:00 2001 From: Steve French Date: Wed, 1 Jun 2022 21:25:43 -0500 Subject: [PATCH] cifs: do not build smb1ops if legacy support is disabled We should not be including unused SMB1/CIFS functions when legacy support is disabled (CONFIG_CIFS_ALLOW_INSECURE_LEGACY turned off), but especially obvious is not needing to build smb1ops.c at all when legacy support is disabled. Over time we can move more SMB1/CIFS and SMB2.0 legacy functions into ifdefs but this is a good start (and shrinks the module size a few percent). Signed-off-by: Steve French --- fs/cifs/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/cifs/Makefile b/fs/cifs/Makefile index cc8fdcb35b71..8c9f2c00be72 100644 --- a/fs/cifs/Makefile +++ b/fs/cifs/Makefile @@ -8,7 +8,7 @@ obj-$(CONFIG_CIFS) += cifs.o cifs-y := trace.o cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o \ inode.o link.o misc.o netmisc.o smbencrypt.o transport.o \ cifs_unicode.o nterr.o cifsencrypt.o \ - readdir.o ioctl.o sess.o export.o smb1ops.o unc.o winucase.o \ + readdir.o ioctl.o sess.o export.o unc.o winucase.o \ smb2ops.o smb2maperror.o smb2transport.o \ smb2misc.o smb2pdu.o smb2inode.o smb2file.o cifsacl.o fs_context.o \ dns_resolve.o cifs_spnego_negtokeninit.asn1.o asn1.o @@ -30,3 +30,5 @@ cifs-$(CONFIG_CIFS_FSCACHE) += fscache.o cifs-$(CONFIG_CIFS_SMB_DIRECT) += smbdirect.o cifs-$(CONFIG_CIFS_ROOT) += cifsroot.o + +cifs-$(CONFIG_CIFS_ALLOW_INSECURE_LEGACY) += smb1ops.o -- 2.34.1