Bug 812364 - rpc.mountd sends strings that are too long over RPC channels
rpc.mountd sends strings that are too long over RPC channels
Status: CLOSED DUPLICATE of bug 736741
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: nfs-utils (Show other bugs)
All Linux
high Severity high
: rc
: ---
Assigned To: Steve Dickson
Depends On:
Blocks: 727267
  Show dependency treegraph
Reported: 2012-04-13 09:57 EDT by Stefan Walter
Modified: 2013-07-15 03:39 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-04-25 10:48:17 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
patch for utils/mountd/cache.c (910 bytes, patch)
2012-04-13 09:57 EDT, Stefan Walter
no flags Details | Diff

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 104133 None None None Never

  None (edit)
Description Stefan Walter 2012-04-13 09:57:41 EDT
Created attachment 577350 [details]
patch for utils/mountd/cache.c

Description of problem:

On our file server cluster we have many exports with individual netgroups. On some clients it is not possible to mount some shares. What we get is the following error message on the server:

Apr 12 12:04:22 srv rpc.mountd[12143]: qword_printhex: fwrite failed: errno 22 (Invalid argument)
Apr 12 12:04:22 srv rpc.mountd[12143]: qword_eol: fflush failed: errno 22 (Invalid argument)
Apr 12 12:04:22 srv rpc.mountd[12143]: Cannot export /export/..., possibly unsupported filesystem or fsid= required

We have tracked down the problem to this commit which is missing in the
nfs-utils in RHEL 6.2:


This patch alone does not solve the problem though. The two functions
cache_export() and cache_export_ent() in utils/mountd/cache.c must also
be modified to get a larger buffer via setvbuf(). A patch is attached to
this report.

Version-Release number of selected component (if applicable):


The additional patch is not present in upstream and should probably be added there too.

Additional info:

The reason why this is triggered at our site is similar to the one of the following bug I reported against RHEL4 long ago here: 


Basically rpc.mountd builds a long string with netgroups and the first
1024 bytes of the incomplete string are flushed by stdio:

12295 open("/proc/net/rpc/auth.unix.ip/channel", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 12
12295 fstat(12, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
12295 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ffabf567000
12295 write(12, "nfsd x.x.x.x 1334318187 *,@aadiya,@akourtis,@akreutz,@aligma,@alonso,@amamin,@amarfurt,@amoga,@antoinek,@asinghan,@azachary,@azala,@baslergi,@baumanan,@baumanmo,@bcagri,@blukas,@brams,@briangol,@"..., 1024) = -1 EINVAL (Invalid argument)
12295 sendto(11, "<28>Apr 13 13:26:27 rpc.mountd[12295]: qword_print: fwrite failed: errno 22 (Invalid argument)", 94, MSG_NOSIGNAL, NULL, 0) = 94
12295 write(12, "\n", 1)                = -1 EINVAL (Invalid argument)
12295 sendto(11, "<28>Apr 13 13:26:27 rpc.mountd[12295]: qword_eol: fflush failed: errno 22 (Invalid argument)", 92, MSG_NOSIGNAL, NULL, 0) = 92
12295 close(12)                         = 0
Comment 6 Steve Dickson 2012-04-25 10:46:13 EDT
The upstream patch:

commit 5604b35a61e22930873ffc4e9971002f578e7978
Author: Sean Finney <sean.finney@sonyericsson.com>
Date:   Tue Apr 19 11:04:35 2011 -0400

    nfs-utils: Increase the stdio file buffer size for procfs files
Comment 7 Steve Dickson 2012-04-25 10:48:17 EDT

*** This bug has been marked as a duplicate of bug 736741 ***
Comment 8 Moritz Baumann 2012-04-25 11:12:48 EDT
unfortunately we cannot acces the other bug or the KB article. 
Would you mind to either add Stefan Walter and me to bug 736741, or give us a quick info if this is fixed, or what workaround exists?
Comment 9 Moritz Baumann 2012-04-25 11:52:59 EDT
I wanted to ask if this addresses  the other bug we found (patch in this ticket)
as well?

Note You need to log in before you can comment on or make changes to this bug.