The patch titled knfsd-add-nfs-export-support-to-tmpfs fioxes has been added to the -mm tree. Its filename is knfsd-add-nfs-export-support-to-tmpfs-fixes.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: knfsd-add-nfs-export-support-to-tmpfs fioxes From: Neil Brown <neilb@xxxxxxx> Fix issues with nfs exporting of tmpfs Two particular problem: i_ino can be 64bit, so use 64 bits in filehandle to store it. i_ino can be reused, so use ilookup5 and i_generation to avoid any possible confusion. Cc: Hugh Dickins <hugh@xxxxxxxxxxx> Cc: "David M. Grimes" <dgrimes@xxxxxxxxxxxx> Signed-off-by: Neil Brown <neilb@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- mm/shmem.c | 29 ++++++++++++++++++++--------- 1 files changed, 20 insertions(+), 9 deletions(-) diff -puN mm/shmem.c~knfsd-add-nfs-export-support-to-tmpfs-fixes mm/shmem.c --- a/mm/shmem.c~knfsd-add-nfs-export-support-to-tmpfs-fixes +++ a/mm/shmem.c @@ -1962,16 +1962,25 @@ static struct dentry *shmem_get_parent(s return ERR_PTR(-ESTALE); } +static int shmem_match(struct inode *ino, void *vfh) +{ + __u32 *fh = vfh; + __u64 inum = fh[2]; + inum = (inum << 32) | fh[1]; + return ino->i_ino == inum && fh[0] == ino->i_generation; +} + static struct dentry *shmem_get_dentry(struct super_block *sb, void *vfh) { struct dentry *de = NULL; struct inode *inode; __u32 *fh = vfh; + __u64 inum = fh[2]; + inum = (inum << 32) | fh[1]; - inode = ilookup(sb, (unsigned long)fh[0]); + inode = ilookup5(sb, (unsigned long)(inum+fh[0]), shmem_match, vfh); if (inode) { - if (inode->i_generation == fh[1]) - de = d_find_alias(inode); + de = d_find_alias(inode); iput(inode); } @@ -1982,7 +1991,7 @@ static struct dentry *shmem_decode_fh(st int (*acceptable)(void *context, struct dentry *de), void *context) { - if (len < 2) + if (len < 3) return ERR_PTR(-ESTALE); return sb->s_export_op->find_exported_dentry(sb, fh, NULL, acceptable, context); @@ -1992,7 +2001,7 @@ static int shmem_encode_fh(struct dentry { struct inode *inode = dentry->d_inode; - if (*len < 2) + if (*len < 3) return 255; if (hlist_unhashed(&inode->i_hash)) { @@ -2004,14 +2013,16 @@ static int shmem_encode_fh(struct dentry static DEFINE_SPINLOCK(lock); spin_lock(&lock); if (hlist_unhashed(&inode->i_hash)) - insert_inode_hash(inode); + __insert_inode_hash(inode, + inode->i_ino + inode->i_generation); spin_unlock(&lock); } - fh[0] = inode->i_ino; - fh[1] = inode->i_generation; + fh[0] = inode->i_generation; + fh[1] = inode->i_ino; + fh[2] = ((__u64)inode->i_ino) >> 32; - *len = 2; + *len = 3; return 1; } _ Patches currently in -mm which might be from neilb@xxxxxxx are origin.patch md-the-scheduled-removal-of-the-start_array-ioctl-for-md.patch md-fix-a-comment-that-is-wrong-in-raid5h.patch md-factor-out-part-of-raid10d-into-a-separate-function.patch md-replace-magic-numbers-in-sb_dirty-with-well-defined-bit-flags.patch md-remove-the-working_disks-and-failed_disks-from-raid5-state-data.patch md-remove-working_disks-from-raid10-state.patch md-new-sysfs-interface-for-setting-bits-in-the-write-intent-bitmap.patch md-remove-unnecessary-variable-x-in-stripe_to_pdidx.patch md-factor-out-part-of-raid1d-into-a-separate-function.patch md-remove-working_disks-from-raid1-state-data.patch md-improve-locking-around-error-handling.patch md-define-backing_dev_infocongested_fn-for-raid0-and-linear.patch md-define-congested_fn-for-raid1-raid10-and-multipath.patch md-add-a-congested_fn-function-for-raid5-6.patch md-make-messages-about-resync-recovery-etc-more-specific.patch md-fix-duplicity-of-levels-in-mdtxt.patch md-remove-max_md_devs-which-is-an-arbitrary-limit.patch md-remove-experimental-classification-from-raid5-reshape.patch md-use-ffz-instead-of-find_first_set-to-convert-multiplier-to-shift.patch md-allow-set_bitmap_file-to-work-on-64bit-kernel-with-32bit-userspace.patch md-add-error-reporting-to-superblock-write-failure.patch vfs-destroy-the-dentries-contributed-by-a-superblock-on-unmounting.patch knfsd-nfsd-lockdep-annotation-fix.patch knfsd-call-lockd_down-when-closing-a-socket-via-a-write-to-nfsd-portlist.patch knfsd-protect-update-to-sn_nrthreads-with-lock_kernel.patch knfsd-fixed-handling-of-lockd-fail-when-adding-nfsd-socket.patch knfsd-replace-two-page-lists-in-struct-svc_rqst-with-one.patch knfsd-replace-two-page-lists-in-struct-svc_rqst-with-one-fix.patch knfsd-avoid-excess-stack-usage-in-svc_tcp_recvfrom.patch knfsd-prepare-knfsd-for-support-of-rsize-wsize-of-up-to-1mb-over-tcp.patch knfsd-allow-max-size-of-nfsd-payload-to-be-configured.patch knfsd-make-nfsd-readahead-params-cache-smp-friendly.patch knfsd-knfsd-cache-ipmap-per-tcp-socket.patch knfsd-hide-use-of-lockds-h_monitored-flag.patch knfsd-consolidate-common-code-for-statd-lockd-notification.patch knfsd-when-looking-up-a-lockd-host-pass-hostname-length.patch knfsd-lockd-introduce-nsm_handle.patch knfsd-lockd-introduce-nsm_handle-fix.patch knfsd-misc-minor-fixes-indentation-changes.patch knfsd-lockd-make-nlm_host_rebooted-use-the-nsm_handle.patch knfsd-lockd-make-the-nsm-upcalls-use-the-nsm_handle.patch knfsd-lockd-make-the-hash-chains-use-a-hlist_node.patch knfsd-lockd-change-list-of-blocked-list-to-list_node.patch knfsd-change-nlm_file-to-use-a-hlist.patch knfsd-lockd-make-nlm_traverse_-more-flexible.patch knfsd-lockd-add-nlm_destroy_host.patch knfsd-simplify-nlmsvc_invalidate_all.patch knfsd-lockd-optionally-use-hostnames-for-identifying-peers.patch knfsd-make-nlmclnt_next_cookie-smp-safe.patch knfsd-match-granted_res-replies-using-cookies.patch knfsd-export-nsm_local_state-to-user-space-via-sysctl.patch knfsd-lockd-fix-use-of-h_nextrebind.patch knfsd-register-all-rpc-programs-with-portmapper-by-default.patch knfsd-lockd-introduce-nsm_handle-sem2mutex.patch knfsd-svcrpc-gss-factor-out-some-common-wrapping-code.patch knfsd-svcrpc-gss-fix-failure-on-svc_denied-in-integrity-case.patch knfsd-svcrpc-use-consistent-variable-name-for-the-reply-state.patch knfsd-nfsd4-refactor-exp_pseudoroot.patch knfsd-nfsd4-clean-up-exp_pseudoroot.patch knfsd-nfsd4-acls-relax-the-nfsv4-posix-mapping.patch knfsd-nfsd4-acls-fix-inheritance.patch knfsd-nfsd4-acls-simplify-nfs4_acl_nfsv4_to_posix-interface.patch knfsd-nfsd4-acls-fix-handling-of-zero-length-acls.patch knfsd-add-nfs-export-support-to-tmpfs.patch knfsd-add-nfs-export-support-to-tmpfs-fixes.patch knfsd-lockd-fix-refount-on-nsm.patch knfsd-fix-auto-sizing-of-nfsd-request-reply-buffers.patch knfsd-close-a-race-opportunity-in-d_splice_alias.patch knfsd-nfsd-store-export-path-in-export.patch knfsd-nfsd4-fslocations-data-structures.patch knfsd-nfsd4-fslocations-data-structures-nfsd4-fix-fs-locations-bounds-checking.patch knfsd-nfsd4-fslocations-data-structures-nfsd4-fslocs-fix-compile-in-non-config_nfsd_v4-case.patch knfsd-nfsd4-xdr-encoding-for-fs_locations.patch knfsd-nfsd4-actually-use-all-the-pieces-to-implement-referrals.patch md-dm-reduce-stack-usage-with-stacked-block-devices.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html