[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/6] libdiskfs: fix error handling
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 2/6] libdiskfs: fix error handling |
Date: |
Sat, 16 Nov 2013 11:19:24 +0100 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
Justus Winter, le Sat 16 Nov 2013 10:58:15 +0100, a écrit :
> Found using the Clang Static Analyzer.
>
> * libdiskfs/dir-renamed.c (diskfs_rename_dir): Fix error handling.
Ack!
It was really bad, AIUI it meant creating 32000 directories in the same
parent leads to leaked locked mutexes.
> ---
> libdiskfs/dir-renamed.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libdiskfs/dir-renamed.c b/libdiskfs/dir-renamed.c
> index d73dc28..9b7ec3a 100644
> --- a/libdiskfs/dir-renamed.c
> +++ b/libdiskfs/dir-renamed.c
> @@ -132,7 +132,7 @@ diskfs_rename_dir (struct node *fdp, struct node *fnp,
> const char *fromname,
> if (tdp->dn_stat.st_nlink == diskfs_link_max - 1)
> {
> err = EMLINK;
> - return EMLINK;
> + goto out;
> }
> tdp->dn_stat.st_nlink++;
> tdp->dn_set_ctime = 1;
> --
> 1.7.10.4
>
--
Samuel
if (argc > 1 && strcmp(argv[1], "-advice") == 0) {
printf("Don't Panic!\n");
exit(42);
}
-- Arnold Robbins in the LJ of February '95, describing RCS
- Clang Static Analyzer reports & more fixes for the Hurd, Justus Winter, 2013/11/16
- [PATCH 1/6] libdiskfs: remove dead assignment, Justus Winter, 2013/11/16
- [PATCH 2/6] libdiskfs: fix error handling, Justus Winter, 2013/11/16
- Re: [PATCH 2/6] libdiskfs: fix error handling,
Samuel Thibault <=
- [PATCH 4/6] libshouldbeinlibc: fix dead assignment, Justus Winter, 2013/11/16
- [PATCH 3/6] ext2fs: fix error handling, Justus Winter, 2013/11/16
- [PATCH 6/6] mach-defpager: do not remove -Wall from CFLAGS, Justus Winter, 2013/11/16
- [PATCH 5/6] mach-defpager: fix the page offsets returned by pager_pages, Justus Winter, 2013/11/16
- Re: Clang Static Analyzer reports & more fixes for the Hurd, Samuel Thibault, 2013/11/16
- Re: Clang Static Analyzer reports & more fixes for the Hurd, Samuel Thibault, 2013/11/16