You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.5 KiB

  1. From 97071360caa6868c21a161047ed471790c405efb Mon Sep 17 00:00:00 2001
  2. From: Chris Leech <cleech@redhat.com>
  3. Date: Tue, 13 Aug 2013 10:59:44 -0700
  4. Subject: [PATCH] idmb_rec_write, check for tpgt first
  5. Factor out the check for a tpgt to a single place, before going crazy on
  6. the rec files. Makes flow of this function easier to follow, and preps
  7. for splitting it up.
  8. ---
  9. usr/idbm.c | 18 +++++-------------
  10. 1 file changed, 5 insertions(+), 13 deletions(-)
  11. --- a/usr/idbm.c
  12. +++ b/usr/idbm.c
  13. @@ -2178,6 +2178,10 @@ static int idbm_rec_write(node_rec_t *re
  14. goto free_portal;
  15. }
  16. + if (rec->tpgt == PORTAL_GROUP_TAG_UNKNOWN)
  17. + /* drop down to old style portal as config */
  18. + goto open_conf;
  19. +
  20. rc = stat(portal, &statb);
  21. if (rc) {
  22. rc = 0;
  23. @@ -2186,23 +2190,11 @@ static int idbm_rec_write(node_rec_t *re
  24. * set the tgpt. In new versions you must pass all the info in
  25. * from the start
  26. */
  27. - if (rec->tpgt == PORTAL_GROUP_TAG_UNKNOWN)
  28. - /* drop down to old style portal as config */
  29. - goto open_conf;
  30. - else
  31. - goto mkdir_portal;
  32. + goto mkdir_portal;
  33. }
  34. if (!S_ISDIR(statb.st_mode)) {
  35. /*
  36. - * older iscsiadm versions had you create the config then set
  37. - * set the tgpt. In new versions you must pass all the info in
  38. - * from the start
  39. - */
  40. - if (rec->tpgt == PORTAL_GROUP_TAG_UNKNOWN)
  41. - /* drop down to old style portal as config */
  42. - goto open_conf;
  43. - /*
  44. * Old style portal as a file, but with tpgt. Let's update it.
  45. */
  46. if (unlink(portal)) {