Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / kernel_patches / patches / nfs_statfs-toomanyfiles-rhel-2.4.patch
1 Index: linux-2.4.21/fs/nfs/inode.c
2 ===================================================================
3 --- linux-2.4.21.orig/fs/nfs/inode.c    2005-06-01 22:51:55.000000000 -0400
4 +++ linux-2.4.21/fs/nfs/inode.c 2005-06-01 23:38:54.883239912 -0400
5 @@ -679,14 +679,21 @@
6                 goto too_big;
7         if (TOOBIG(((res.abytes + blockres) >> blockbits)))
8                 goto too_big;
9 -       if (TOOBIG(res.tfiles) || TOOBIG(res.afiles))
10 -               goto too_big;
11  
12         buf->f_blocks = (res.tbytes + blockres) >> blockbits;
13         buf->f_bfree = (res.fbytes + blockres) >> blockbits;
14         buf->f_bavail = (res.abytes + blockres) >> blockbits;
15 -       buf->f_files = res.tfiles;
16 -       buf->f_ffree = res.afiles;
17 +
18 +       if (TOOBIG(res.tfiles))
19 +               buf->f_files = -1;
20 +       else
21 +               buf->f_files = res.tfiles;
22 +
23 +       if (TOOBIG(res.afiles))
24 +               buf->f_ffree = -1;
25 +       else
26 +               buf->f_ffree = res.afiles;
27 +
28         return 0;
29  
30   too_big: