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, ...@@ -1184,7 +1184,6 @@ fill_in_inode(struct inode *tmp_inode,
pfindData->EndOfFile = le64_to_cpu(pfindData->EndOfFile); pfindData->EndOfFile = le64_to_cpu(pfindData->EndOfFile);
cifsInfo->cifsAttrs = pfindData->ExtFileAttributes; cifsInfo->cifsAttrs = pfindData->ExtFileAttributes;
cifsInfo->time = jiffies; 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 */ /* Linux can not store file creation time unfortunately so ignore it */
tmp_inode->i_atime = tmp_inode->i_atime =
...@@ -1197,10 +1196,12 @@ fill_in_inode(struct inode *tmp_inode, ...@@ -1197,10 +1196,12 @@ fill_in_inode(struct inode *tmp_inode,
/* 2767 perms - indicate mandatory locking */ /* 2767 perms - indicate mandatory locking */
/* BB fill in uid and gid here? with help from winbind? /* BB fill in uid and gid here? with help from winbind?
or retrieve from NTFS stream extended attribute */ or retrieve from NTFS stream extended attribute */
if(atomic_read(&cifsInfo->inUse) == 0) {
tmp_inode->i_uid = cifs_sb->mnt_uid; tmp_inode->i_uid = cifs_sb->mnt_uid;
tmp_inode->i_gid = cifs_sb->mnt_gid; tmp_inode->i_gid = cifs_sb->mnt_gid;
/* set default mode. will override for dirs below */ /* set default mode. will override for dirs below */
tmp_inode->i_mode = cifs_sb->mnt_file_mode; tmp_inode->i_mode = cifs_sb->mnt_file_mode;
}
cFYI(0, cFYI(0,
("CIFS FFIRST: Attributes came in as 0x%x", ("CIFS FFIRST: Attributes came in as 0x%x",
...@@ -1212,7 +1213,9 @@ fill_in_inode(struct inode *tmp_inode, ...@@ -1212,7 +1213,9 @@ fill_in_inode(struct inode *tmp_inode,
} else if (pfindData->ExtFileAttributes & ATTR_DIRECTORY) { } else if (pfindData->ExtFileAttributes & ATTR_DIRECTORY) {
*pobject_type = DT_DIR; *pobject_type = DT_DIR;
/* override default perms since we do not lock dirs */ /* 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 = cifs_sb->mnt_dir_mode;
}
tmp_inode->i_mode |= S_IFDIR; tmp_inode->i_mode |= S_IFDIR;
} else { } else {
*pobject_type = DT_REG; *pobject_type = DT_REG;
...@@ -1223,6 +1226,10 @@ fill_in_inode(struct inode *tmp_inode, ...@@ -1223,6 +1226,10 @@ fill_in_inode(struct inode *tmp_inode,
}/* could add code here - to validate if device or weird share type? */ }/* 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 */ /* 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); i_size_write(tmp_inode,pfindData->EndOfFile);
tmp_inode->i_blocks = tmp_inode->i_blocks =
(tmp_inode->i_blksize - 1 + pfindData->AllocationSize) >> tmp_inode->i_blkbits; (tmp_inode->i_blksize - 1 + pfindData->AllocationSize) >> tmp_inode->i_blkbits;
......
...@@ -94,7 +94,7 @@ cifs_get_inode_info_unix(struct inode **pinode, ...@@ -94,7 +94,7 @@ cifs_get_inode_info_unix(struct inode **pinode,
cFYI(1, (" Old time %ld ", cifsInfo->time)); cFYI(1, (" Old time %ld ", cifsInfo->time));
cifsInfo->time = jiffies; cifsInfo->time = jiffies;
cFYI(1, (" New time %ld ", cifsInfo->time)); 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 = inode->i_atime =
cifs_NTtimeToUnix(le64_to_cpu(findData.LastAccessTime)); cifs_NTtimeToUnix(le64_to_cpu(findData.LastAccessTime));
...@@ -238,7 +238,6 @@ cifs_get_inode_info(struct inode **pinode, const unsigned char *search_path, ...@@ -238,7 +238,6 @@ cifs_get_inode_info(struct inode **pinode, const unsigned char *search_path,
cFYI(1, (" Old time %ld ", cifsInfo->time)); cFYI(1, (" Old time %ld ", cifsInfo->time));
cifsInfo->time = jiffies; cifsInfo->time = jiffies;
cFYI(1, (" New time %ld ", cifsInfo->time)); 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 /* 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 */ 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, ...@@ -256,6 +255,8 @@ cifs_get_inode_info(struct inode **pinode, const unsigned char *search_path,
(" Attributes came in as 0x%x ", pfindData->Attributes)); (" Attributes came in as 0x%x ", pfindData->Attributes));
/* set default mode. will override for dirs below */ /* 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; inode->i_mode = cifs_sb->mnt_file_mode;
if (pfindData->Attributes & ATTR_REPARSE) { if (pfindData->Attributes & ATTR_REPARSE) {
...@@ -281,8 +282,13 @@ cifs_get_inode_info(struct inode **pinode, const unsigned char *search_path, ...@@ -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? /* BB fill in uid and gid here? with help from winbind?
or retrieve from NTFS stream extended attribute */ or retrieve from NTFS stream extended attribute */
if(atomic_read(&cifsInfo->inUse) == 0) {
inode->i_uid = cifs_sb->mnt_uid; inode->i_uid = cifs_sb->mnt_uid;
inode->i_gid = cifs_sb->mnt_gid; 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)) { if (S_ISREG(inode->i_mode)) {
cFYI(1, (" File inode ")); 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