From c14e894bd40868d6d1f2379705b68acf5288ba27 Mon Sep 17 00:00:00 2001 From: Steve French Date: Thu, 15 Feb 2007 01:33:18 +0000 Subject: [CIFS] fix &&/& typo in cifs_setattr() Thanks to Dirk for pointing this out. Signed-off-by: Dirk Mueller Signed-off-by: Steve French diff --git a/fs/cifs/cifspdu.h b/fs/cifs/cifspdu.h index 7d95054..2498d64 100644 --- a/fs/cifs/cifspdu.h +++ b/fs/cifs/cifspdu.h @@ -35,9 +35,11 @@ #define BAD_PROT 0xFFFF /* SMB command codes */ -/* Some commands have minimal (wct=0,bcc=0), or uninteresting, responses - (ie which include no useful data other than the SMB error code itself). - Knowing this helps avoid response buffer allocations and copy in some cases */ +/* + * Some commands have minimal (wct=0,bcc=0), or uninteresting, responses + * (ie which include no useful data other than the SMB error code itself). + * Knowing this helps avoid response buffer allocations and copy in some cases + */ #define SMB_COM_CREATE_DIRECTORY 0x00 /* trivial response */ #define SMB_COM_DELETE_DIRECTORY 0x01 /* trivial response */ #define SMB_COM_CLOSE 0x04 /* triv req/rsp, timestamp ignored */ diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 3f5bc83..e203f63 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -1359,7 +1359,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs) and this check ensures that we are not being called from sys_utimes in which case we ought to fail the call back to the user when the server rejects the call */ - if((rc) && (attrs->ia_valid && + if((rc) && (attrs->ia_valid & (ATTR_MODE | ATTR_GID | ATTR_UID | ATTR_SIZE))) rc = 0; } -- cgit v0.10.2 From 1b2b212603ceb47d60aff571dcfffc846fcfa336 Mon Sep 17 00:00:00 2001 From: Steve French Date: Sat, 17 Feb 2007 04:30:54 +0000 Subject: [CIFS] mtime bounces from local to remote when cifs nocmtime i_flags overwritten atime flag was also overwritten. Noticed by Shirish when he was debugging an atime problem. Should help performance a bit too. cifs should be getting time stamps from the server (that was the original intent too) Signed-off-by: Steve French diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index e8287c4..887c89b 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -91,8 +91,9 @@ cifs_read_super(struct super_block *sb, void *data, struct inode *inode; struct cifs_sb_info *cifs_sb; int rc = 0; - - sb->s_flags |= MS_NODIRATIME; /* and probably even noatime */ + + /* BB should we make this contingent on mount parm? */ + sb->s_flags |= MS_NODIRATIME | MS_NOATIME; sb->s_fs_info = kzalloc(sizeof(struct cifs_sb_info),GFP_KERNEL); cifs_sb = CIFS_SB(sb); if(cifs_sb == NULL) @@ -258,7 +259,10 @@ cifs_alloc_inode(struct super_block *sb) cifs_inode->clientCanCacheRead = FALSE; cifs_inode->clientCanCacheAll = FALSE; cifs_inode->vfs_inode.i_blkbits = 14; /* 2**14 = CIFS_MAX_MSGSIZE */ - cifs_inode->vfs_inode.i_flags = S_NOATIME | S_NOCMTIME; + + /* Can not set i_flags here - they get immediately overwritten + to zero by the VFS */ +/* cifs_inode->vfs_inode.i_flags = S_NOATIME | S_NOCMTIME;*/ INIT_LIST_HEAD(&cifs_inode->openFileList); return &cifs_inode->vfs_inode; } diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index e203f63..37c6ce8 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -90,6 +90,9 @@ int cifs_get_inode_info_unix(struct inode **pinode, (*pinode)->i_ino = (unsigned long)findData.UniqueId; } /* note ino incremented to unique num in new_inode */ + if(sb->s_flags & MS_NOATIME) + (*pinode)->i_flags |= S_NOATIME | S_NOCMTIME; + insert_inode_hash(*pinode); } @@ -421,6 +424,8 @@ int cifs_get_inode_info(struct inode **pinode, } else /* do we need cast or hash to ino? */ (*pinode)->i_ino = inode_num; } /* else ino incremented to unique num in new_inode*/ + if(sb->s_flags & MS_NOATIME) + (*pinode)->i_flags |= S_NOATIME | S_NOCMTIME; insert_inode_hash(*pinode); } inode = *pinode; diff --git a/fs/cifs/link.c b/fs/cifs/link.c index 8e25996..6baea85 100644 --- a/fs/cifs/link.c +++ b/fs/cifs/link.c @@ -77,7 +77,8 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode, cifsInode = CIFS_I(old_file->d_inode); if(rc == 0) { old_file->d_inode->i_nlink++; - old_file->d_inode->i_ctime = CURRENT_TIME; +/* BB should we make this contingent on superblock flag NOATIME? */ +/* old_file->d_inode->i_ctime = CURRENT_TIME;*/ /* parent dir timestamps will update from srv within a second, would it really be worth it to set the parent dir cifs inode time to zero diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c index c6220bd..c444798 100644 --- a/fs/cifs/readdir.c +++ b/fs/cifs/readdir.c @@ -83,6 +83,8 @@ static int construct_dentry(struct qstr *qstring, struct file *file, return rc; rc = 1; } + if(file->f_path.dentry->d_sb->s_flags & MS_NOATIME) + (*ptmp_inode)->i_flags |= S_NOATIME | S_NOCMTIME; } else { tmp_dentry = d_alloc(file->f_path.dentry, qstring); if(tmp_dentry == NULL) { @@ -98,6 +100,8 @@ static int construct_dentry(struct qstr *qstring, struct file *file, tmp_dentry->d_op = &cifs_dentry_ops; if(*ptmp_inode == NULL) return rc; + if(file->f_path.dentry->d_sb->s_flags & MS_NOATIME) + (*ptmp_inode)->i_flags |= S_NOATIME | S_NOCMTIME; rc = 2; } -- cgit v0.10.2 From 004c46b9e588edf549a39c5db54e37ebd0b3b3ad Mon Sep 17 00:00:00 2001 From: Steve French Date: Sat, 17 Feb 2007 04:34:13 +0000 Subject: [CIFS] One line missing from previous commit Signed-off-by: Steve French diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 887c89b..bc2c0ac 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -287,6 +287,7 @@ cifs_show_options(struct seq_file *s, struct vfsmount *m) if (cifs_sb) { if (cifs_sb->tcon) { +/* BB add prepath to mount options displayed */ seq_printf(s, ",unc=%s", cifs_sb->tcon->treeName); if (cifs_sb->tcon->ses) { if (cifs_sb->tcon->ses->userName) diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 07ff935..a1265c9 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -1014,8 +1014,9 @@ static ssize_t cifs_write(struct file *file, const char *write_data, /* since the write may have blocked check these pointers again */ if (file->f_path.dentry) { if (file->f_path.dentry->d_inode) { - file->f_path.dentry->d_inode->i_ctime = - file->f_path.dentry->d_inode->i_mtime = CURRENT_TIME; +/*BB We could make this contingent on superblock ATIME flag too */ +/* file->f_path.dentry->d_inode->i_ctime = + file->f_path.dentry->d_inode->i_mtime = CURRENT_TIME;*/ if (total_written > 0) { if (*poffset > file->f_path.dentry->d_inode->i_size) i_size_write(file->f_path.dentry->d_inode, -- cgit v0.10.2