Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 111156
b: refs/heads/master
c: 6b37faa
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Layton authored and Steve French committed Oct 6, 2008
1 parent 99cc007 commit e7fc474
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dfd15c46a6c2cafb006183c0c14f07e59eee4ac0
refs/heads/master: 6b37faa175311128dc920aaa57a5f7fab85537d7
24 changes: 18 additions & 6 deletions trunk/fs/cifs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,10 @@ cifs_set_file_info(struct inode *inode, struct iattr *attrs, int xid,
&info_buf, cifs_sb->local_nls,
cifs_sb->mnt_cifs_flags &
CIFS_MOUNT_MAP_SPECIAL_CHR);
if (rc != -EOPNOTSUPP && rc != -EINVAL)
if (rc == 0) {
cifsInode->cifsAttrs = dosattr;
goto out;
} else if (rc != -EOPNOTSUPP && rc != -EINVAL)
goto out;
}

Expand Down Expand Up @@ -805,6 +808,7 @@ cifs_rename_pending_delete(char *full_path, struct inode *inode, int xid)
kfree(info_buf);
if (rc != 0)
goto out_close;
cifsInode->cifsAttrs = dosattr;

/* silly-rename the file */
CIFSSMBRenameOpenFile(xid, tcon, netfid, NULL, cifs_sb->local_nls,
Expand Down Expand Up @@ -905,7 +909,6 @@ int cifs_unlink(struct inode *dir, struct dentry *dentry)
if (rc == 0)
drop_nlink(inode);
}
cifsInode->cifsAttrs = dosattr;
}
out_reval:
if (inode) {
Expand Down Expand Up @@ -963,7 +966,7 @@ static void posix_fill_in_inode(struct inode *tmp_inode,

int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
{
int rc = 0;
int rc = 0, tmprc;
int xid;
struct cifs_sb_info *cifs_sb;
struct cifsTconInfo *pTcon;
Expand Down Expand Up @@ -1025,6 +1028,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
kfree(pInfo);
goto mkdir_get_info;
}

/* Is an i_ino of zero legal? */
/* Are there sanity checks we can use to ensure that
the server is really filling in that field? */
Expand Down Expand Up @@ -1113,12 +1117,20 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) &&
(mode & S_IWUGO) == 0) {
FILE_BASIC_INFO pInfo;
struct cifsInodeInfo *cifsInode;
u32 dosattrs;

memset(&pInfo, 0, sizeof(pInfo));
pInfo.Attributes = cpu_to_le32(ATTR_READONLY);
CIFSSMBSetPathInfo(xid, pTcon, full_path,
&pInfo, cifs_sb->local_nls,
cifsInode = CIFS_I(newinode);
dosattrs = cifsInode->cifsAttrs|ATTR_READONLY;
pInfo.Attributes = cpu_to_le32(dosattrs);
tmprc = CIFSSMBSetPathInfo(xid, pTcon,
full_path, &pInfo,
cifs_sb->local_nls,
cifs_sb->mnt_cifs_flags &
CIFS_MOUNT_MAP_SPECIAL_CHR);
if (tmprc == 0)
cifsInode->cifsAttrs = dosattrs;
}
if (direntry->d_inode) {
if (cifs_sb->mnt_cifs_flags &
Expand Down

0 comments on commit e7fc474

Please sign in to comment.