Skip to contentSkip to conversation

ext4: call out CRC and corruption errors with specific error codes

DISCUSSION Dan Carpenter 1 participant 2 messages May 17, 2016

lore
Share & tools
lore
#0 lore raw

Hello Darrick J. Wong,

The patch 6a797d273783: "ext4: call out CRC and corruption errors with specific error codes" from Oct 17, 2015, leads to the following static checker warning:

	fs/ext4/xattr.c:854 ext4_xattr_block_set()
	warn: error is never (-117)

fs/ext4/xattr.c
837 /*

   838                           * This must happen under buffer lock for
   839                           * ext4_xattr_block_set() to reliably detect modified
   840                           * block
   841                           */
   842                          mb_cache_entry_delete_block(ext4_mb_cache, hash,
   843                                                      bs->bh->b_blocknr);
   844                          ea_bdebug(bs->bh, "modifying in-place");
   845                          error = ext4_xattr_set_entry(i, s);
   846                          if (!error) {
   847                                  if (!IS_LAST_ENTRY(s->first))
   848                                          ext4_xattr_rehash(header(s->base),
   849                                                            s->here);
   850                                  ext4_xattr_cache_insert(ext4_mb_cache,
   851                                          bs->bh);
   852                          }
   853                          unlock_buffer(bs->bh);
   854                          if (error == -EFSCORRUPTED)

We changed this from -EIO to -EFSCORRUPTED but actually ext4_xattr_set_entry() doesn't return either of those.

855 goto bad_block;
856 if (!error)
857 error = ext4_handle_dirty_xattr_block(handle,
858 inode,
859 bs->bh);
860 if (error)
861 goto cleanup;
862 goto inserted;
863 } else {

regards,
dan carpenter

#1 lore raw

There is another one a few lines later as well.

fs/ext4/xattr.c:894 ext4_xattr_block_set() warn: error is never (-117)

regards,
dan carpenter