Commit 30f691a2 authored by Steve French's avatar Steve French

Make return code on failed cifs mounts more specific and fix incorrect smb to...

Make return code on failed cifs mounts more specific and fix incorrect smb to posix return code conversions
parent 2864cffb
...@@ -93,13 +93,17 @@ cifs_read_super(struct super_block *sb, void *data, char *devname, int silent) ...@@ -93,13 +93,17 @@ cifs_read_super(struct super_block *sb, void *data, char *devname, int silent)
sb->s_blocksize_bits = 14; /* default 2**14 = CIFS_MAX_MSGSIZE */ sb->s_blocksize_bits = 14; /* default 2**14 = CIFS_MAX_MSGSIZE */
inode = iget(sb, ROOT_I); inode = iget(sb, ROOT_I);
if (!inode) if (!inode) {
rc = -ENOMEM;
goto out_no_root; goto out_no_root;
}
sb->s_root = d_alloc_root(inode); sb->s_root = d_alloc_root(inode);
if (!sb->s_root) if (!sb->s_root) {
rc = -ENOMEM;
goto out_no_root; goto out_no_root;
}
return 0; return 0;
...@@ -113,7 +117,7 @@ cifs_read_super(struct super_block *sb, void *data, char *devname, int silent) ...@@ -113,7 +117,7 @@ cifs_read_super(struct super_block *sb, void *data, char *devname, int silent)
unload_nls(cifs_sb->local_nls); unload_nls(cifs_sb->local_nls);
if(cifs_sb) if(cifs_sb)
kfree(cifs_sb); kfree(cifs_sb);
return -EINVAL; return rc;
} }
void void
...@@ -331,7 +335,7 @@ struct file_operations cifs_file_ops = { ...@@ -331,7 +335,7 @@ struct file_operations cifs_file_ops = {
.release = cifs_close, .release = cifs_close,
.lock = cifs_lock, .lock = cifs_lock,
.fsync = cifs_fsync, .fsync = cifs_fsync,
.flush = cifs_flush, .flush = cifs_flush,
.mmap = cifs_file_mmap, .mmap = cifs_file_mmap,
.sendfile = generic_file_sendfile, .sendfile = generic_file_sendfile,
}; };
......
...@@ -46,7 +46,7 @@ struct smb_to_posix_error { ...@@ -46,7 +46,7 @@ struct smb_to_posix_error {
const struct smb_to_posix_error mapping_table_ERRDOS[] = { const struct smb_to_posix_error mapping_table_ERRDOS[] = {
{ERRbadfunc, -EINVAL}, {ERRbadfunc, -EINVAL},
{ERRbadfile, -ENOENT}, {ERRbadfile, -ENOENT},
{ERRbadpath, -ENOENT}, {ERRbadpath, -ENOTDIR},
{ERRnofids, -EMFILE}, {ERRnofids, -EMFILE},
{ERRnoaccess, -EACCES}, {ERRnoaccess, -EACCES},
{ERRbadfid, -EBADF}, {ERRbadfid, -EBADF},
...@@ -63,26 +63,29 @@ const struct smb_to_posix_error mapping_table_ERRDOS[] = { ...@@ -63,26 +63,29 @@ const struct smb_to_posix_error mapping_table_ERRDOS[] = {
{ERRnofiles, -ENOENT}, {ERRnofiles, -ENOENT},
{ERRbadshare, -ETXTBSY}, {ERRbadshare, -ETXTBSY},
{ERRlock, -EACCES}, {ERRlock, -EACCES},
{ERRfilexists, -EINVAL}, {ERRunsup, -EINVAL},
{ERRnosuchshare,-ENXIO},
{ERRfilexists, -EEXIST},
{ERRinvparm, -EINVAL}, {ERRinvparm, -EINVAL},
{ERRdiskfull, -ENOSPC}, {ERRdiskfull, -ENOSPC},
{ERRinvnum, -EINVAL}, {ERRinvname, -ENOENT},
{ERRdirnotempty, -ENOTEMPTY}, {ERRdirnotempty, -ENOTEMPTY},
{ERRnotlocked, -ENOLCK}, {ERRnotlocked, -ENOLCK},
{ERRalreadyexists, -EEXIST}, {ERRalreadyexists, -EEXIST},
{ERRmoredata, -EOVERFLOW}, {ERRmoredata, -EOVERFLOW},
{ErrQuota, -EDQUOT}, {ErrQuota, -EDQUOT},
{ErrNotALink, -ENOLINK}, {ErrNotALink, -ENOLINK},
{ERRnetlogonNotStarted,-ENOPROTOOPT},
{0, 0} {0, 0}
}; };
const struct smb_to_posix_error mapping_table_ERRSRV[] = { const struct smb_to_posix_error mapping_table_ERRSRV[] = {
{ERRerror, -EIO}, {ERRerror, -EIO},
{ERRbadpw, -EACCES}, {ERRbadpw, -EPERM},
{ERRbadtype, -EREMOTE}, {ERRbadtype, -EREMOTE},
{ERRaccess, -EACCES}, {ERRaccess, -EACCES},
{ERRinvtid, -ENXIO}, {ERRinvtid, -ENXIO},
{ERRinvnetname, -ENOENT}, {ERRinvnetname, -ENODEV},
{ERRinvdevice, -ENXIO}, {ERRinvdevice, -ENXIO},
{ERRqfull, -ENOSPC}, {ERRqfull, -ENOSPC},
{ERRqtoobig, -ENOSPC}, {ERRqtoobig, -ENOSPC},
...@@ -617,7 +620,7 @@ static const struct { ...@@ -617,7 +620,7 @@ static const struct {
ERRHRD, ERRgeneral, NT_STATUS_EVENTLOG_CANT_START}, { ERRHRD, ERRgeneral, NT_STATUS_EVENTLOG_CANT_START}, {
ERRDOS, ERRnoaccess, NT_STATUS_TRUST_FAILURE}, { ERRDOS, ERRnoaccess, NT_STATUS_TRUST_FAILURE}, {
ERRHRD, ERRgeneral, NT_STATUS_MUTANT_LIMIT_EXCEEDED}, { ERRHRD, ERRgeneral, NT_STATUS_MUTANT_LIMIT_EXCEEDED}, {
ERRDOS, 2455, NT_STATUS_NETLOGON_NOT_STARTED}, { ERRDOS, ERRnetlogonNotStarted, NT_STATUS_NETLOGON_NOT_STARTED}, {
ERRSRV, 2239, NT_STATUS_ACCOUNT_EXPIRED}, { ERRSRV, 2239, NT_STATUS_ACCOUNT_EXPIRED}, {
ERRHRD, ERRgeneral, NT_STATUS_POSSIBLE_DEADLOCK}, { ERRHRD, ERRgeneral, NT_STATUS_POSSIBLE_DEADLOCK}, {
ERRHRD, ERRgeneral, NT_STATUS_NETWORK_CREDENTIAL_CONFLICT}, { ERRHRD, ERRgeneral, NT_STATUS_NETWORK_CREDENTIAL_CONFLICT}, {
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
#define ERRfilexists 80 /* The file named in the request already exists. */ #define ERRfilexists 80 /* The file named in the request already exists. */
#define ERRinvparm 87 #define ERRinvparm 87
#define ERRdiskfull 112 #define ERRdiskfull 112
#define ERRinvnum 123 #define ERRinvname 123
#define ERRdirnotempty 145 #define ERRdirnotempty 145
#define ERRnotlocked 158 #define ERRnotlocked 158
#define ERRalreadyexists 183 #define ERRalreadyexists 183
...@@ -109,4 +109,5 @@ class.*/ ...@@ -109,4 +109,5 @@ class.*/
#define ERRbadclient 2240 #define ERRbadclient 2240
#define ERRbadLogonTime 2241 #define ERRbadLogonTime 2241
#define ERRpasswordExpired 2242 #define ERRpasswordExpired 2242
#define ERRnetlogonNotStarted 2455
#define ERRnosupport 0xFFFF #define ERRnosupport 0xFFFF
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment