From: Ralph Boehme Date: Tue, 6 Nov 2018 11:34:17 +0000 (+0100) Subject: vfs_fruit: move a comment to the right place X-Git-Tag: samba-4.8.8~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b6987c345def2c8d85599b891a5074fd9adcf41a;p=thirdparty%2Fsamba.git vfs_fruit: move a comment to the right place Bug: https://bugzilla.samba.org/show_bug.cgi?id=13677 Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison (cherry picked from commit 4901d71c3de754a106662d01481b960ed7c2c4dd) --- diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index d75ce01b118..0bb034d0d8f 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -4524,6 +4524,12 @@ static ssize_t fruit_pwrite_meta_stream(vfs_handle_struct *handle, } if (ai_empty_finderinfo(ai)) { + /* + * Writing an all 0 blob to the metadata stream results in the + * stream being removed on a macOS server. This ensures we + * behave the same and it verified by the "delete AFP_AfpInfo by + * writing all 0" test. + */ ret = SMB_VFS_NEXT_FTRUNCATE(handle, fsp, 0); if (ret != 0) { DBG_ERR("SMB_VFS_NEXT_FTRUNCATE on [%s] failed\n", @@ -4596,6 +4602,12 @@ static ssize_t fruit_pwrite_meta_netatalk(vfs_handle_struct *handle, return n; } + /* + * Writing an all 0 blob to the metadata stream results in the stream + * being removed on a macOS server. This ensures we behave the same and + * it verified by the "delete AFP_AfpInfo by writing all 0" test. + */ + ok = set_delete_on_close( fsp, true, @@ -4617,13 +4629,6 @@ static ssize_t fruit_pwrite_meta(vfs_handle_struct *handle, struct fio *fio = (struct fio *)VFS_FETCH_FSP_EXTENSION(handle, fsp); ssize_t nwritten; - /* - * Writing an all 0 blob to the metadata stream - * results in the stream being removed on a macOS - * server. This ensures we behave the same and it - * verified by the "delete AFP_AfpInfo by writing all - * 0" test. - */ if (n != AFP_INFO_SIZE || offset != 0) { DBG_ERR("unexpected offset=%jd or size=%jd\n", (intmax_t)offset, (intmax_t)n);