CC: [email protected]
TO: David Howells <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git 
afs-fixes
head:   0a2d3be765d4a808eddcda5e3f303e57c19dd61f
commit: 0a2d3be765d4a808eddcda5e3f303e57c19dd61f [6/6] afs: Fix race between 
post-modification dir edit and readdir/d_revalidate
:::::: branch date: 6 hours ago
:::::: commit date: 6 hours ago

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <[email protected]>


cppcheck warnings: (new ones prefixed by >>)

>> fs/afs/dir_silly.c:188:11: warning: The if condition is the same as the 
>> previous if condition [duplicateCondition]
     if (ret == 0) {
             ^
   fs/afs/dir_silly.c:181:11: note: First condition
     if (ret == 0) {
             ^
   fs/afs/dir_silly.c:188:11: note: Second condition
     if (ret == 0) {
             ^
   fs/afs/dir_silly.c:211:6: warning: The scope of the variable 'ret' can be 
reduced. [variableScope]
    int ret;
        ^

# 
https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/commit/?id=0a2d3be765d4a808eddcda5e3f303e57c19dd61f
git remote add dhowells-fs 
https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
git remote update dhowells-fs
git checkout 0a2d3be765d4a808eddcda5e3f303e57c19dd61f
vim +188 fs/afs/dir_silly.c

79ddbfa500b37a David Howells 2019-04-25  141  
79ddbfa500b37a David Howells 2019-04-25  142  /*
79ddbfa500b37a David Howells 2019-04-25  143   * Tell the server to remove a 
sillyrename file.
79ddbfa500b37a David Howells 2019-04-25  144   */
79ddbfa500b37a David Howells 2019-04-25  145  static int 
afs_do_silly_unlink(struct afs_vnode *dvnode, struct afs_vnode *vnode,
79ddbfa500b37a David Howells 2019-04-25  146                           struct 
dentry *dentry, struct key *key)
79ddbfa500b37a David Howells 2019-04-25  147  {
79ddbfa500b37a David Howells 2019-04-25  148    struct afs_fs_cursor fc;
a58823ac458968 David Howells 2019-05-09  149    struct afs_status_cb *scb;
79ddbfa500b37a David Howells 2019-04-25  150    int ret = -ERESTARTSYS;
79ddbfa500b37a David Howells 2019-04-25  151  
79ddbfa500b37a David Howells 2019-04-25  152    _enter("");
79ddbfa500b37a David Howells 2019-04-25  153  
a58823ac458968 David Howells 2019-05-09  154    scb = kcalloc(2, sizeof(struct 
afs_status_cb), GFP_KERNEL);
a58823ac458968 David Howells 2019-05-09  155    if (!scb)
a58823ac458968 David Howells 2019-05-09  156            return -ENOMEM;
a58823ac458968 David Howells 2019-05-09  157  
79ddbfa500b37a David Howells 2019-04-25  158    trace_afs_silly_rename(vnode, 
true);
20b8391fff56f6 David Howells 2019-05-08  159    if 
(afs_begin_vnode_operation(&fc, dvnode, key, false)) {
a58823ac458968 David Howells 2019-05-09  160            afs_dataversion_t 
dir_data_version = dvnode->status.data_version + 1;
a58823ac458968 David Howells 2019-05-09  161  
79ddbfa500b37a David Howells 2019-04-25  162            while 
(afs_select_fileserver(&fc)) {
79ddbfa500b37a David Howells 2019-04-25  163                    fc.cb_break = 
afs_calc_vnode_cb_break(dvnode);
79ddbfa500b37a David Howells 2019-04-25  164  
79ddbfa500b37a David Howells 2019-04-25  165                    if 
(test_bit(AFS_SERVER_FL_IS_YFS, &fc.cbi->server->flags) &&
79ddbfa500b37a David Howells 2019-04-25  166                        
!test_bit(AFS_SERVER_FL_NO_RM2, &fc.cbi->server->flags)) {
79ddbfa500b37a David Howells 2019-04-25  167                            
yfs_fs_remove_file2(&fc, vnode, dentry->d_name.name,
a58823ac458968 David Howells 2019-05-09  168                                    
            &scb[0], &scb[1]);
79ddbfa500b37a David Howells 2019-04-25  169                            if 
(fc.ac.error != -ECONNABORTED ||
79ddbfa500b37a David Howells 2019-04-25  170                                
fc.ac.abort_code != RXGEN_OPCODE)
79ddbfa500b37a David Howells 2019-04-25  171                                    
continue;
79ddbfa500b37a David Howells 2019-04-25  172                            
set_bit(AFS_SERVER_FL_NO_RM2, &fc.cbi->server->flags);
79ddbfa500b37a David Howells 2019-04-25  173                    }
79ddbfa500b37a David Howells 2019-04-25  174  
a58823ac458968 David Howells 2019-05-09  175                    
afs_fs_remove(&fc, vnode, dentry->d_name.name, false, &scb[0]);
79ddbfa500b37a David Howells 2019-04-25  176            }
79ddbfa500b37a David Howells 2019-04-25  177  
a58823ac458968 David Howells 2019-05-09  178            
afs_vnode_commit_status(&fc, dvnode, fc.cb_break,
a58823ac458968 David Howells 2019-05-09  179                                    
&dir_data_version, &scb[0]);
79ddbfa500b37a David Howells 2019-04-25  180            ret = 
afs_end_vnode_operation(&fc);
79ddbfa500b37a David Howells 2019-04-25  181            if (ret == 0) {
79ddbfa500b37a David Howells 2019-04-25  182                    
drop_nlink(&vnode->vfs_inode);
79ddbfa500b37a David Howells 2019-04-25  183                    if 
(vnode->vfs_inode.i_nlink == 0) {
79ddbfa500b37a David Howells 2019-04-25  184                            
set_bit(AFS_VNODE_DELETED, &vnode->flags);
79ddbfa500b37a David Howells 2019-04-25  185                            
clear_bit(AFS_VNODE_CB_PROMISED, &vnode->flags);
79ddbfa500b37a David Howells 2019-04-25  186                    }
79ddbfa500b37a David Howells 2019-04-25  187            }
0a2d3be765d4a8 David Howells 2020-04-10 @188            if (ret == 0) {
0a2d3be765d4a8 David Howells 2020-04-10  189                    
down_write(&dvnode->validate_lock);
0a2d3be765d4a8 David Howells 2020-04-10  190                    if 
(test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags) &&
0a2d3be765d4a8 David Howells 2020-04-10  191                        
dvnode->status.data_version == dir_data_version)
79ddbfa500b37a David Howells 2019-04-25  192                            
afs_edit_dir_remove(dvnode, &dentry->d_name,
79ddbfa500b37a David Howells 2019-04-25  193                                    
            afs_edit_dir_for_unlink);
0a2d3be765d4a8 David Howells 2020-04-10  194                    
up_write(&dvnode->validate_lock);
0a2d3be765d4a8 David Howells 2020-04-10  195            }
79ddbfa500b37a David Howells 2019-04-25  196    }
79ddbfa500b37a David Howells 2019-04-25  197  
a58823ac458968 David Howells 2019-05-09  198    kfree(scb);
79ddbfa500b37a David Howells 2019-04-25  199    _leave(" = %d", ret);
79ddbfa500b37a David Howells 2019-04-25  200    return ret;
79ddbfa500b37a David Howells 2019-04-25  201  }
79ddbfa500b37a David Howells 2019-04-25  202  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to