Giter VIP home page Giter VIP logo

Comments (6)

doug-gilbert avatar doug-gilbert commented on July 30, 2024

Would something like 'if sg_inq $DEVICE | grep -q -i "PQual=0" ' work in this situation?

from sg3_utils.

LiuXing108 avatar LiuXing108 commented on July 30, 2024

it works:

testoneline() {
  ……
  sg_turs /dev/$SGDEV >/dev/null 2>&1
  RC=$?

  # Handle in progress of becoming ready and unit attention
  while [ $RC = 2 -o $RC = 6 ] && [ $ctr -le 30 ] ; do
    if [ $RC = 2 ] && [ "$RMB" != "1" ] && [ sg_inq /dev/$SGDEV | grep -q -i "PQual=0" ]; then
      echo -n "."
      let LN+=1
      sleep 1
    else
      sleep 0.02
    fi
    let ctr+=1
    sg_turs /dev/$SGDEV >/dev/null 2>&1
    RC=$?
……
}

from sg3_utils.

doug-gilbert avatar doug-gilbert commented on July 30, 2024

sg3_utils revision 972 (subversion, as show in ChangeLog file) uploaded with the above change in it. Could you test it?

from sg3_utils.

LiuXing108 avatar LiuXing108 commented on July 30, 2024

I'm so sorry and embarrassed for #24 (comment). it has a code error - we should not add "[ ]".

from sg3_utils.

LiuXing108 avatar LiuXing108 commented on July 30, 2024

I'm so sorry and embarrassed for #24 (comment). it has a code error - we should not add "[ ]", I wrote it wrong.
it should be like this:
if [ $RC = 2 ] && [ "$RMB" != "1" ] && sg_inq /dev/$SGDEV | grep -q -i "PQual=0" ; then

and I tested this shell with "scsi-rescan -a -r ",there are two iscsi links on my server, as we expected, one link reduced 30 seconds。
after modificated:
real 0m12.165s
user 0m2.853s
sys 0m2.450s
before modificated:
real 1m12.874s
user 0m2.732s
sys 0m2.353s

from sg3_utils.

doug-gilbert avatar doug-gilbert commented on July 30, 2024

Subversion revision 973, now mirrored here, has the above fix. Perhaps you might recheck it has been done properly. Also that revision contains the patch discussed in the issue #22 .

from sg3_utils.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.