Guozhonghua
2017-Nov-15 12:02 UTC
[Ocfs2-devel] [PATCH] ocfs2: The goto is not useful in the function ocfs2_reserve_cluster_bitmap_bits, so remove it.
The goto is not useful anymore, removed from the context. Signed-off-by: guozhonghua <guozhonghua at h3c.com> --- fs/ocfs2/suballoc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c index 71f22c8..9f0b95a 100644 --- a/fs/ocfs2/suballoc.c +++ b/fs/ocfs2/suballoc.c @@ -1147,12 +1147,9 @@ int ocfs2_reserve_cluster_bitmap_bits(struct ocfs2_super *osb, GLOBAL_BITMAP_SYSTEM_INODE, OCFS2_INVALID_SLOT, NULL, ALLOC_NEW_GROUP); - if (status < 0 && status != -ENOSPC) { + if (status < 0 && status != -ENOSPC) mlog_errno(status); - goto bail; - } -bail: return status; } -- 1.7.9.5
Changwei Ge
2017-Nov-16 00:42 UTC
[Ocfs2-devel] [PATCH] ocfs2: The goto is not useful in the function ocfs2_reserve_cluster_bitmap_bits, so remove it.
Hi Zhonghua, On 2017/11/15 20:04, Guozhonghua wrote:> The goto is not useful anymore, removed from the context.Perhaps we can make this change-log more clear like: The bail declare is not necessary any more, so trim it. If code path falls into error branch, ocfs2_reserve_cluster_bitmap_bits will return in next following step, too. And this title can be changed into 'ocfs2: clean up unnecessary bail declare' I suppose after that this patch will be neater. Can you resend this patch? Moreover, I think we should also CC this patch to OCFS2 maintainers. Thanks, Changwei> > Signed-off-by: guozhonghua <guozhonghua at h3c.com> > --- > fs/ocfs2/suballoc.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c > index 71f22c8..9f0b95a 100644 > --- a/fs/ocfs2/suballoc.c > +++ b/fs/ocfs2/suballoc.c > @@ -1147,12 +1147,9 @@ int ocfs2_reserve_cluster_bitmap_bits(struct ocfs2_super *osb, > GLOBAL_BITMAP_SYSTEM_INODE, > OCFS2_INVALID_SLOT, NULL, > ALLOC_NEW_GROUP); > - if (status < 0 && status != -ENOSPC) { > + if (status < 0 && status != -ENOSPC) > mlog_errno(status); > - goto bail; > - } > > -bail: > return status; > } > >