[linux-cifs-client] "fix some settings of cifsAttrs"

Steve French smfrench at gmail.com
Mon Sep 29 19:40:57 GMT 2008


It looks like the "fix some settings of cifsAttrs" patch below, is
missing some locations.  In cifs_set_file_info we don't seem to record
the newly modified dosattrs in the inode except in one path - so we
can't remove the "cifsInode->cifsAttrs = dosattr;" statement from
cifs_unlink or else we will reset the attributes again in
cifs_rename_pending_delete    We need to scan every call to
setpathinfo and setfileinfo again to make sure that we reset cifsattrs
in the inode if we succeed - looks like we are missing two places that
would need to be fixed before Jeff's patch should apply

cifs: fix some settings of cifsAttrs after calls to SetFileInfo

We only need to set them when we call SetFileInfo directly, and as
soon as possible after then. We had one place setting it where it
didn't need to be, and another place where it was missing.

Signed-off-by: Jeff Layton <jlayton at redhat.com>
---

diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 24aac67..884b0b5 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -804,6 +804,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;

        /* rename the file */
        rc = CIFSSMBRenameOpenFile(xid, tcon, netfid, NULL, cifs_sb->local_nls,
@@ -910,7 +911,6 @@ psx_del_no_retry:
                        if (rc == 0)
                                drop_nlink(inode);
                }
-               cifsInode->cifsAttrs = dosattr;
        }
 out_reval:
        if (inode) {


-- 
Thanks,

Steve


More information about the linux-cifs-client mailing list