diff options
author | Paulo Alcantara <pc@manguebit.com> | 2023-11-25 23:55:06 -0300 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2024-01-07 15:46:06 -0600 |
commit | 7435d51b7ea2ab7801279c43ecd72063e9d5c92f (patch) | |
tree | 464f91149925132f710835da6b20aaadb48db0a1 /fs/smb/client/cifsglob.h | |
parent | 67ec9949b0dfe78c99e110dd975eb7dc5645630c (diff) | |
download | lwn-7435d51b7ea2ab7801279c43ecd72063e9d5c92f.tar.gz lwn-7435d51b7ea2ab7801279c43ecd72063e9d5c92f.zip |
smb: client: fix renaming of reparse points
The client was sending an SMB2_CREATE request without setting
OPEN_REPARSE_POINT flag thus failing the entire rename operation.
Fix this by setting OPEN_REPARSE_POINT in create options for
SMB2_CREATE request when the source inode is a repase point.
Signed-off-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/smb/client/cifsglob.h')
-rw-r--r-- | fs/smb/client/cifsglob.h | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/fs/smb/client/cifsglob.h b/fs/smb/client/cifsglob.h index 541e8b88b4c1..ad5cf3e31d73 100644 --- a/fs/smb/client/cifsglob.h +++ b/fs/smb/client/cifsglob.h @@ -210,9 +210,18 @@ struct cifs_open_info_data { }; }; -#define cifs_open_data_reparse(d) \ - ((d)->reparse_point || \ - (le32_to_cpu((d)->fi.Attributes) & ATTR_REPARSE)) +static inline bool cifs_open_data_reparse(struct cifs_open_info_data *data) +{ + struct smb2_file_all_info *fi = &data->fi; + u32 attrs = le32_to_cpu(fi->Attributes); + bool ret; + + ret = data->reparse_point || (attrs & ATTR_REPARSE); + if (ret) + attrs |= ATTR_REPARSE; + fi->Attributes = cpu_to_le32(attrs); + return ret; +} /* ***************************************************************** @@ -390,8 +399,11 @@ struct smb_version_operations { int (*rename_pending_delete)(const char *, struct dentry *, const unsigned int); /* send rename request */ - int (*rename)(const unsigned int, struct cifs_tcon *, const char *, - const char *, struct cifs_sb_info *); + int (*rename)(const unsigned int xid, + struct cifs_tcon *tcon, + struct dentry *source_dentry, + const char *from_name, const char *to_name, + struct cifs_sb_info *cifs_sb); /* send create hardlink request */ int (*create_hardlink)(const unsigned int, struct cifs_tcon *, const char *, const char *, |