# [Unsolved]CIFS VFS: Unexpected lookup error -12

## lyallp

I have just started receiving this error.

I am mounting a file share from a Windows 7 Ultimate 64bit (brand new install, fully patched up)

/etc/fstab line is 

```
//trans-pc/D      /mnt/trans-pc/d      cifs    defaults,user,rw,file_mode=0770,dir_mode=0770,iocharset=iso8859-1,credentials=/etc/samba/private/auth.trans-pc.lyall,noauto,gid=smb,noserverino            0 0

```

Then, I am trying to copy stacks of photos across using

```
cp --no-preserve=all --no-clobber --update --verbose --recursive --force --no-dereference  "${DIGICAM_PICS}/Digicam Pics" "${mountPoint}"
```

Things go along swimmingly for a while, then cp suddenly starts reporting

```
`/mnt/disk_02/Digicam Pics/The Pics/2006-01/(2006_01_02 14_20_39) p1020794.jpg' -> `/mnt/trans-pc/d/Digicam Pics/The Pics/2006-01/(2006_01_02 14_20_39) p1020794.jpg'

cp: cannot create regular file `/mnt/trans-pc/d/Digicam Pics/The Pics/2006-01/(2006_01_02 14_20_39) p1020794.jpg': Cannot allocate memory

```

The /var/log/messages contains

```
May 11 22:20:01 lyalls-pc kernel: CIFS VFS: Unexpected lookup error -12

```

I was running gentoo-sources 2.6.36-r8, I upgraded to 2.6.37-r4, same error.

Suggestions?

----------

## lyallp

I am now running 2.6.38-gentoo-r6, I just received the same error.

Interestingly, I unmount the share, attempt to re-mount it and then I receive 

```
IFS VFS: Send error in SessSetup = -12

CIFS VFS: cifs_mount failed w/return code = -12
```

----------

## lyallp

Found the problem.

I had some files with question marks and double quotes in their filenames.

I use NTFS-3g and it quite happily allowed them to be created on my local disk and my USB external NTFS disk, but when I tried to copy the files to a windows share, where the windows machine was Windows 7, things went wrong.

Personally, I think an error such as "Cannot create file" would be preferable to CIFS VFS generating suprious messages and then not working until the system is re-booted. I am not sure where I should post this as a bug, kernel or in the Windows 7 share code, as it is apparently ok to create these characters in filenames if the program uses the Unicode API.

Edit:

Hmmm. Problem re-occurred, and I had cleaned up all the 'illegal' chars... back to square one.

----------

## friesia

I found a solution.

 *Quote:*   

> In HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management, set the LargeSystemCache key to 1 (hex).
> 
> In HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters, set the Size key to 3 (hex)
> 
> 

 

And then you have to restart some services and dependencies, or in my case I restarted Windows 7.

----------

## lyallp

Are you suggesting I have to change the registry settings on the target Win 7 machines? (the ones whose share I mount)?

----------

