diff mbox

exportfs: fix export point checking

Message ID 1468041333-30255-1-git-send-email-yin-jianhong@163.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jianhong.Yin July 9, 2016, 5:15 a.m. UTC
NFS does not support file and symbolic export, if the export point
is regular file should give warning to user.

Signed-off-by: Jianhong Yin <jiyin@redhat.com>
---
 utils/exportfs/exportfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Steve Dickson July 18, 2016, 5:33 p.m. UTC | #1
On 07/09/2016 01:15 AM, Jianhong.Yin wrote:
> NFS does not support file and symbolic export, if the export point
> is regular file should give warning to user.
> 
> Signed-off-by: Jianhong Yin <jiyin@redhat.com>
> ---
>  utils/exportfs/exportfs.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
Committed... 

steved.
> 
> diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c
> index 5db348b..a00b5ea 100644
> --- a/utils/exportfs/exportfs.c
> +++ b/utils/exportfs/exportfs.c
> @@ -585,8 +585,8 @@ validate_export(nfs_export *exp)
>  		xlog(L_ERROR, "Failed to stat %s: %m", path);
>  		return;
>  	}
> -	if (!S_ISDIR(stb.st_mode) && !S_ISREG(stb.st_mode)) {
> -		xlog(L_ERROR, "%s is neither a directory nor a file. "
> +	if (!S_ISDIR(stb.st_mode)) {
> +		xlog(L_ERROR, "%s is not a directory. "
>  			"Remote access will fail", path);
>  		return;
>  	}
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c
index 5db348b..a00b5ea 100644
--- a/utils/exportfs/exportfs.c
+++ b/utils/exportfs/exportfs.c
@@ -585,8 +585,8 @@  validate_export(nfs_export *exp)
 		xlog(L_ERROR, "Failed to stat %s: %m", path);
 		return;
 	}
-	if (!S_ISDIR(stb.st_mode) && !S_ISREG(stb.st_mode)) {
-		xlog(L_ERROR, "%s is neither a directory nor a file. "
+	if (!S_ISDIR(stb.st_mode)) {
+		xlog(L_ERROR, "%s is not a directory. "
 			"Remote access will fail", path);
 		return;
 	}