From 116674acc97ba75a720329996877077d988443a2 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Fri, 9 Mar 2001 20:33:35 +0000 Subject: Merge with Linux 2.4.2. --- fs/nfsd/nfsproc.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'fs/nfsd/nfsproc.c') diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c index b5057d57b..303792b58 100644 --- a/fs/nfsd/nfsproc.c +++ b/fs/nfsd/nfsproc.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include @@ -252,8 +252,19 @@ nfsd_proc_create(struct svc_rqst *rqstp, struct nfsd_createargs *argp, if (attr->ia_valid & ATTR_MODE) { type = attr->ia_mode & S_IFMT; mode = attr->ia_mode & ~S_IFMT; - if (!type) /* HP weirdness */ - type = S_IFREG; + if (!type) { + /* no type, so if target exists, assume same as that, + * else assume a file */ + if (inode) { + type = inode->i_mode & S_IFMT; + if (type == S_IFCHR || type == S_IFBLK) { + /* reserve rdev for later checking */ + attr->ia_size = inode->i_rdev; + attr->ia_valid |= ATTR_SIZE; + } + } else + type = S_IFREG; + } } else if (inode) { type = inode->i_mode & S_IFMT; mode = inode->i_mode & ~S_IFMT; -- cgit v1.2.3