@@ -889,11 +889,11 @@ smb2_unlink(const unsigned int xid, struct cifs_tcon *tcon, const char *name,
889889 NULL , NULL , NULL , NULL , NULL );
890890}
891891
892- static int
893- smb2_set_path_attr ( const unsigned int xid , struct cifs_tcon * tcon ,
894- const char * from_name , const char * to_name ,
895- struct cifs_sb_info * cifs_sb , __u32 access , int command ,
896- struct cifsFileInfo * cfile )
892+ static int smb2_set_path_attr ( const unsigned int xid , struct cifs_tcon * tcon ,
893+ const char * from_name , const char * to_name ,
894+ struct cifs_sb_info * cifs_sb ,
895+ __u32 create_options , __u32 access ,
896+ int command , struct cifsFileInfo * cfile )
897897{
898898 struct kvec in_iov ;
899899 __le16 * smb2_to_name = NULL ;
@@ -907,35 +907,43 @@ smb2_set_path_attr(const unsigned int xid, struct cifs_tcon *tcon,
907907 in_iov .iov_base = smb2_to_name ;
908908 in_iov .iov_len = 2 * UniStrnlen ((wchar_t * )smb2_to_name , PATH_MAX );
909909 rc = smb2_compound_op (xid , tcon , cifs_sb , from_name , access ,
910- FILE_OPEN , 0 , ACL_NO_MODE , & in_iov ,
910+ FILE_OPEN , create_options , ACL_NO_MODE , & in_iov ,
911911 & command , 1 , cfile , NULL , NULL , NULL , NULL );
912912smb2_rename_path :
913913 kfree (smb2_to_name );
914914 return rc ;
915915}
916916
917- int
918- smb2_rename_path (const unsigned int xid , struct cifs_tcon * tcon ,
919- const char * from_name , const char * to_name ,
920- struct cifs_sb_info * cifs_sb )
917+ int smb2_rename_path (const unsigned int xid ,
918+ struct cifs_tcon * tcon ,
919+ struct dentry * source_dentry ,
920+ const char * from_name , const char * to_name ,
921+ struct cifs_sb_info * cifs_sb )
921922{
923+ struct cifsInodeInfo * ci ;
922924 struct cifsFileInfo * cfile ;
925+ __u32 co = 0 ;
923926
927+ if (source_dentry ) {
928+ ci = CIFS_I (d_inode (source_dentry ));
929+ if (ci -> cifsAttrs & ATTR_REPARSE )
930+ co |= OPEN_REPARSE_POINT ;
931+ }
924932 drop_cached_dir_by_name (xid , tcon , from_name , cifs_sb );
925933 cifs_get_writable_path (tcon , from_name , FIND_WR_WITH_DELETE , & cfile );
926934
927- return smb2_set_path_attr (xid , tcon , from_name , to_name ,
928- cifs_sb , DELETE , SMB2_OP_RENAME , cfile );
935+ return smb2_set_path_attr (xid , tcon , from_name , to_name , cifs_sb ,
936+ co , DELETE , SMB2_OP_RENAME , cfile );
929937}
930938
931939int
932940smb2_create_hardlink (const unsigned int xid , struct cifs_tcon * tcon ,
933941 const char * from_name , const char * to_name ,
934942 struct cifs_sb_info * cifs_sb )
935943{
936- return smb2_set_path_attr (xid , tcon , from_name , to_name , cifs_sb ,
937- FILE_READ_ATTRIBUTES , SMB2_OP_HARDLINK ,
938- NULL );
944+ return smb2_set_path_attr (xid , tcon , from_name , to_name ,
945+ cifs_sb , 0 , FILE_READ_ATTRIBUTES ,
946+ SMB2_OP_HARDLINK , NULL );
939947}
940948
941949int
0 commit comments