Skip to content

Commit a0159ed

Browse files
committed
stress-rofs: handle ENOENT on symlink'd files
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
1 parent 24ba8b5 commit a0159ed

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

stress-rofs.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,11 @@ static int stres_rofs_file_open(
9898
return -1;
9999
break;
100100
default:
101-
pr_fail("%s: open on '%s' failed, errno=%d (%s)\n",
102-
args->name, path, errno, strerror(errno));
103-
return -1;
101+
break;
104102
}
103+
pr_fail("%s: open on '%s' failed, errno=%d (%s)\n",
104+
args->name, path, errno, strerror(errno));
105+
return -1;
105106
}
106107
return fd;
107108
}
@@ -440,11 +441,16 @@ static int stress_rofs_file_listxattr(
440441
case ENOSYS:
441442
case EOPNOTSUPP:
442443
return 0;
444+
case ENOENT:
445+
if (info->statbuf.st_mode & S_IFLNK)
446+
return 0;
447+
break;
443448
default:
444-
pr_fail("%s: listxattr on '%s' failed, errno=%d (%s)\n",
445-
args->name, path, errno, strerror(errno));
446-
return -1;
449+
break;
447450
}
451+
pr_fail("%s: listxattr on '%s' failed, errno=%d (%s)\n",
452+
args->name, path, errno, strerror(errno));
453+
return -1;
448454
}
449455
return 0;
450456
}

0 commit comments

Comments
 (0)