• Olaf Kirch's avatar
    [PATCH] statfs compat functions can return EOVERFLOW on NFS · 30c1c584
    Olaf Kirch authored
    A while ago, we fixed a problem in statfs on 64bit system that caused it
    to return EOVERFLOW when the number of files reported by the underlying
    file system was -1 (which happens for NFS for instance). The problematic
    code was this:
    
            if (sizeof ubuf->f_blocks == 4) {
                    if ((kbuf->f_blocks | kbuf->f_bfree |
                         kbuf->f_bavail | kbuf->f_files | kbuf->f_ffree) &
                        0xffffffff00000000ULL)
                            return -EOVERFLOW;
    		...
    	}
    
    The problem was fixed by explicitly allowing f_files and f_ffree to be -1.
    
    The same problem exists in fs/compat.c, and the attached patch fixes it
    in a similar manner.
    Signed-Off-By: default avatarOlaf Kirch <okir@suse.de>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    30c1c584
compat.c 44.6 KB