From 24f96966d7c85c1e2ffdaa1be314039a0f5cf422 Mon Sep 17 00:00:00 2001 From: Bruno Faccini Date: Fri, 6 Feb 2015 12:03:32 +0100 Subject: [PATCH] LU-6219 utils: remove O_NONBLOCK usage for archive file In the first implementations of Posix copytool, file archive/restore was using a loop around select() with handling/retry on EAGAIN. This was later found as useless for regular files and fixed/changed in patch for LU-3971 (http://review.whamcloud.com/7583, commit 397ebc93cef378e6d77450cdd095e2737b94f2f6). But the O_NONBLOCK flag usage, during open() of file on archive, has been kept since and must be removed, even if ineffective, to improve code clarity. Signed-off-by: Bruno Faccini Change-Id: Ie6350e6f3951545f50783c9fff6753793b7a9a33 Reviewed-on: http://review.whamcloud.com/13672 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Robert Read Reviewed-by: Hongchao Zhang Reviewed-by: Oleg Drokin --- lustre/utils/lhsmtool_posix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lustre/utils/lhsmtool_posix.c b/lustre/utils/lhsmtool_posix.c index 5a81e4f..12ead32 100644 --- a/lustre/utils/lhsmtool_posix.c +++ b/lustre/utils/lhsmtool_posix.c @@ -917,7 +917,7 @@ static int ct_archive(const struct hsm_action_item *hai, const long hal_flags) goto fini_major; } - open_flags = O_WRONLY | O_NOFOLLOW | O_NONBLOCK; + open_flags = O_WRONLY | O_NOFOLLOW; /* If extent is specified, don't truncate an old archived copy */ open_flags |= ((hai->hai_extent.length == -1) ? O_TRUNC : 0) | O_CREAT; @@ -1170,7 +1170,7 @@ static int ct_restore(const struct hsm_action_item *hai, const long hal_flags) goto fini; } - src_fd = open(src, O_RDONLY | O_NOATIME | O_NONBLOCK | O_NOFOLLOW); + src_fd = open(src, O_RDONLY | O_NOATIME | O_NOFOLLOW); if (src_fd < 0) { rc = -errno; CT_ERROR(rc, "cannot open '%s' for read", src); -- 1.8.3.1