diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2017-04-12 09:30:57 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2017-04-12 09:30:57 +1000 |
commit | 8f76001ca8330e55b0a18c51a5657b97e7f6e0e1 (patch) | |
tree | ad48a2f1a28e05c54cb99188a8883f6a5385ca46 | |
parent | 7a7ac1d05a9cf197aa8f7fcff9d755db0ced165e (diff) |
ocfs2-old-mle-put-and-release-after-the-function-dlm_add_migration_mle-called-fix
fix coding style, comments
Cc: Guozhonghua <guozhonghua@h3c.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Joseph Qi <jiangqi903@gmail.com>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Mark Fasheh <mfasheh@versity.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r-- | fs/ocfs2/dlm/dlmmaster.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c index 4438671c4ac3..f0072145eead 100644 --- a/fs/ocfs2/dlm/dlmmaster.c +++ b/fs/ocfs2/dlm/dlmmaster.c @@ -2613,7 +2613,7 @@ static int dlm_migrate_lockres(struct dlm_ctxt *dlm, ret = dlm_add_migration_mle(dlm, res, mle, &oldmle, name, namelen, target, dlm->node_num); if (ret == -EEXIST) { - if(oldmle) + if (oldmle) __dlm_put_mle(oldmle); spin_unlock(&dlm->master_lock); @@ -2622,10 +2622,11 @@ static int dlm_migrate_lockres(struct dlm_ctxt *dlm, goto fail; } - /* If an old one mle found, it should be put. if its type is BLOCK, - * it should be put again. Because it had been unhasded from the map + /* + * If an old mle is found, it should be put. If its type is BLOCK, + * it should be put again. Because it has been unhasded from the map * in the function dlm_add_migration_mle. - * otherwise the memory will be leaked. It will not found it again from + * Otherwise the memory will be leaked. It will not be found again from * the hash map. */ if (oldmle) { @@ -2633,9 +2634,11 @@ static int dlm_migrate_lockres(struct dlm_ctxt *dlm, __dlm_mle_detach_hb_events(dlm, oldmle); __dlm_put_mle(oldmle); - /* if the type of the mle is BLOCK, should put it once for release. - * otherwise memory leak may be caused because oldmle had been unhashed - * from the hash map, it will not be found anymore. + /* + * If the type of the mle is BLOCK, it should be put once for + * release. Otherwise a memory leak may be caused because + * oldmle has been unhashed from the hash map and it will not + * be found any more. */ if (oldmle->type == DLM_MLE_BLOCK) __dlm_put_mle(oldmle); @@ -3201,10 +3204,11 @@ int dlm_migrate_request_handler(struct o2net_msg *msg, u32 len, void *data, if (ret < 0) kmem_cache_free(dlm_mle_cache, mle); - /* If an old one mle found, it should be put. if its type is BLOCK, - * it should be put again. Because it had been unhasded from the map - * in the function dlm_add_migration_mle. - * otherwise the memory will be leaked. It will not found it again from + /* + * If an old mle is found, it should be put. If its type is BLOCK, + * it should be put again because it has been unhashed from the map + * in the dlm_add_migration_mle(). + * Otherwise the memory will be leaked. It will not be found again from * the hash map. */ if (oldmle) { |