1.1 --- a/libe2access/lib/src/image.c Tue Dec 28 01:37:59 2021 +0100
1.2 +++ b/libe2access/lib/src/image.c Tue Dec 28 22:18:04 2021 +0100
1.3 @@ -36,6 +36,7 @@
1.4 {
1.5 struct ext2_inode inode_file;
1.6 errcode_t retval;
1.7 + int retry;
1.8
1.9 /* Without an inode, create a new one. */
1.10
1.11 @@ -45,13 +46,15 @@
1.12
1.13 /* Connect the inode to its parent. */
1.14
1.15 - while (1)
1.16 + for (retry = 0; retry <= 1; retry++)
1.17 {
1.18 retval = ext2fs_link(fs, ino_target, basename, *ino_file,
1.19 EXT2_FT_REG_FILE);
1.20
1.21 if (!retval)
1.22 break;
1.23 + else if (retry)
1.24 + return retval;
1.25
1.26 /* Expand the directory if necessary. */
1.27