summaryrefslogtreecommitdiffstats
path: root/source3
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2013-11-08 15:10:03 +0100
committerJeremy Allison <jra@samba.org>2013-11-08 09:42:20 -0800
commit29f12e7d5960906935e3af1405e9759a07d64750 (patch)
treee5fee9958aecc87a35a88446767593d0ed1499c6 /source3
parentc7aab6e5205b78f00f84492cc1a0fd4b67ef917a (diff)
downloadsamba-29f12e7d5960906935e3af1405e9759a07d64750.tar.gz
samba-29f12e7d5960906935e3af1405e9759a07d64750.tar.xz
samba-29f12e7d5960906935e3af1405e9759a07d64750.zip
s3-vfs: Fix stream_depot vfs module on btrfs.
Checking if the directory is empty using 'nlink == 2' only checks if there are no subdirectories. It doesn't indicate if there are files in the directory. However checking link count for no subdirectories is wrong and applications shouldn't rely on it, see: https://lkml.org/lkml/2012/2/1/756 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/modules/vfs_streams_depot.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source3/modules/vfs_streams_depot.c b/source3/modules/vfs_streams_depot.c
index 3ada92eeb5..f33d998b4e 100644
--- a/source3/modules/vfs_streams_depot.c
+++ b/source3/modules/vfs_streams_depot.c
@@ -665,6 +665,7 @@ static int streams_depot_unlink(vfs_handle_struct *handle,
static int streams_depot_rmdir(vfs_handle_struct *handle, const char *path)
{
struct smb_filename *smb_fname_base = NULL;
+ char *dirname;
int ret = -1;
DEBUG(10, ("streams_depot_rmdir called for %s\n", path));
@@ -690,15 +691,14 @@ static int streams_depot_rmdir(vfs_handle_struct *handle, const char *path)
return -1;
}
- if (smb_fname_base->st.st_ex_nlink == 2) {
- char *dirname = stream_dir(handle, smb_fname_base,
- &smb_fname_base->st, false);
-
- if (dirname != NULL) {
- SMB_VFS_NEXT_RMDIR(handle, dirname);
- }
- TALLOC_FREE(dirname);
+ dirname = stream_dir(handle,
+ smb_fname_base,
+ &smb_fname_base->st,
+ false);
+ if (dirname != NULL) {
+ SMB_VFS_NEXT_RMDIR(handle, dirname);
}
+ TALLOC_FREE(dirname);
ret = SMB_VFS_NEXT_RMDIR(handle, path);