Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pnfs: client stats

A pNFS client auto-negotiates a lot of features (minorversion level,
pNFS layout type, etc.). This is convenient, but makes certain kinds of
failures hard for a user to detect.

For example, if the client falls back on 4.0, or falls back to MDS IO
because the user didn't connect to the right iscsi disks before
mounting, the only symptoms may be reduced performance, which may not be
noticed till long after the actual failure, and may be difficult for a
user to diagnose.

However, such "failures" may also be perfectly normal in some cases, so
we don't want to spam the system logs with them.

One approach would be to put some more information into
/proc/self/mountstats.

Signed-off-by: J. Bruce Fields <bfields@fieldses.org>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
[pnfs: add commit client stats]
[fixup data types for "ret" variables in pnfs_try_to* inline funcs.]
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
[fix definition of show_pnfs for !CONFIG_PNFS]
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
[nfs41: Fix show_sessions in the not CONFIG_NFS_V4_1 case]
There is a build error when CONFIG_NFS_V4 is set but
CONFIG_NFS_V4_1 is *not* set. show_sessions() prototype
was unbalanced between the two cases.
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
[pnfs: super.c remove CONFIG_PNFS]
Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>

authored by

J. Bruce Fields and committed by
Boaz Harrosh
ae50c0b5 778b5502

+25
+25
fs/nfs/super.c
··· 63 63 #include "iostat.h" 64 64 #include "internal.h" 65 65 #include "fscache.h" 66 + #include "pnfs.h" 66 67 67 68 #define NFSDBG_FACILITY NFSDBG_VFS 68 69 ··· 733 732 734 733 return 0; 735 734 } 735 + #ifdef CONFIG_NFS_V4_1 736 + void show_sessions(struct seq_file *m, struct nfs_server *server) 737 + { 738 + if (nfs4_has_session(server->nfs_client)) 739 + seq_printf(m, ",sessions"); 740 + } 741 + #else 742 + void show_sessions(struct seq_file *m, struct nfs_server *server) {} 743 + #endif 744 + 745 + #ifdef CONFIG_NFS_V4_1 746 + void show_pnfs(struct seq_file *m, struct nfs_server *server) 747 + { 748 + seq_printf(m, ",pnfs="); 749 + if (server->pnfs_curr_ld) 750 + seq_printf(m, "%s", server->pnfs_curr_ld->name); 751 + else 752 + seq_printf(m, "not configured"); 753 + } 754 + #else /* CONFIG_NFS_V4_1 */ 755 + void show_pnfs(struct seq_file *m, struct nfs_server *server) {} 756 + #endif /* CONFIG_NFS_V4_1 */ 736 757 737 758 static int nfs_show_devname(struct seq_file *m, struct vfsmount *mnt) 738 759 { ··· 815 792 seq_printf(m, "bm0=0x%x", nfss->attr_bitmask[0]); 816 793 seq_printf(m, ",bm1=0x%x", nfss->attr_bitmask[1]); 817 794 seq_printf(m, ",acl=0x%x", nfss->acl_bitmask); 795 + show_sessions(m, nfss); 796 + show_pnfs(m, nfss); 818 797 } 819 798 #endif 820 799