From patchwork Thu May 10 16:04:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 911419 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=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-cifs-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ClFGUmI/"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40hdMs0YnKz9s0y for ; Fri, 11 May 2018 02:04:41 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966305AbeEJQEj (ORCPT ); Thu, 10 May 2018 12:04:39 -0400 Received: from mail-pl0-f42.google.com ([209.85.160.42]:46511 "EHLO mail-pl0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965049AbeEJQEi (ORCPT ); Thu, 10 May 2018 12:04:38 -0400 Received: by mail-pl0-f42.google.com with SMTP id 59-v6so1557673plc.13; Thu, 10 May 2018 09:04:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=mES/eN2wp+XE+IzEhVl1y9nJVU+/B4PnTTdKZx0Q4As=; b=ClFGUmI/NjyNHWyxR0G/yUjcnxRz8jGsV9feKHUIbLuaeJQLvzsuqJhH16Vdzy4vHz uHdyWc24mEBrEXIGycKqeDiHlxKSm43pY4CZO6+4n7X362OVCrQ2yRT3pLUPiNBs8KUn RWRUQb1I0Eoz8mGBjYLQGKfAs3GrCVRnWCRWRabSiRYFtpdJuN5PMktQAWiiReqsYKEe WlaTbFKWB7+N/GLE2sg2PFEEAGCmMxHMgHtFkV6sJC9IlbFkKt3HkKlV21D5EFgjfrDR xUZ5VLTnLX54lzmR4ztYxe3Q2x7nKZhMTe74wpzd/85zF5NM/y8JRYzR2XjFiF8Y9EeZ g/VA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=mES/eN2wp+XE+IzEhVl1y9nJVU+/B4PnTTdKZx0Q4As=; b=H0I1B8OcxFtqjMCzYIAxjjIlz/w9bDGTlotiY5Qr+emfdYTjYVCbxZ5FksA4vXBzhM kMwn1Z3dX/1MxyTgP44ZIS5EL33iceEjztn6JUVe9YhtfwJl05XHQTa4f1R0M57DSrRp qc5Y7rZsLQDq7t6SXENAIG1nlH2AJ5ls8Cx/uZgK2oKSdni2VeGw59J/9m2jCRyS9ox2 aInQda8yzEsej/6tDUdahwJrlYcnNLvzEeqUAiHr1Rf/z9jwdym9V8+GqcWubjEvqR7c Z6+SemdVcP8PTc/KfAw+qgVO6I2OuOQfHK3Pd9NwP71fJ2Ru7X1UyLcimNujjU7f+BiC dscQ== X-Gm-Message-State: ALKqPwdlk8mNwXmfM8rEhvnXi6tKDWqQK7NdnbYtRxr1XFOpJ1kqyDr4 zCFZLP0zuQL+GcVKsEUGme3KlvJEd/FDsRLm84Qronxw X-Google-Smtp-Source: AB8JxZoaaX17uJERxlyyyfdnf+KrF6sPxd8RIoejYzQ7sKJmmujt5SaMJvwA8hDPpysdvms1UrN9452/wZEaX3+tA8E= X-Received: by 2002:a17:902:8541:: with SMTP id d1-v6mr2017499plo.106.1525968277862; Thu, 10 May 2018 09:04:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.189.143 with HTTP; Thu, 10 May 2018 09:04:14 -0700 (PDT) From: Steve French Date: Thu, 10 May 2018 11:04:14 -0500 Message-ID: Subject: [PATCH] cifs/smb3: directory sync should not return an error To: CIFS Cc: linux-fsdevel , samba-technical Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org As with NFS, which ignores sync on directory handles, fsync on a directory handle is a noop for CIFS/SMB3. Do not return an error on it. It breaks some database apps otherwise. Reviewed-by: Pavel Shilovsky Reviewed-by: Ronnie Sahlberg From 6112a4967573f9a347f7abc02e80423851b73737 Mon Sep 17 00:00:00 2001 From: Steve French Date: Thu, 10 May 2018 10:59:37 -0500 Subject: [PATCH] smb3: directory sync should not return an error As with NFS, which ignores sync on directory handles, fsync on a directory handle is a noop for CIFS/SMB3. Do not return an error on it. It breaks some database apps otherwise. Signed-off-by: Steve French CC: Stable --- fs/cifs/cifsfs.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index ed8e181927d6..8e41186d9923 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -1049,6 +1049,18 @@ ssize_t cifs_file_copychunk_range(unsigned int xid, return rc; } +/* + * Directory operations under CIFS/SMB2/SMB3 are synchronous, so fsync() + * is a dummy operation. + */ +int cifs_dir_fsync(struct file *file, loff_t start, loff_t end, int datasync) +{ + cifs_dbg(FYI, "Sync directory - name: %pD datasync: 0x%x\n", + file, datasync); + + return 0; +} + static ssize_t cifs_copy_file_range(struct file *src_file, loff_t off, struct file *dst_file, loff_t destoff, size_t len, unsigned int flags) @@ -1183,6 +1195,7 @@ const struct file_operations cifs_dir_ops = { .copy_file_range = cifs_copy_file_range, .clone_file_range = cifs_clone_file_range, .llseek = generic_file_llseek, + .fsync = cifs_dir_fsync, }; static void -- 2.17.0