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.

54 lines
1.6 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. diff --git a/usr/idbm.c b/usr/idbm.c
  12. index be4d4e3..a7da540 100644
  13. --- a/usr/idbm.c
  14. +++ b/usr/idbm.c
  15. @@ -2078,6 +2078,10 @@ static int idbm_rec_write(node_rec_t *rec, bool disable_lock)
  16. goto free_portal;
  17. }
  18. + if (rec->tpgt == PORTAL_GROUP_TAG_UNKNOWN)
  19. + /* drop down to old style portal as config */
  20. + goto open_conf;
  21. +
  22. rc = stat(portal, &statb);
  23. if (rc) {
  24. rc = 0;
  25. @@ -2086,22 +2090,10 @@ static int idbm_rec_write(node_rec_t *rec, bool disable_lock)
  26. * set the tgpt. In new versions you must pass all the info in
  27. * from the start
  28. */
  29. - if (rec->tpgt == PORTAL_GROUP_TAG_UNKNOWN)
  30. - /* drop down to old style portal as config */
  31. - goto open_conf;
  32. - else
  33. - goto mkdir_portal;
  34. + goto mkdir_portal;
  35. }
  36. if (!S_ISDIR(statb.st_mode)) {
  37. - /*
  38. - * older iscsiadm versions had you create the config then set
  39. - * set the tgpt. In new versions you must pass all the info in
  40. - * from the start
  41. - */
  42. - if (rec->tpgt == PORTAL_GROUP_TAG_UNKNOWN)
  43. - /* drop down to old style portal as config */
  44. - goto open_conf;
  45. /*
  46. * Old style portal as a file, but with tpgt. Let's update it.
  47. */
  48. --
  49. 2.21.0