@@ -536,7 +536,7 @@ static int parse_reparse_posix(struct reparse_posix_data *buf,
536536}
537537
538538int smb2_parse_native_symlink (char * * target , const char * buf , unsigned int len ,
539- bool unicode , bool relative ,
539+ bool relative ,
540540 const char * full_path ,
541541 struct cifs_sb_info * cifs_sb )
542542{
@@ -547,26 +547,24 @@ int smb2_parse_native_symlink(char **target, const char *buf, unsigned int len,
547547 int rc ;
548548 int i ;
549549
550- /* Check that length it valid for unicode/non-unicode mode */
551- if (!len || (unicode && ( len % 2 ) )) {
550+ /* Check that length it valid */
551+ if (!len || (len % 2 )) {
552552 cifs_dbg (VFS , "srv returned malformed symlink buffer\n" );
553553 rc = - EIO ;
554554 goto out ;
555555 }
556556
557557 /*
558- * Check that buffer does not contain UTF-16 null codepoint in unicode
559- * mode or null byte in non-unicode mode because Linux cannot process
560- * symlink with null byte.
558+ * Check that buffer does not contain UTF-16 null codepoint
559+ * because Linux cannot process symlink with null byte.
561560 */
562- if ((unicode && UniStrnlen ((wchar_t * )buf , len /2 ) != len /2 ) ||
563- (!unicode && strnlen (buf , len ) != len )) {
561+ if (UniStrnlen ((wchar_t * )buf , len /2 ) != len /2 ) {
564562 cifs_dbg (VFS , "srv returned null byte in native symlink target location\n" );
565563 rc = - EIO ;
566564 goto out ;
567565 }
568566
569- smb_target = cifs_strndup_from_utf16 (buf , len , unicode , cifs_sb -> local_nls );
567+ smb_target = cifs_strndup_from_utf16 (buf , len , true , cifs_sb -> local_nls );
570568 if (!smb_target ) {
571569 rc = - ENOMEM ;
572570 goto out ;
@@ -621,7 +619,7 @@ int smb2_parse_native_symlink(char **target, const char *buf, unsigned int len,
621619}
622620
623621static int parse_reparse_symlink (struct reparse_symlink_data_buffer * sym ,
624- u32 plen , bool unicode ,
622+ u32 plen ,
625623 struct cifs_sb_info * cifs_sb ,
626624 const char * full_path ,
627625 struct cifs_open_info_data * data )
@@ -641,7 +639,6 @@ static int parse_reparse_symlink(struct reparse_symlink_data_buffer *sym,
641639 return smb2_parse_native_symlink (& data -> symlink_target ,
642640 sym -> PathBuffer + offs ,
643641 len ,
644- unicode ,
645642 le32_to_cpu (sym -> Flags ) & SYMLINK_FLAG_RELATIVE ,
646643 full_path ,
647644 cifs_sb );
@@ -696,7 +693,7 @@ static int parse_reparse_wsl_symlink(struct reparse_wsl_symlink_data_buffer *buf
696693int parse_reparse_point (struct reparse_data_buffer * buf ,
697694 u32 plen , struct cifs_sb_info * cifs_sb ,
698695 const char * full_path ,
699- bool unicode , struct cifs_open_info_data * data )
696+ struct cifs_open_info_data * data )
700697{
701698 struct cifs_tcon * tcon = cifs_sb_master_tcon (cifs_sb );
702699
@@ -710,7 +707,7 @@ int parse_reparse_point(struct reparse_data_buffer *buf,
710707 case IO_REPARSE_TAG_SYMLINK :
711708 return parse_reparse_symlink (
712709 (struct reparse_symlink_data_buffer * )buf ,
713- plen , unicode , cifs_sb , full_path , data );
710+ plen , cifs_sb , full_path , data );
714711 case IO_REPARSE_TAG_LX_SYMLINK :
715712 return parse_reparse_wsl_symlink (
716713 (struct reparse_wsl_symlink_data_buffer * )buf ,
@@ -744,7 +741,7 @@ int smb2_parse_reparse_point(struct cifs_sb_info *cifs_sb,
744741
745742 buf = (struct reparse_data_buffer * )((u8 * )io +
746743 le32_to_cpu (io -> OutputOffset ));
747- return parse_reparse_point (buf , plen , cifs_sb , full_path , true, data );
744+ return parse_reparse_point (buf , plen , cifs_sb , full_path , data );
748745}
749746
750747static bool wsl_to_fattr (struct cifs_open_info_data * data ,
0 commit comments