@@ -820,8 +820,10 @@ cifs_get_file_info(struct file *filp)
820820 void * page = alloc_dentry_path ();
821821 const unsigned char * path ;
822822
823- if (!server -> ops -> query_file_info )
823+ if (!server -> ops -> query_file_info ) {
824+ free_dentry_path (page );
824825 return - ENOSYS ;
826+ }
825827
826828 xid = get_xid ();
827829 rc = server -> ops -> query_file_info (xid , tcon , cfile , & data );
@@ -835,8 +837,8 @@ cifs_get_file_info(struct file *filp)
835837 }
836838 path = build_path_from_dentry (dentry , page );
837839 if (IS_ERR (path )) {
838- free_dentry_path ( page );
839- return PTR_ERR ( path ) ;
840+ rc = PTR_ERR ( path );
841+ goto cgfi_exit ;
840842 }
841843 cifs_open_info_to_fattr (& fattr , & data , inode -> i_sb );
842844 if (fattr .cf_flags & CIFS_FATTR_DELETE_PENDING )
@@ -1009,7 +1011,6 @@ static int reparse_info_to_fattr(struct cifs_open_info_data *data,
10091011 struct kvec rsp_iov , * iov = NULL ;
10101012 int rsp_buftype = CIFS_NO_BUFFER ;
10111013 u32 tag = data -> reparse .tag ;
1012- struct inode * inode = NULL ;
10131014 int rc = 0 ;
10141015
10151016 if (!tag && server -> ops -> query_reparse_point ) {
@@ -1049,12 +1050,8 @@ static int reparse_info_to_fattr(struct cifs_open_info_data *data,
10491050
10501051 if (tcon -> posix_extensions )
10511052 smb311_posix_info_to_fattr (fattr , data , sb );
1052- else {
1053+ else
10531054 cifs_open_info_to_fattr (fattr , data , sb );
1054- inode = cifs_iget (sb , fattr );
1055- if (inode && fattr -> cf_flags & CIFS_FATTR_DELETE_PENDING )
1056- cifs_mark_open_handles_for_deleted_file (inode , full_path );
1057- }
10581055out :
10591056 fattr -> cf_cifstag = data -> reparse .tag ;
10601057 free_rsp_buf (rsp_buftype , rsp_iov .iov_base );
@@ -1109,9 +1106,9 @@ static int cifs_get_fattr(struct cifs_open_info_data *data,
11091106 full_path , fattr );
11101107 } else {
11111108 cifs_open_info_to_fattr (fattr , data , sb );
1112- if (fattr -> cf_flags & CIFS_FATTR_DELETE_PENDING )
1113- cifs_mark_open_handles_for_deleted_file (* inode , full_path );
11141109 }
1110+ if (!rc && fattr -> cf_flags & CIFS_FATTR_DELETE_PENDING )
1111+ cifs_mark_open_handles_for_deleted_file (* inode , full_path );
11151112 break ;
11161113 case - EREMOTE :
11171114 /* DFS link, no metadata available on this server */
@@ -1340,6 +1337,8 @@ int smb311_posix_get_inode_info(struct inode **inode,
13401337 goto out ;
13411338
13421339 rc = update_inode_info (sb , & fattr , inode );
1340+ if (!rc && fattr .cf_flags & CIFS_FATTR_DELETE_PENDING )
1341+ cifs_mark_open_handles_for_deleted_file (* inode , full_path );
13431342out :
13441343 kfree (fattr .cf_symlink_target );
13451344 return rc ;
@@ -1501,6 +1500,9 @@ struct inode *cifs_root_iget(struct super_block *sb)
15011500 goto out ;
15021501 }
15031502
1503+ if (!rc && fattr .cf_flags & CIFS_FATTR_DELETE_PENDING )
1504+ cifs_mark_open_handles_for_deleted_file (inode , path );
1505+
15041506 if (rc && tcon -> pipe ) {
15051507 cifs_dbg (FYI , "ipc connection - fake read inode\n" );
15061508 spin_lock (& inode -> i_lock );
0 commit comments