Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
[sfrench/cifs-2.6.git] / fs / cifs / inode.c
index 598eec9778f67cbba3c0feb29d01c7b6c9e0f9d5..e842ce9f65476c7c08037af4217b319635533eee 100644 (file)
@@ -609,9 +609,8 @@ int cifs_unlink(struct inode *inode, struct dentry *direntry)
                }
        } else if (rc == -EACCES) {
                /* try only if r/o attribute set in local lookup data? */
-               pinfo_buf = kmalloc(sizeof(FILE_BASIC_INFO), GFP_KERNEL);
+               pinfo_buf = kzalloc(sizeof(FILE_BASIC_INFO), GFP_KERNEL);
                if (pinfo_buf) {
-                       memset(pinfo_buf, 0, sizeof(FILE_BASIC_INFO));
                        /* ATTRS set to normal clears r/o bit */
                        pinfo_buf->Attributes = cpu_to_le32(ATTR_NORMAL);
                        if (!(pTcon->ses->flags & CIFS_SES_NT4))
@@ -1167,7 +1166,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
                                                nfid, npid, FALSE);
                        atomic_dec(&open_file->wrtPending);
                        cFYI(1,("SetFSize for attrs rc = %d", rc));
-                       if(rc == -EINVAL) {
+                       if((rc == -EINVAL) || (rc == -EOPNOTSUPP)) {
                                int bytes_written;
                                rc = CIFSSMBWrite(xid, pTcon,
                                                  nfid, 0, attrs->ia_size,
@@ -1189,7 +1188,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
                                           cifs_sb->mnt_cifs_flags &
                                                CIFS_MOUNT_MAP_SPECIAL_CHR);
                        cFYI(1, ("SetEOF by path (setattrs) rc = %d", rc));
-                       if(rc == -EINVAL) {
+                       if((rc == -EINVAL) || (rc == -EOPNOTSUPP)) {
                                __u16 netfid;
                                int oplock = FALSE;