]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
remove directory incorrectly tries to set delete on close on non-empty directories
authorSteve French <smfrench@gmail.com>
Fri, 13 May 2016 02:20:36 +0000 (21:20 -0500)
committerKamal Mostafa <kamal@canonical.com>
Fri, 10 Jun 2016 13:32:25 +0000 (06:32 -0700)
commit46707af0f6ca32d64cf535a9975e4d1cacadb504
tree205816d85fe0d2ba6a933c14e8f7f32bf7d72346
parentafb83c6369ef1179cf7d9b528d086daed98178df
remove directory incorrectly tries to set delete on close on non-empty directories

BugLink: http://bugs.launchpad.net/bugs/1588945
commit 897fba1172d637d344f009d700f7eb8a1fa262f1 upstream.

Wrong return code was being returned on SMB3 rmdir of
non-empty directory.

For SMB3 (unlike for cifs), we attempt to delete a directory by
set of delete on close flag on the open. Windows clients set
this flag via a set info (SET_FILE_DISPOSITION to set this flag)
which properly checks if the directory is empty.

With this patch on smb3 mounts we correctly return
 "DIRECTORY NOT EMPTY"
on attempts to remove a non-empty directory.

Signed-off-by: Steve French <steve.french@primarydata.com>
Acked-by: Sachin Prabhu <sprabhu@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
fs/cifs/smb2glob.h
fs/cifs/smb2inode.c
fs/cifs/smb2pdu.c
fs/cifs/smb2proto.h