Whamcloud - gitweb
LU-9412 lfs: A invalid memory write in llapi_layout_to_lum
[fs/lustre-release.git] / lustre / tests / sendfile_grouplock.c
index 5cd8d5e..76174f1 100644 (file)
@@ -66,7 +66,6 @@
 #include <sys/sendfile.h>
 
 #include <lustre/lustreapi.h>
-#include <lustre/lustre_idl.h>
 
 #define ERROR(fmt, ...)                                                        \
        fprintf(stderr, "%s: %s:%d: %s: " fmt "\n",                     \
@@ -267,6 +266,17 @@ static int sendfile_copy(const char *source, int source_gid,
 
        }
 
+       if (dest_gid != 0) {
+               rc = llapi_group_unlock(fd_out, dest_gid);
+               ASSERTF(rc == 0, "cannot clear group lock %d for '%s': %s",
+                       dest_gid, dest, strerror(-rc));
+       }
+       if (source_gid != 0) {
+               rc = llapi_group_unlock(fd_in, source_gid);
+               ASSERTF(rc == 0, "cannot clear group lock %d for '%s': %s",
+                       source_gid, source, strerror(-rc));
+       }
+
        close(fd_out);
        close(fd_in);