X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Fsendfile_grouplock.c;h=c293fd68fecd0546b4d6b92946387e863b9820c5;hb=ffa858b1657145c7e3d9988291fbb1ef72b3b980;hp=80b2da59aff77984cc000746f72356bdabe905d7;hpb=96f566ea1c6fccac9d427f7dc8c25ed4c3893299;p=fs%2Flustre-release.git diff --git a/lustre/tests/sendfile_grouplock.c b/lustre/tests/sendfile_grouplock.c index 80b2da5..c293fd6 100644 --- a/lustre/tests/sendfile_grouplock.c +++ b/lustre/tests/sendfile_grouplock.c @@ -22,6 +22,9 @@ /* * Copyright 2015 Cray Inc, all rights reserved. + * + * Copyright (c) 2017, Intel Corporation. + * * Author: Frank Zago. * * A few portions are extracted from llapi_layout_test.c @@ -60,12 +63,12 @@ #include #include #include +#include #include #include #include #include -#include #define ERROR(fmt, ...) \ fprintf(stderr, "%s: %s:%d: %s: " fmt "\n", \ @@ -266,6 +269,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);