diff --git a/mountd-fix-bug-affecting-exports-of-dirs-with-64bit-.patch b/mountd-fix-bug-affecting-exports-of-dirs-with-64bit-.patch new file mode 100644 index 0000000..26785df --- /dev/null +++ b/mountd-fix-bug-affecting-exports-of-dirs-with-64bit-.patch @@ -0,0 +1,105 @@ +Git-commit: b3a156fe96c6645ca5dbf4b75e9cff710218d920 +From: Neil Brown +Date: Mon, 21 Oct 2013 16:27:32 +1100 +Subject: [PATCH 1/2] mountd: fix bug affecting exports of dirs with 64bit + inode number. +References: bnc:841971 + +parse_fsid is currently truncating all inode numbers to +32bits, and assumes that 'int' is 32 bits (which it probably is, +but we shouldn't assume). + +So make the 'inode' field in 'struct parsed_fsid' a 64 bit field. +and only memcpy into variables or fields that have been declared +to a specific bit size. + +Signed-off-by: NeilBrown +--- + utils/mountd/cache.c | 25 ++++++++++++++----------- + 1 file changed, 14 insertions(+), 11 deletions(-) + +--- nfs-utils-1.2.8.orig/utils/mountd/cache.c ++++ nfs-utils-1.2.8/utils/mountd/cache.c +@@ -388,10 +388,10 @@ struct parsed_fsid { + int fsidtype; + /* We could use a union for this, but it would be more + * complicated; why bother? */ +- unsigned int inode; ++ uint64_t inode; + unsigned int minor; + unsigned int major; +- unsigned int fsidnum; ++ uint32_t fsidnum; + size_t uuidlen; + char *fhuuid; + }; +@@ -399,8 +399,8 @@ struct parsed_fsid { + static int parse_fsid(int fsidtype, int fsidlen, char *fsid, + struct parsed_fsid *parsed) + { +- unsigned int dev; +- unsigned long long inode64; ++ uint32_t dev; ++ uint32_t inode32; + + memset(parsed, 0, sizeof(*parsed)); + parsed->fsidtype = fsidtype; +@@ -409,7 +409,8 @@ static int parse_fsid(int fsidtype, int + if (fsidlen != 8) + return -1; + memcpy(&dev, fsid, 4); +- memcpy(&parsed->inode, fsid+4, 4); ++ memcpy(&inode32, fsid+4, 4); ++ parsed->inode = inode32; + parsed->major = ntohl(dev)>>16; + parsed->minor = ntohl(dev) & 0xFFFF; + break; +@@ -420,7 +421,7 @@ static int parse_fsid(int fsidtype, int + memcpy(&parsed->fsidnum, fsid, 4); + break; + +- case FSID_MAJOR_MINOR: /* 12 bytes: 4 major, 4 minor, 4 inode ++ case FSID_MAJOR_MINOR: /* 12 bytes: 4 major, 4 minor, 4 inode + * This format is never actually used but was + * an historical accident + */ +@@ -430,7 +431,8 @@ static int parse_fsid(int fsidtype, int + parsed->major = ntohl(dev); + memcpy(&dev, fsid+4, 4); + parsed->minor = ntohl(dev); +- memcpy(&parsed->inode, fsid+8, 4); ++ memcpy(&inode32, fsid+8, 4); ++ parsed->inode = inode32; + break; + + case FSID_ENCODE_DEV: /* 8 bytes: 4 byte packed device number, 4 inode */ +@@ -440,7 +442,8 @@ static int parse_fsid(int fsidtype, int + if (fsidlen != 8) + return -1; + memcpy(&dev, fsid, 4); +- memcpy(&parsed->inode, fsid+4, 4); ++ memcpy(&inode32, fsid+4, 4); ++ parsed->inode = inode32; + parsed->major = (dev & 0xfff00) >> 8; + parsed->minor = (dev & 0xff) | ((dev >> 12) & 0xfff00); + break; +@@ -448,7 +451,8 @@ static int parse_fsid(int fsidtype, int + case FSID_UUID4_INUM: /* 4 byte inode number and 4 byte uuid */ + if (fsidlen != 8) + return -1; +- memcpy(&parsed->inode, fsid, 4); ++ memcpy(&inode32, fsid, 4); ++ parsed->inode = inode32; + parsed->uuidlen = 4; + parsed->fhuuid = fsid+4; + break; +@@ -467,8 +471,7 @@ static int parse_fsid(int fsidtype, int + case FSID_UUID16_INUM: /* 8 byte inode number and 16 byte uuid */ + if (fsidlen != 24) + return -1; +- memcpy(&inode64, fsid, 8); +- parsed->inode = inode64; ++ memcpy(&parsed->inode, fsid, 8); + parsed->uuidlen = 16; + parsed->fhuuid = fsid+8; + break; diff --git a/nfs-utils.changes b/nfs-utils.changes index d4206f6..b94c95b 100644 --- a/nfs-utils.changes +++ b/nfs-utils.changes @@ -1,3 +1,20 @@ +------------------------------------------------------------------- +Tue Oct 22 04:45:13 UTC 2013 - nfbrown@suse.com + +- mountd-fix-bug-affecting-exports-of-dirs-with-64bit-.patch + allow NFS export to work for XFS filesystems with INODE64 + (bnc#841971) + +------------------------------------------------------------------- +Tue Oct 15 01:13:01 UTC 2013 - nfbrown@suse.com + +- nfs.init: run ldconfig directly rather than calling + boot.ldconfig. + boot.ldconfig had some "optimisations" which are + unimportant and inconvenient for NFS, and doesn't + exist any more anyway. + (bnc#834164). + ------------------------------------------------------------------- Thu Sep 5 05:05:13 UTC 2013 - nfbrown@suse.com diff --git a/nfs-utils.spec b/nfs-utils.spec index 4bc0ef9..1d9745c 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -71,6 +71,8 @@ Patch5: 0005-gssd-don-t-give-up-on-machine-credential-if-hostname.patch Patch6: 0006-gssd-fixed-typo-in-machine-cred-name.patch # PATCH-FIX-UPSTREAM skip-on-ENOENT.patch nfbrown@suse.de Patch7: skip-on-ENOENT.patch +# PATCH-FIX-UPSTREAM mountd-fix-bug-affecting-exports-of-dirs-with-64bit-.patch nfbrown@suse.de +Patch8: mountd-fix-bug-affecting-exports-of-dirs-with-64bit-.patch Suggests: python-base %description @@ -128,6 +130,7 @@ This package contains additional NFS documentation. %patch5 -p1 %patch6 -p1 %patch7 -p1 +%patch8 -p1 cp %{S:6} . %build diff --git a/nfs.init b/nfs.init index c0bd50d..85d2314 100644 --- a/nfs.init +++ b/nfs.init @@ -261,8 +261,9 @@ case "$1-$nfs" in # generate new list of available shared libraries # if test "$NEED_LDCONFIG" = yes; then - # check if ld.so.cache needs to be refreshed - /etc/init.d/boot.ldconfig start + if test -x /sbin/ldconfig; then + /sbin/ldconfig -X > /dev/null 2>&1 || : + fi fi # ;;