diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2022-11-23 15:40:11 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2022-11-23 16:43:13 +0100 |
| commit | 928544a6c60ea87fafae67c861747ee5b41868b3 (patch) | |
| tree | 02ebc53344fdf1fa011280d81a9fe68477896f30 | |
| parent | 351d395f89a03f58ec8cdf953847ab1458cdc7e5 (diff) | |
executor: don't reset loop device on partition scan success
We symlink resulting partitions into the test dir.
If we do LOOP_CLR_FD, device and partitions disappear.
Don't do LOOP_CLR_FD on success.
| -rw-r--r-- | executor/common_linux.h | 3 | ||||
| -rw-r--r-- | pkg/csource/generated.go | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/executor/common_linux.h b/executor/common_linux.h index 8ca854c9e..c8dccc670 100644 --- a/executor/common_linux.h +++ b/executor/common_linux.h @@ -2982,7 +2982,8 @@ static long syz_read_part_table(volatile unsigned long size, volatile long image } } error_clear_loop: - ioctl(loopfd, LOOP_CLR_FD, 0); + if (res) + ioctl(loopfd, LOOP_CLR_FD, 0); close(loopfd); close(memfd); errno = err; diff --git a/pkg/csource/generated.go b/pkg/csource/generated.go index 61b95e4cf..5144782b6 100644 --- a/pkg/csource/generated.go +++ b/pkg/csource/generated.go @@ -6755,7 +6755,8 @@ static long syz_read_part_table(volatile unsigned long size, volatile long image } } error_clear_loop: - ioctl(loopfd, LOOP_CLR_FD, 0); + if (res) + ioctl(loopfd, LOOP_CLR_FD, 0); close(loopfd); close(memfd); errno = err; |
