-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nfs3: fix readdir entry size calculation
Motivation: when estimating readdir reply size we should not forget about boolean flag that indicates the presence of a next entry. Modification: fix entry overhead size. Result: The returned xdr doesn't overflow expected reply size. Acked-by: Paul Millar Target: master, 0.22 (cherry picked from commit ea6f71a) Signed-off-by: Tigran Mkrtchyan <[email protected]>
- Loading branch information
Showing
5 changed files
with
57 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.dcache.testutils; | ||
|
||
import org.dcache.oncrpc4j.xdr.Xdr; | ||
import org.dcache.oncrpc4j.xdr.XdrAble; | ||
|
||
public class XdrHelper { | ||
private XdrHelper() {} | ||
|
||
|
||
public static int calculateSize (XdrAble xdrAble) { | ||
try { | ||
Xdr xdr = new Xdr(128); | ||
xdr.beginEncoding(); | ||
xdrAble.xdrEncode(xdr); | ||
xdr.endEncoding(); | ||
return xdr.getBytes().length; | ||
} catch (Exception e) { | ||
throw new AssertionError("object does not survive xdr encoding", e); | ||
} | ||
} | ||
} |