7559 pxeboot: Add nfs.read_size tunable.

Review Request #260 — Created Nov. 9, 2016 and submitted

tsoome
illumos-gate
7559
97c7aa9...
general
7559 pxeboot: Add nfs.read_size tunable.


  • 0
  • 0
  • 2
  • 0
  • 2
Description From Last Updated
rm
  1. 
      
  2. usr/src/boot/lib/libstand/nfs.c (Diff revision 1)
     
     
    Should we be warning users when we have invalid tunables due to strtol failures or actually checking the endptr.
  3. 
      
tsoome
tsoome
tsoome
tsoome
hans
  1. Ship It!
  2. 
      
rm
  1. 
      
  2. usr/src/boot/lib/libstand/nfs.c (Diff revisions 1 - 5)
     
     
    Presuming that this behaves like a classical strtoul you should probably set errno to zero and then check against it as well.
    1. ah, I would agree, but there are follow up checks in code against nfs_read_size being too small or big, and the only errno from strtol is to notify about overflow in which case we will get LONG_MIN or LONG_MAX as return value from strtol(). This was the reason why I did left errno check out of this code, as its done anyhow.

    2. So, the other reason that you can get errno is if errno is set to EINVAL and we end up returning zero. I think it's importan that we're able to distinguish at least the case where we can't make any translation vs. out of range.

    3. tbh, it really does not matter there, because few lines below the read size is verified against MIN and MAX allowed values anyhow, and will be reset (and announced to user). Anyhow, I did add errno check. Also while testing the code, I found out there is more important issue - this code is never run, as there are two instances of nfs_getrootfh(), one for NFSv2 and one for NFSv3, and only v3 is built;)

      I also did add setenv() to reset the env to good value; will push reviewboard update once I have been able to verify this code will actually work.

  3. 
      
tsoome
tsoome
tsoome
tsoome
hans
  1. Ship It!
  2. 
      
rm
  1. Ship It!
  2. 
      
tsoome
Review request changed

Status: Closed (submitted)

Loading...