diff for duplicates of <11821784801162-git-send-email-swhiteho@redhat.com> diff --git a/a/1.txt b/N1/1.txt index 012d828..b31b5b6 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -1,24 +1 @@ - -Fix two races in fs/dlm/config.c: - -(1) Grab the configfs subsystem semaphore before calling -config_group_find_obj() in get_space(). This solves a potential race -between get_space() and concurrent mkdir(2) or rmdir(2). - -(2) Grab a reference on the found config_item _while_ holding the configfs -subsystem semaphore in get_comm(), and not after it. This solves a -potential race between get_comm() and concurrent rmdir(2). - -Signed-off-by: Satyam Sharma <ssatyam@cse.iitk.ac.in> -Signed-off-by: David Teigland <teigland@redhat.com> -Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> ---- - fs/dlm/config.c | 15 +++++++++++---- - 1 files changed, 11 insertions(+), 4 deletions(-) --------------- next part -------------- -A non-text attachment was scrubbed... -Name: 1f692e48dd1f3fa00629c69b2e34ab35c9929b45.diff -Type: text/x-patch -Size: 1066 bytes -Desc: not available -URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20070618/badca0be/attachment.bin> +This is a multi-part message in MIME format. diff --git a/N1/2.hdr b/N1/2.hdr new file mode 100644 index 0000000..5f63a06 --- /dev/null +++ b/N1/2.hdr @@ -0,0 +1,2 @@ +Content-Type: text/plain; charset=UTF-8; format=fixed +Content-Transfer-Encoding: 8bit diff --git a/N1/2.txt b/N1/2.txt new file mode 100644 index 0000000..2662828 --- /dev/null +++ b/N1/2.txt @@ -0,0 +1,17 @@ + +Fix two races in fs/dlm/config.c: + +(1) Grab the configfs subsystem semaphore before calling +config_group_find_obj() in get_space(). This solves a potential race +between get_space() and concurrent mkdir(2) or rmdir(2). + +(2) Grab a reference on the found config_item _while_ holding the configfs +subsystem semaphore in get_comm(), and not after it. This solves a +potential race between get_comm() and concurrent rmdir(2). + +Signed-off-by: Satyam Sharma <ssatyam@cse.iitk.ac.in> +Signed-off-by: David Teigland <teigland@redhat.com> +Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> +--- + fs/dlm/config.c | 15 +++++++++++---- + 1 files changed, 11 insertions(+), 4 deletions(-) diff --git a/N1/3.hdr b/N1/3.hdr new file mode 100644 index 0000000..3f4ff6d --- /dev/null +++ b/N1/3.hdr @@ -0,0 +1,3 @@ +Content-Type: text/x-patch; name="1f692e48dd1f3fa00629c69b2e34ab35c9929b45.diff" +Content-Transfer-Encoding: 8bit +Content-Disposition: inline; filename="1f692e48dd1f3fa00629c69b2e34ab35c9929b45.diff" diff --git a/N1/3.txt b/N1/3.txt new file mode 100644 index 0000000..2608522 --- /dev/null +++ b/N1/3.txt @@ -0,0 +1,46 @@ +diff --git a/fs/dlm/config.c b/fs/dlm/config.c +index 822abdc..5a3d390 100644 +--- a/fs/dlm/config.c ++++ b/fs/dlm/config.c +@@ -748,9 +748,16 @@ static ssize_t node_weight_write(struct node *nd, const char *buf, size_t len) + + static struct space *get_space(char *name) + { ++ struct config_item *i; ++ + if (!space_list) + return NULL; +- return to_space(config_group_find_obj(space_list, name)); ++ ++ down(&space_list->cg_subsys->su_sem); ++ i = config_group_find_obj(space_list, name); ++ up(&space_list->cg_subsys->su_sem); ++ ++ return to_space(i); + } + + static void put_space(struct space *sp) +@@ -776,20 +783,20 @@ static struct comm *get_comm(int nodeid, struct sockaddr_storage *addr) + if (cm->nodeid != nodeid) + continue; + found = 1; ++ config_item_get(i); + break; + } else { + if (!cm->addr_count || + memcmp(cm->addr[0], addr, sizeof(*addr))) + continue; + found = 1; ++ config_item_get(i); + break; + } + } + up(&clusters_root.subsys.su_sem); + +- if (found) +- config_item_get(i); +- else ++ if (!found) + cm = NULL; + return cm; + } diff --git a/a/content_digest b/N1/content_digest index f7b8ef5..016267c 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,10 +1,17 @@ "ref\011821784703600-git-send-email-swhiteho@redhat.com\0" "ref\01182178478593-git-send-email-swhiteho@redhat.com\0" "From\0Steven Whitehouse <swhiteho@redhat.com>\0" - "Subject\0[Cluster-devel] [PATCH 2/4] [DLM] fix a couple of races\0" + "Subject\0[PATCH 2/4] [DLM] fix a couple of races\0" "Date\0Mon, 18 Jun 2007 15:54:28 +0100\0" - "To\0cluster-devel.redhat.com\0" - "\00:1\0" + "To\0cluster-devel@redhat.com" + " linux-kernel@vger.kernel.org\0" + "Cc\0Satyam Sharma <ssatyam@cse.iitk.ac.in>" + David Teigland <teigland@redhat.com> + " Steven Whitehouse <swhiteho@redhat.com>\0" + "\01:1\0" + "b\0" + This is a multi-part message in MIME format. + "\01:2\0" "b\0" "\n" "Fix two races in fs/dlm/config.c:\n" @@ -22,13 +29,55 @@ "Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>\n" "---\n" " fs/dlm/config.c | 15 +++++++++++----\n" - " 1 files changed, 11 insertions(+), 4 deletions(-)\n" - "-------------- next part --------------\n" - "A non-text attachment was scrubbed...\n" - "Name: 1f692e48dd1f3fa00629c69b2e34ab35c9929b45.diff\n" - "Type: text/x-patch\n" - "Size: 1066 bytes\n" - "Desc: not available\n" - URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20070618/badca0be/attachment.bin> + 1 files changed, 11 insertions(+), 4 deletions(-) + "\01:3\0" + "fn\01f692e48dd1f3fa00629c69b2e34ab35c9929b45.diff\0" + "b\0" + "diff --git a/fs/dlm/config.c b/fs/dlm/config.c\n" + "index 822abdc..5a3d390 100644\n" + "--- a/fs/dlm/config.c\n" + "+++ b/fs/dlm/config.c\n" + "@@ -748,9 +748,16 @@ static ssize_t node_weight_write(struct node *nd, const char *buf, size_t len)\n" + " \n" + " static struct space *get_space(char *name)\n" + " {\n" + "+\tstruct config_item *i;\n" + "+\n" + " \tif (!space_list)\n" + " \t\treturn NULL;\n" + "-\treturn to_space(config_group_find_obj(space_list, name));\n" + "+\n" + "+\tdown(&space_list->cg_subsys->su_sem);\n" + "+\ti = config_group_find_obj(space_list, name);\n" + "+\tup(&space_list->cg_subsys->su_sem);\n" + "+\n" + "+\treturn to_space(i);\n" + " }\n" + " \n" + " static void put_space(struct space *sp)\n" + "@@ -776,20 +783,20 @@ static struct comm *get_comm(int nodeid, struct sockaddr_storage *addr)\n" + " \t\t\tif (cm->nodeid != nodeid)\n" + " \t\t\t\tcontinue;\n" + " \t\t\tfound = 1;\n" + "+\t\t\tconfig_item_get(i);\n" + " \t\t\tbreak;\n" + " \t\t} else {\n" + " \t\t\tif (!cm->addr_count ||\n" + " \t\t\t memcmp(cm->addr[0], addr, sizeof(*addr)))\n" + " \t\t\t\tcontinue;\n" + " \t\t\tfound = 1;\n" + "+\t\t\tconfig_item_get(i);\n" + " \t\t\tbreak;\n" + " \t\t}\n" + " \t}\n" + " \tup(&clusters_root.subsys.su_sem);\n" + " \n" + "-\tif (found)\n" + "-\t\tconfig_item_get(i);\n" + "-\telse\n" + "+\tif (!found)\n" + " \t\tcm = NULL;\n" + " \treturn cm;\n" + } -2966ff94ea7d2097447ea273ceb2869921b2485c67314cfe91a364e0ea276170 +8a26922afee482f70ac8ac20acbb7eb4e1a7f1a77620b9ecc6d91487557e4a67
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.