1
1

romio: pick "infinitely stale" fix from upstream

Some NFS scenarios can result in an infinite ESTALE return, which will
hang ROMIO.  This commit causes ROMIO to error out after a large number
of retries instead of spinning forever.

This is MPICH commit b250d338:

http://git.mpich.org/mpich.git/commit/b250d338e66667a8a1071a5f73a4151fd59f83b2

cmr=v1.7.5:reviewer=jsquyres

This commit was SVN r29993.
Этот коммит содержится в:
Dave Goodell 2013-12-19 22:55:26 +00:00
родитель e4097c5cc9
Коммит 0c6b292442
2 изменённых файлов: 13 добавлений и 5 удалений

Просмотреть файл

@ -14,7 +14,7 @@ Local modifications:
- Moved aclocal.m4 -> acinclude.m4
- Bunches of changes in acinclude.m4 to make it work with modern
versions of the GNU auto tools -- see comments in file.
- Bunches of changes in configure.in to make it work with modern
- Bunches of changes in configure.ac to make it work with modern
versions of the GNU auto tools -- see comments in file.
- We define MPI_MAX_DATAREP_STRING, therefore
protect the redefinition in include/mpio.h
@ -22,4 +22,5 @@ Local modifications:
test/noncontig_coll.c
Patches past 3.0.4: (Update whenever ROMIO is updated)
- None
- Deal with endless ESTALE cases:
http://git.mpich.org/mpich.git/commit/b250d338e66667a8a1071a5f73a4151fd59f83b2

Просмотреть файл

@ -257,12 +257,17 @@ static void ADIO_FileSysType_fncall(const char *filename, int *fstype, int *erro
#endif
static char myname[] = "ADIO_RESOLVEFILETYPE_FNCALL";
/* NFS can get stuck and end up returing ESTALE "forever" */
#define MAX_ESTALE_RETRY 10000
int retry_cnt;
*error_code = MPI_SUCCESS;
#ifdef ROMIO_HAVE_STRUCT_STATVFS_WITH_F_BASETYPE
retry_cnt=0;
do {
err = statvfs(filename, &vfsbuf);
} while (err && (errno == ESTALE));
} while (err && (errno == ESTALE) && retry_cnt++ < MAX_ESTALE_RETRY);
if (err) {
/* ENOENT may be returned in two cases:
@ -317,9 +322,10 @@ static void ADIO_FileSysType_fncall(const char *filename, int *fstype, int *erro
#endif /* STATVFS APPROACH */
#ifdef HAVE_STRUCT_STATFS
retry_cnt = 0;
do {
err = statfs(filename, &fsbuf);
} while (err && (errno == ESTALE));
} while (err && (errno == ESTALE) && retry_cnt++ < MAX_ESTALE_RETRY);
if (err) {
if(errno == ENOENT) {
@ -436,9 +442,10 @@ static void ADIO_FileSysType_fncall(const char *filename, int *fstype, int *erro
#endif /* STATFS APPROACH */
#ifdef ROMIO_HAVE_STRUCT_STAT_WITH_ST_FSTYPE
retry_cnt = 0;
do {
err = stat(filename, &sbuf);
} while (err && (errno == ESTALE));
} while (err && (errno == ESTALE) && retry_cnt++ < MAX_ESTALE_RETRY);
if (err) {
if(errno == ENOENT) {