This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch andyp-removeexit
in repository gfs2-utils.
commit 39d9de94dd3942d6c667e3198895c5c62080b123
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Wed Jan 11 11:30:47 2023 +0000
Add error checking to dir_make_exhash()
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/libgfs2/fs_ops.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index 2798bdde..2a70d4da 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -1243,7 +1243,7 @@ restart:
}
}
-static void dir_make_exhash(struct lgfs2_inode *dip)
+static int dir_make_exhash(struct lgfs2_inode *dip)
{
struct lgfs2_sbd *sdp = dip->i_sbd;
struct gfs2_dirent *dent;
@@ -1256,7 +1256,7 @@ static void dir_make_exhash(struct lgfs2_inode *dip)
__be64 *lp;
if (lgfs2_meta_alloc(dip, &bn))
- exit(1);
+ return -1;
bh = lgfs2_bget(sdp, bn);
{
struct gfs2_meta_header mh = {
@@ -1310,6 +1310,7 @@ static void dir_make_exhash(struct lgfs2_inode *dip)
lgfs2_dinode_out(dip, dip->i_bh->b_data);
lgfs2_bwrite(dip->i_bh);
+ return 0;
}
static int dir_l_add(struct lgfs2_inode *dip, const char *filename, int len,
@@ -1320,7 +1321,9 @@ static int dir_l_add(struct lgfs2_inode *dip, const char *filename,
int len,
int err = 0;
if (dirent_alloc(dip, dip->i_bh, len, &dent)) {
- dir_make_exhash(dip);
+ err = dir_make_exhash(dip);
+ if (err != 0)
+ return err;
err = dir_e_add(dip, filename, len, inum, type);
return err;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by date