]> git.baikalelectronics.ru Git - 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)
committerSteve French <smfrench@gmail.com>
Tue, 17 May 2016 19:09:44 +0000 (14:09 -0500)
commite7fcdeee58cc9ef3116bfa8535a59e8896aeeee8
treea57ae696c9ce5d897d3c263dd020cf1f3e33cf7b
parent8a1302c95dbaa10590adaaaeb4a55123ddbae72c
remove directory incorrectly tries to set delete on close on non-empty directories

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>
CC: Stable <stable@vger.kernel.org>
Acked-by: Sachin Prabhu <sprabhu@redhat.com>
fs/cifs/smb2glob.h
fs/cifs/smb2inode.c
fs/cifs/smb2pdu.c
fs/cifs/smb2proto.h