Skip to contentSkip to conversation

staging: lustre: create striped directory

lustre-devel Dan Carpenter 2 participants 3 messages Oct 11, 2016 – Oct 13, 2016 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Hello wang di,

The patch 2de353860782: "staging: lustre: create striped directory" from Aug 16, 2016, leads to the following static checker warning:

drivers/staging/lustre/lustre/llite/namei.c:294 ll_md_blocking_ast()
warn: 'master_inode' isn't an ERR_PTR

drivers/staging/lustre/lustre/llite/namei.c
287
288 hash = cl_fid_build_ino(&lli->lli_pfid,
289 ll_need_32bit_api(ll_i2sbi(inode)));
290
291 master_inode = ilookup5(inode->i_sb, hash,
292 ll_test_inode_by_fid,
293 (void *)&lli->lli_pfid);

   294                                  if (master_inode && !IS_ERR(master_inode)) {
                                                             ^^^^^^^^^^^^^^^^^^^^

ilookup5() never returns ERR_PTRs.

   295                                          ll_invalidate_negative_children(master_inode);
   296                                          iput(master_inode);
   297                                  }

regards,
dan carpenter

#2 lore raw
In reply to a message not in the archive
Quoted 28 lines · Di

Hello,

Quoted 24 lines · Dan Carpenter

Hello wang di,

The patch 2de353860782: "staging: lustre: create striped directory" from Aug 16, 2016, leads to the following static checker warning:

drivers/staging/lustre/lustre/llite/namei.c:294 ll_md_blocking_ast()
warn: 'master_inode' isn't an ERR_PTR

drivers/staging/lustre/lustre/llite/namei.c
287
288 hash =
cl_fid_build_ino(&lli->lli_pfid,
289
ll_need_32bit_api(ll_i2sbi(inode)));
290
291 master_inode =
ilookup5(inode->i_sb, hash,
292
ll_test_inode_by_fid,
293 (void
*)&lli->lli_pfid);
294 if (master_inode &&
!IS_ERR(master_inode)) {

Quoted 4 lines
Quoted 2 lines

^^^^^^^^^^^^^^^^^^^^
ilookup5() never returns ERR_PTRs.

Yes, only master_inode != NULL should be enough here.

Please send a patch to remove the other check?

regards,
dan carpenter

#3 lore raw
Quoted 30 lines · Di
Quoted 28 lines

Hello,

Quoted 24 lines · Dan Carpenter

Hello wang di,

The patch 2de353860782: "staging: lustre: create striped directory" from Aug 16, 2016, leads to the following static checker warning:

drivers/staging/lustre/lustre/llite/namei.c:294 ll_md_blocking_ast()
warn: 'master_inode' isn't an ERR_PTR

drivers/staging/lustre/lustre/llite/namei.c
287
288 hash =
cl_fid_build_ino(&lli->lli_pfid,
289
ll_need_32bit_api(ll_i2sbi(inode)));
290
291 master_inode =
ilookup5(inode->i_sb, hash,
292
ll_test_inode_by_fid,
293 (void
*)&lli->lli_pfid);
294 if (master_inode &&
!IS_ERR(master_inode)) {

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

^^^^^^^^^^^^^^^^^^^^
ilookup5() never returns ERR_PTRs.

Yes, only master_inode != NULL should be enough here.

Please send a patch to remove the other check?

A patch is being reviewed and validated with our test harness. Its coming :-)