Commit 20b5050b authored by Steve French's avatar Steve French Committed by Steve French

do not refresh mode (e.g. in revalidate) to windows servers

parent 32901365
......@@ -1184,7 +1184,6 @@ fill_in_inode(struct inode *tmp_inode,
pfindData->EndOfFile = le64_to_cpu(pfindData->EndOfFile);
cifsInfo->cifsAttrs = pfindData->ExtFileAttributes;
cifsInfo->time = jiffies;
atomic_inc(&cifsInfo->inUse); /* inc on every refresh of inode info */
/* Linux can not store file creation time unfortunately so ignore it */
tmp_inode->i_atime =
......@@ -1197,10 +1196,12 @@ fill_in_inode(struct inode *tmp_inode,
/* 2767 perms - indicate mandatory locking */
/* BB fill in uid and gid here? with help from winbind?
or retrieve from NTFS stream extended attribute */
if(atomic_read(&cifsInfo->inUse) == 0) {
tmp_inode->i_uid = cifs_sb->mnt_uid;
tmp_inode->i_gid = cifs_sb->mnt_gid;
/* set default mode. will override for dirs below */
tmp_inode->i_mode = cifs_sb->mnt_file_mode;
}
cFYI(0,
("CIFS FFIRST: Attributes came in as 0x%x",
......@@ -1212,7 +1213,9 @@ fill_in_inode(struct inode *tmp_inode,
} else if (pfindData->ExtFileAttributes & ATTR_DIRECTORY) {
*pobject_type = DT_DIR;
/* override default perms since we do not lock dirs */
if(atomic_read(&cifsInfo->inUse) == 0) {
tmp_inode->i_mode = cifs_sb->mnt_dir_mode;
}
tmp_inode->i_mode |= S_IFDIR;
} else {
*pobject_type = DT_REG;
......@@ -1223,6 +1226,10 @@ fill_in_inode(struct inode *tmp_inode,
}/* could add code here - to validate if device or weird share type? */
/* can not fill in nlink here as in qpathinfo version and Unx search */
if(atomic_read(&cifsInfo->inUse) == 0) {
atomic_set(&cifsInfo->inUse,1);
}
i_size_write(tmp_inode,pfindData->EndOfFile);
tmp_inode->i_blocks =
(tmp_inode->i_blksize - 1 + pfindData->AllocationSize) >> tmp_inode->i_blkbits;
......
......@@ -94,7 +94,7 @@ cifs_get_inode_info_unix(struct inode **pinode,
cFYI(1, (" Old time %ld ", cifsInfo->time));
cifsInfo->time = jiffies;
cFYI(1, (" New time %ld ", cifsInfo->time));
atomic_inc(&cifsInfo->inUse); /* inc on every refresh of inode */
atomic_set(&cifsInfo->inUse,1); /* ok to set on every refresh of inode */
inode->i_atime =
cifs_NTtimeToUnix(le64_to_cpu(findData.LastAccessTime));
......@@ -238,7 +238,6 @@ cifs_get_inode_info(struct inode **pinode, const unsigned char *search_path,
cFYI(1, (" Old time %ld ", cifsInfo->time));
cifsInfo->time = jiffies;
cFYI(1, (" New time %ld ", cifsInfo->time));
atomic_inc(&cifsInfo->inUse); /* inc on every refresh of inode */
/* blksize needs to be multiple of two. So safer to default to blksize
and blkbits set in superblock so 2**blkbits and blksize will match */
......@@ -256,6 +255,8 @@ cifs_get_inode_info(struct inode **pinode, const unsigned char *search_path,
(" Attributes came in as 0x%x ", pfindData->Attributes));
/* set default mode. will override for dirs below */
if(atomic_read(&cifsInfo->inUse) == 0)
/* new inode, can safely set these fields */
inode->i_mode = cifs_sb->mnt_file_mode;
if (pfindData->Attributes & ATTR_REPARSE) {
......@@ -281,8 +282,13 @@ cifs_get_inode_info(struct inode **pinode, const unsigned char *search_path,
/* BB fill in uid and gid here? with help from winbind?
or retrieve from NTFS stream extended attribute */
if(atomic_read(&cifsInfo->inUse) == 0) {
inode->i_uid = cifs_sb->mnt_uid;
inode->i_gid = cifs_sb->mnt_gid;
/* set so we do not keep refreshing these fields with
bad data after user has changed them in memory */
atomic_set(&cifsInfo->inUse,1);
}
if (S_ISREG(inode->i_mode)) {
cFYI(1, (" File inode "));
......
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