Project

General

Profile

Actions

Bug #6747

closed

xdr_READDIR4res() bypass the XDR mblk API

Added by Marcel Telka about 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
nfs - NFS server and client
Start date:
2016-03-13
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

The xdrmblk_putmblk_rd() called from xdr_READDIR4res() is not a part of the XDR mblk API, but it still touches the internals of the XDR mblk implementation. This is bad design idea and it is causing the incorrect calculation of the NFSv4 READDIR reply size published via NFS server kstats.

# dtrace -n 'xdr_snfs_resop4:entry{self->objp=args[1]} xdr_snfs_resop4:return /self->objp->resop == 26/ {trace(self->objp->opsize)}'
dtrace: description 'xdr_snfs_resop4:entry' matched 2 probes
CPU     ID                    FUNCTION:NAME
  0  61189           xdr_snfs_resop4:return                 8
  0  61189           xdr_snfs_resop4:return                 8

The calculated size of the NFSv4 READDIR replies is always 8. It should be far more than that.


Related issues

Related to illumos gate - Bug #6696: Per-client NFS server IOPS, bandwidth, and latency kstatsRejected2016-02-29

Actions
Related to illumos gate - Bug #6090: IOPS, bandwidth, and latency kstats for NFS serverRejected2015-07-29

Actions
Related to illumos gate - Bug #6697: Aggregated IOPS, bandwidth, and latency kstats for NFS serverRejected2016-03-01

Actions
Related to illumos gate - Bug #5907: xdrmblk_getpos() is unreliableClosedMarcel Telka2015-05-04

Actions
Actions #1

Updated by Marcel Telka about 5 years ago

  • Related to Bug #6696: Per-client NFS server IOPS, bandwidth, and latency kstats added
Actions #2

Updated by Marcel Telka about 5 years ago

  • Related to Bug #6090: IOPS, bandwidth, and latency kstats for NFS server added
Actions #3

Updated by Marcel Telka about 5 years ago

  • Related to Bug #6697: Aggregated IOPS, bandwidth, and latency kstats for NFS server added
Actions #4

Updated by Marcel Telka about 5 years ago

  • Related to Bug #5907: xdrmblk_getpos() is unreliable added
Actions #5

Updated by Marcel Telka about 5 years ago

With the fix:

# dtrace -n 'xdr_snfs_resop4:entry{self->objp=args[1]} xdr_snfs_resop4:return /self->objp->resop == 26/ {trace(self->objp->opsize)}'
dtrace: description 'xdr_snfs_resop4:entry' matched 2 probes
CPU     ID                    FUNCTION:NAME
  0  63537           xdr_snfs_resop4:return               268
  0  63537           xdr_snfs_resop4:return               268
  0  63537           xdr_snfs_resop4:return               484
  0  63537           xdr_snfs_resop4:return               484
Actions #6

Updated by Marcel Telka about 5 years ago

  • Status changed from In Progress to Pending RTI
Actions #7

Updated by Marcel Telka about 5 years ago

The Fix

The fix introduces new xdrmblk_putmblk_raw() function as part of the (undocumented and private) xdrmblk interface. This function does exactly the same thing as xdrmblk_putmblk_rd() did, but in addition it updates all xdrmblk internal states so the stream position calculations works properly.

Actions #8

Updated by Electric Monk about 5 years ago

  • Status changed from Pending RTI to Closed
  • % Done changed from 0 to 100

git commit 5dde82e7956bd330e7bee953344937998249feb2

commit  5dde82e7956bd330e7bee953344937998249feb2
Author: Marcel Telka <marcel.telka@nexenta.com>
Date:   2016-03-21T17:20:11.000Z

    6747 xdr_READDIR4res() bypass the XDR mblk API
    Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
    Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
    Approved by: Dan McDonald <danmcd@omniti.com>

Actions

Also available in: Atom PDF