* [PATCH] ocfs2: Cocci spatch "memdup.spatch"
@ 2013-06-01 9:41 Thomas Meyer
2013-06-10 2:46 ` Joel Becker
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Meyer @ 2013-06-01 9:41 UTC (permalink / raw)
To: linux-kernel
Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---
diff -u -p a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c
--- a/fs/ocfs2/localalloc.c
+++ b/fs/ocfs2/localalloc.c
@@ -434,12 +434,11 @@ void ocfs2_shutdown_local_alloc(struct o
bh = osb->local_alloc_bh;
alloc = (struct ocfs2_dinode *) bh->b_data;
- alloc_copy = kmalloc(bh->b_size, GFP_NOFS);
+ alloc_copy = kmemdup(alloc, bh->b_size, GFP_NOFS);
if (!alloc_copy) {
status = -ENOMEM;
goto out_commit;
}
- memcpy(alloc_copy, alloc, bh->b_size);
status = ocfs2_journal_access_di(handle, INODE_CACHE(local_alloc_inode),
bh, OCFS2_JOURNAL_ACCESS_WRITE);
@@ -1244,13 +1243,12 @@ static int ocfs2_local_alloc_slide_windo
* local alloc shutdown won't try to double free main bitmap
* bits. Make a copy so the sync function knows which bits to
* free. */
- alloc_copy = kmalloc(osb->local_alloc_bh->b_size, GFP_NOFS);
+ alloc_copy = kmemdup(alloc, osb->local_alloc_bh->b_size, GFP_NOFS);
if (!alloc_copy) {
status = -ENOMEM;
mlog_errno(status);
goto bail;
}
- memcpy(alloc_copy, alloc, osb->local_alloc_bh->b_size);
status = ocfs2_journal_access_di(handle,
INODE_CACHE(local_alloc_inode),
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ocfs2: Cocci spatch "memdup.spatch"
2013-06-01 9:41 [PATCH] ocfs2: Cocci spatch "memdup.spatch" Thomas Meyer
@ 2013-06-10 2:46 ` Joel Becker
0 siblings, 0 replies; 2+ messages in thread
From: Joel Becker @ 2013-06-10 2:46 UTC (permalink / raw)
To: Thomas Meyer; +Cc: linux-kernel
Acked-by: Joel Becker <jlbec@evilplan.org>
On Sat, Jun 01, 2013 at 11:41:12AM +0200, Thomas Meyer wrote:
>
> Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
> ---
>
> diff -u -p a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c
> --- a/fs/ocfs2/localalloc.c
> +++ b/fs/ocfs2/localalloc.c
> @@ -434,12 +434,11 @@ void ocfs2_shutdown_local_alloc(struct o
> bh = osb->local_alloc_bh;
> alloc = (struct ocfs2_dinode *) bh->b_data;
>
> - alloc_copy = kmalloc(bh->b_size, GFP_NOFS);
> + alloc_copy = kmemdup(alloc, bh->b_size, GFP_NOFS);
> if (!alloc_copy) {
> status = -ENOMEM;
> goto out_commit;
> }
> - memcpy(alloc_copy, alloc, bh->b_size);
>
> status = ocfs2_journal_access_di(handle, INODE_CACHE(local_alloc_inode),
> bh, OCFS2_JOURNAL_ACCESS_WRITE);
> @@ -1244,13 +1243,12 @@ static int ocfs2_local_alloc_slide_windo
> * local alloc shutdown won't try to double free main bitmap
> * bits. Make a copy so the sync function knows which bits to
> * free. */
> - alloc_copy = kmalloc(osb->local_alloc_bh->b_size, GFP_NOFS);
> + alloc_copy = kmemdup(alloc, osb->local_alloc_bh->b_size, GFP_NOFS);
> if (!alloc_copy) {
> status = -ENOMEM;
> mlog_errno(status);
> goto bail;
> }
> - memcpy(alloc_copy, alloc, osb->local_alloc_bh->b_size);
>
> status = ocfs2_journal_access_di(handle,
> INODE_CACHE(local_alloc_inode),
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-06-10 2:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-01 9:41 [PATCH] ocfs2: Cocci spatch "memdup.spatch" Thomas Meyer
2013-06-10 2:46 ` Joel Becker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox