From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl0-f53.google.com ([209.85.160.53]:35543 "EHLO mail-pl0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752412AbeEJV4h (ORCPT ); Thu, 10 May 2018 17:56:37 -0400 MIME-Version: 1.0 In-Reply-To: References: <20180510184817.GG23039@jra3> From: Steve French Date: Thu, 10 May 2018 16:56:16 -0500 Message-ID: Subject: Re: [PATCH] cifs/smb3: directory sync should not return an error To: Jeremy Allison Cc: Pavel Shilovsky , linux-fsdevel , CIFS , samba-technical Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org List-ID: checking various Linux file systems - looks like most of those I checked end up with the default "EINVAL" so basically not a very useful call to check the return code on - safer to ignore. If others prefer, I don't mind sending the call over the wire and ignoring the return code - but presumably some server is going to error unusually if we pass it over the wire and expect particularly return codes (and thus break apps that check for rc==EINVAL or rc==0). On Thu, May 10, 2018 at 3:28 PM, Steve French wrote: > It wasn't sent to Samba - the error was returned by the VFS before it > comes to cifs.ko because we don't implement this call. NFS > (correctly presumably) implements the syscall by ignoring it > (returning 0 - rather than the default which is an error), because > once an entry in the directory is created it is in the namespace, and > they are never cached on the client. > > On Thu, May 10, 2018 at 1:48 PM, Jeremy Allison wrote: >> On Thu, May 10, 2018 at 10:11:43AM -0700, Pavel Shilovsky via samba-technical wrote: >>> 2018-05-10 9:04 GMT-07:00 Steve French via samba-technical >>> : >>> > 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 >> >> NAK on this patch. It's due to a specific Samba server >> bug, which I've just fixed. >> >> Look at the man page for fsync() on directory handles >> - in SMB2+ as well this is a useful thing for an >> application to do. >> >> The broken Samba server returns NT_STATUS_ACCESS_DENIED >> here. What you need to do is test the popular servers >> (Windows, NetApp, EMC, Samba, OSX) and see which of >> them are broken (not Windows obviously) and if so >> what errors they return. >> >> Best case scenario it's just Samba that was broken, >> so check for the specific NT_STATUS_ACCESS_DENIED >> error and ignore, otherwise return the error to >> the caller - they *NEED* it :-). >> >> Jeremy. > > > > -- > Thanks, > > Steve -- Thanks, Steve