Re: 2.6.2-rc2-mm2

From: Tim Hockin (thockin_at_sun.com)
Date: 01/31/04

  • Next message: Bartlomiej Zolnierkiewicz: "Re: 2.6.1 "clock preempt"?"
    Date:	Fri, 30 Jan 2004 15:21:03 -0800
    To: Andrew Morton <akpm@osdl.org>
    
    

    On Fri, Jan 30, 2004 at 03:08:19PM -0800, Andrew Morton wrote:
    > I think this is right - the NFSEXP_ALLSQUASH case appears to be clearing
    > all groups. When this settles down we need to run it all by Neil.
    >
    > Do we need to handle the return value from set_current_groups(), or should
    > that guy be simply returning void?

    set_current_groups() can fail if security_task_setgroups() fails.

    > + struct group_info *group_info = NULL;

    Why init to NULL?

    > + ngroups = 0;
    > + if (!(exp->ex_flags & NFSEXP_ALLSQUASH)) {
    > + for (i = 0; i < SVC_CRED_NGROUPS; i++) {
    > + if (cred->cr_groups[i])
    > + ngroups++;
    > + }
    > + }

    I though of doing this, but passed in favor of simplicity of patch :)

    The original made a specific point of doing
            gid_t group = cred->cr_groups[i];
            if (group == (gid_t) NOGROUP)
                    break;

    So the count loop should probably be
            ngroups = 0;
            if (!(exp->ex_flags & NFSEXP_ALLSQUASH)) {
                    for (i = 0; i < SVC_CRED_NGROUPS; i++) {
                            gid_t group = cred->cr_groups[i];
                            if (group == (gid_t) NOGROUP)
                                    break;
                            ngroups++;
                    }
            }
    So that we don't assume anything about NOGROUP.

    > + return ret;

    The caller in fs/nfsd/nfsfh.c still needs to check the return value and do
    something with it, or all this is just dumb.

    -- 
    Tim Hockin
    Sun Microsystems, Linux Software Engineering
    thockin@sun.com
    All opinions are my own, not Sun's
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Bartlomiej Zolnierkiewicz: "Re: 2.6.1 "clock preempt"?"

    Relevant Pages

    • [PATCH] fix up physnode_map
      ... -static void __init initialize_physnode_map ... Don't compile for NUMA-Q ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [PATCH] make mm4 compile on ppc
      ... saying "INIT: /dev/initctl is not a fifo", ... void synchronize_irq ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [PATCH 132] Macfb setup
      ... +void __init macfb_setup ... In personal conversations with technical people, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [PATCH] class_simple clean up in lp
      ... static int __init lp_init_module (void) ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [RFC] enhanced version of net_random()
      ... really thread safe, but was immune to thread corruption. ... +void net_srandom(unsigned long entropy) ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)