linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* re: btrfs: enhance transaction abort infrastructure
@ 2012-04-02  9:08 Dan Carpenter
  2012-04-02 10:46 ` David Sterba
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2012-04-02  9:08 UTC (permalink / raw)
  To: jeffm; +Cc: linux-btrfs

Hi Jeff,

The patch 49b25e054090: "btrfs: enhance transaction abort 
infrastructure" from Mar 1, 2012, leads to the following warning:
fs/btrfs/transaction.c:137 join_transaction()
	warn: inconsistent returns spin_lock:&root->fs_info->trans_lock:
	locked (77) unlocked  (64,70,82,88,137)

fs/btrfs/transaction.c
    74          cur_trans = root->fs_info->running_transaction;
    75          if (cur_trans) {
    76                  if (cur_trans->aborted)
    77                          return cur_trans->aborted;
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^
Should we do a spin_unlock(&root->fs_info->trans_lock); here before
returning?

    78                  atomic_inc(&cur_trans->use_count);
    79                  atomic_inc(&cur_trans->num_writers);
    80                  cur_trans->num_joined++;
    81                  spin_unlock(&root->fs_info->trans_lock);
    82                  return 0;
    83          }
    84          spin_unlock(&root->fs_info->trans_lock);

Also later on:

  1399          ret = commit_fs_roots(trans, root);
  1400          if (ret) {
  1401                  mutex_unlock(&root->fs_info->tree_log_mutex);
  1402                  goto cleanup_transaction;
                        ^^^^^^^^^^^^^^^^^^^^^^^^^
  1403          }
  1404  
  1405          /* commit_fs_roots gets rid of all the tree log roots, it is now
  1406           * safe to free the root of tree log roots
  1407           */
  1408          btrfs_free_log_root_tree(trans, root->fs_info);
  1409  
  1410          ret = commit_cowonly_roots(trans, root);
  1411          if (ret) {
  1412                  mutex_unlock(&root->fs_info->tree_log_mutex);
  1413                  goto cleanup_transaction;
                        ^^^^^^^^^^^^^^^^^^^^^^^^^

Should we do an mutex_unlock(&root->fs_info->reloc_mutex); before these
two gotos?

  1414          }

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-02 12:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-02  9:08 btrfs: enhance transaction abort infrastructure Dan Carpenter
2012-04-02 10:46 ` David Sterba
2012-04-02 12:48   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).