vfs_fruit: move a comment to the right place
authorRalph Boehme <slow@samba.org>
Tue, 6 Nov 2018 11:34:17 +0000 (12:34 +0100)
committerJeremy Allison <jra@samba.org>
Fri, 9 Nov 2018 21:42:27 +0000 (22:42 +0100)
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13677

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_fruit.c

index efe88efcaeb307ce3c18d33a837df92cc492d44c..59607c8dcf0e082e58ab5c0e3c5cd42b68ddd64f 100644 (file)
@@ -4534,6 +4534,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",
@@ -4606,6 +4612,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,
@@ -4627,13 +4639,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);