diff options
| -rw-r--r-- | api/src/glfs-fops.c | 19 | 
1 files changed, 11 insertions, 8 deletions
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c index 548a4a8966b..e5143b346e6 100644 --- a/api/src/glfs-fops.c +++ b/api/src/glfs-fops.c @@ -1539,14 +1539,17 @@ retrynew:  	if (ret && errno != ENOENT && newloc.parent)  		goto out; -	if ((oldiatt.ia_type == IA_IFDIR) != (newiatt.ia_type == IA_IFDIR)) { -		/* Either both old and new must be dirs, or both must be -		   non-dirs. Else, fail. -		*/ -		ret = -1; -		errno = EISDIR; -		goto out; -	} +	if (newiatt.ia_type != IA_INVAL) { +                if ((oldiatt.ia_type == IA_IFDIR) != +                    (newiatt.ia_type == IA_IFDIR)) { +                       /* Either both old and new must be dirs, +                        * or both must be non-dirs. Else, fail. +                        */ +                       ret = -1; +                       errno = EISDIR; +                       goto out; +                } +        }  	/* TODO: check if new or old is a prefix of the other, and fail EINVAL */  | 
