Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[pandora-kernel.git] / fs / cifs / dir.c
index bd363df..391816b 100644 (file)
@@ -248,6 +248,7 @@ int cifs_posix_open(char *full_path, struct inode **pinode,
 
        /* get new inode and set it up */
        if (*pinode == NULL) {
+               cifs_fill_uniqueid(sb, &fattr);
                *pinode = cifs_iget(sb, &fattr);
                if (!*pinode) {
                        rc = -ENOMEM;
@@ -261,8 +262,14 @@ int cifs_posix_open(char *full_path, struct inode **pinode,
         * cifs_fill_filedata() takes care of setting cifsFileInfo pointer to
         * file->private_data.
         */
-       if (mnt)
-               cifs_new_fileinfo(*pinode, *pnetfid, NULL, mnt, oflags);
+       if (mnt) {
+               struct cifsFileInfo *pfile_info;
+
+               pfile_info = cifs_new_fileinfo(*pinode, *pnetfid, NULL, mnt,
+                                              oflags);
+               if (pfile_info == NULL)
+                       rc = -ENOMEM;
+       }
 
 posix_open_ret:
        kfree(presp_data);
@@ -476,12 +483,15 @@ cifs_create_set_dentry:
                /* mknod case - do not leave file open */
                CIFSSMBClose(xid, tcon, fileHandle);
        } else if (!(posix_create) && (newinode)) {
+               struct cifsFileInfo *pfile_info;
                /*
                 * cifs_fill_filedata() takes care of setting cifsFileInfo
                 * pointer to file->private_data.
                 */
-               cifs_new_fileinfo(newinode, fileHandle, NULL, nd->path.mnt,
-                                 oflags);
+               pfile_info = cifs_new_fileinfo(newinode, fileHandle, NULL,
+                                              nd->path.mnt, oflags);
+               if (pfile_info == NULL)
+                       rc = -ENOMEM;
        }
 cifs_create_out:
        kfree(buf);