From 070d93afe63f377539b56ed646b714bb281bd240 Mon Sep 17 00:00:00 2001 From: Sakshi Date: Mon, 22 Jun 2015 15:52:22 +0530 Subject: glusterfsd : newly added brick receives fops only after it is started When new bricks are added in the middle of an on-going fop like 'rm', the volfile changes without waiting for the newly added bricks to get port. Fops are sent to all bricks and may fail on some with ENOTCONN as these bricks may not have a port yet. This patch ensures that the volfile change happens only after all the bricks have a port. Change-Id: I7ed2413475f80d0cc8849fed33036ade8d75a191 BUG: 1233151 Signed-off-by: Sakshi Reviewed-on: http://review.gluster.org/11342 Reviewed-by: Atin Mukherjee Tested-by: Atin Mukherjee --- tests/bugs/fuse/bug-1126048.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/bugs/fuse/bug-1126048.c') diff --git a/tests/bugs/fuse/bug-1126048.c b/tests/bugs/fuse/bug-1126048.c index 60329955258..01c3484172d 100644 --- a/tests/bugs/fuse/bug-1126048.c +++ b/tests/bugs/fuse/bug-1126048.c @@ -17,6 +17,7 @@ main (int argc, char **argv) int ret = 0; int fd = 0; char *cmd = argv[1]; + struct stat stbuf = {0, }; printf ("cmd is: %s\n", cmd); fd = open("a.txt", O_CREAT|O_RDWR, 0644); @@ -30,6 +31,9 @@ main (int argc, char **argv) printf ("Not able to print %s\n", strerror (errno)); system(cmd); sleep(1); /* No way to confirm graph switch so sleep 1 */ + ret = fstat (fd, &stbuf); + if (ret < 0) + printf ("fstat failed %\n", strerror (errno)); ret = fsync(fd); if (ret < 0) printf ("Not able to fsync %s\n", strerror (errno)); -- cgit