From patchwork Mon Sep 15 16:43:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 4906971 Return-Path: X-Original-To: patchwork-cifs-client@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 CD9C4BEEA5 for ; Mon, 15 Sep 2014 16:44:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F32D820272 for ; Mon, 15 Sep 2014 16:43:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CABD32026F for ; Mon, 15 Sep 2014 16:43:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753743AbaIOQnt (ORCPT ); Mon, 15 Sep 2014 12:43:49 -0400 Received: from mail-qc0-f180.google.com ([209.85.216.180]:48956 "EHLO mail-qc0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753204AbaIOQnt (ORCPT ); Mon, 15 Sep 2014 12:43:49 -0400 Received: by mail-qc0-f180.google.com with SMTP id m20so3072834qcx.25 for ; Mon, 15 Sep 2014 09:43:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:cc:content-type; bh=FwW8qtJqUrgRQYVW5mX2NODmy5temtygUPV7BF3HHeY=; b=szYOUndEUNrENkCEp0tKv9WLtI8XRLaSGUf5zFiX5BFWg8rvbJAcbHklZ64uGVfGyE 4F5//qWFWcFJsI9G2SCs/RNkVZpklMX1YLsdqlp4ar9mrmJePFcx1hHjj6J4P1xPeJBI iXYniExfIV71PLF0cIwXWcGdH5DBxzihL9YI61OG3HCIgo91qIJhLl6tH9kTxvTTU5L5 M/FQSxES+PmOjK7fsKMEI2dZsvMdN9n2snJrx6jRTHz9gceD4i5FgSc6lwitzLLz2hD5 CGaPGd9Dmbs5XNm/ax6qVL+eWKTvzRuNdOW3PZRYP+4nNfW64atVXdvwfgFu5ujt7x0E GcXw== X-Received: by 10.140.104.68 with SMTP id z62mr27635356qge.81.1410799423146; Mon, 15 Sep 2014 09:43:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.32.116 with HTTP; Mon, 15 Sep 2014 09:43:23 -0700 (PDT) From: Steve French Date: Mon, 15 Sep 2014 11:43:23 -0500 Message-ID: Subject: [PATCH] [SMB3] Fix oops when creating symlinks on smb3 To: "linux-cifs@vger.kernel.org" Cc: Sachin Prabhu , Jeff Layton Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 When the protocol ops for create mf symlink was added we were not checking for symlink support properly for SMB2/SMB3 mounts so could oops when mounted with mfsymlinks when try to create symlink when on smb2/smb3 mounts rather than cifs mount I will add a followon patch for mfsymlinks for SMB3 but in the meantime need to avoid this possible oops. Signed-off-by: Steve French Cc: # 3.14+ CC: Sachin Prabhu --- fs/cifs/link.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/cifs/link.c b/fs/cifs/link.c index 68559fd..a5c2812 100644 --- a/fs/cifs/link.c +++ b/fs/cifs/link.c @@ -213,8 +213,12 @@ create_mf_symlink(const unsigned int xid, struct cifs_tcon *tcon, if (rc) goto out; - rc = tcon->ses->server->ops->create_mf_symlink(xid, tcon, cifs_sb, - fromName, buf, &bytes_written); + if (tcon->ses->server->ops->create_mf_symlink) + rc = tcon->ses->server->ops->create_mf_symlink(xid, tcon, + cifs_sb, fromName, buf, &bytes_written); + else + rc = -EOPNOTSUPP; + if (rc) goto out;