2007-06-14 08:08:36

by vignesh babu

[permalink] [raw]
Subject: [PATCH]is_power_of_2-nfs/internal.h


Replacing (n & (n-1)) in the context of power of 2 checks
with is_power_of_2

Signed-off-by: vignesh babu <[email protected]>
---
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index ad2b40d..5dca432 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -3,6 +3,7 @@
*/

#include <linux/mount.h>
+#include <linux/log2.h>

struct nfs_string;
struct nfs_mount_data;
@@ -167,7 +168,7 @@ static inline
unsigned long nfs_block_bits(unsigned long bsize, unsigned char *nrbitsp)
{
/* make sure blocksize is a power of two */
- if ((bsize & (bsize - 1)) || nrbitsp) {
+ if (is_power_of_2(bsize) || nrbitsp) {
unsigned char nrbits;

for (nrbits = 31; nrbits && !(bsize & (1 << nrbits)); nrbits--)

--
Vignesh Babu BM
_____________________________________________________________
"Why is it that every time I'm with you, makes me believe in magic?"


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs


2007-06-15 09:44:21

by Chris Osicki

[permalink] [raw]
Subject: Re: NFS and Samba Winbindd



Hi

Shouldn't it read winbind instead of winbindd in nsswitch.conf?

Regards,
Chris

On Fri, 15 Jun 2007 08:50:36 +0200
"Laurenz, Dirk" <[email protected]> wrote:

> Hi,
>
> i have the following problem, which i'm not able to solve.
>
> The setup is as follows:
>
> Linux 2.6 Kernel (SLES9-32bit, Post SP3)
> nssswitch.conf
> [...]
> groups: files ldap windbindd
> [...]
>
> A user in a an global samba/ldap group. This group is in a local winbindgroup TESTGROUP.
> (This is right concept used and works for samba shares and interactive logons directly to the server)
>
> There is a directory /test with the only acl TESTGROUP:rwx
>
> This works:
> su - $user
> cd /work
> mkdir test
>
> So all right's a resolved correctly
>
> This works not
> exportfs *:/work -o all_squash,anonuid=12345,anongid=12345
>
> uid of $user is 12345
>
> mount /work on some host on /mnt
> cd /mnt on the nfs client results in Permission denied
>
> setting an acl:
> setfacl -m u:$User:rwx
>
> results in cd /mnt and ls is working.
>
> my question is now:
> is the nfsd unable to resolv winbindd local groups?
>
> Mit freundlichem Gruss,
>
> Dirk Laurenz
> Systems Engineer
> S DE SE PS N/O
> Fujitsu Siemens Computers
> Hildesheimer Strasse 25
> 30880 Laatzen
> Germany
>
> Telephone: +49 511 84 89 18 08
> Telefax: +49 511 84 89 25 18 08
> Mobile: +49 170 22 10 781
> Email: mailto: [email protected]
> Internet: http://www.fujitsu-siemens.com
> Firmenangaben: http://www.fujitsu-siemens.de/imprint.html
>
>
>
>
>

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2007-06-15 09:58:52

by Laurenz, Dirk

[permalink] [raw]
Subject: Re: NFS and Samba Winbindd

Hi,

sorry, i mistyped this in the email on the server it is correctly typed

> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Chris Osicki
> Sent: Friday, June 15, 2007 11:44 AM
> To: [email protected]
> Subject: Re: [NFS] NFS and Samba Winbindd
>
>
>
> Hi
>
> Shouldn't it read winbind instead of winbindd in nsswitch.conf?
>
> Regards,
> Chris
>
> On Fri, 15 Jun 2007 08:50:36 +0200
> "Laurenz, Dirk" <[email protected]> wrote:
>
> > Hi,
> >
> > i have the following problem, which i'm not able to solve.
> >
> > The setup is as follows:
> >
> > Linux 2.6 Kernel (SLES9-32bit, Post SP3)
> > nssswitch.conf
> > [...]
> > groups: files ldap windbindd
> > [...]
> >
> > A user in a an global samba/ldap group. This group is in a
> local winbindgroup TESTGROUP.
> > (This is right concept used and works for samba shares and
> interactive logons directly to the server)
> >
> > There is a directory /test with the only acl TESTGROUP:rwx
> >
> > This works:
> > su - $user
> > cd /work
> > mkdir test
> >
> > So all right's a resolved correctly
> >
> > This works not
> > exportfs *:/work -o all_squash,anonuid=12345,anongid=12345
> >
> > uid of $user is 12345
> >
> > mount /work on some host on /mnt
> > cd /mnt on the nfs client results in Permission denied
> >
> > setting an acl:
> > setfacl -m u:$User:rwx
> >
> > results in cd /mnt and ls is working.
> >
> > my question is now:
> > is the nfsd unable to resolv winbindd local groups?
> >
> > Mit freundlichem Gruss,
> >
> > Dirk Laurenz
> > Systems Engineer
> > S DE SE PS N/O
> > Fujitsu Siemens Computers
> > Hildesheimer Strasse 25
> > 30880 Laatzen
> > Germany
> >
> > Telephone: +49 511 84 89 18 08
> > Telefax: +49 511 84 89 25 18 08
> > Mobile: +49 170 22 10 781
> > Email: mailto: [email protected]
> > Internet: http://www.fujitsu-siemens.com
> > Firmenangaben: http://www.fujitsu-siemens.de/imprint.html
> >
> >
> >
> >
> >
>
> --------------------------------------------------------------
> -----------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> NFS maillist - [email protected]
> https://lists.sourceforge.net/lists/listinfo/nfs
>

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2007-06-20 05:31:56

by Laurenz, Dirk

[permalink] [raw]
Subject: Re: NFS and Samba Winbindd

Hello List,

the problem still persists. Does anyone have an idea?
Can i increase the debug level a little bit to see, what
the nfsd is doing to resolv memberships?

> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Laurenz, Dirk
> Sent: Friday, June 15, 2007 11:58 AM
> To: Chris Osicki; [email protected]
> Subject: Re: [NFS] NFS and Samba Winbindd
>
> Hi,
>
> sorry, i mistyped this in the email on the server it is
> correctly typed
>
> > -----Original Message-----
> > From: [email protected]
> > [mailto:[email protected]] On Behalf Of Chris Osicki
> > Sent: Friday, June 15, 2007 11:44 AM
> > To: [email protected]
> > Subject: Re: [NFS] NFS and Samba Winbindd
> >
> >
> >
> > Hi
> >
> > Shouldn't it read winbind instead of winbindd in nsswitch.conf?
> >
> > Regards,
> > Chris
> >
> > On Fri, 15 Jun 2007 08:50:36 +0200
> > "Laurenz, Dirk" <[email protected]> wrote:
> >
> > > Hi,
> > >
> > > i have the following problem, which i'm not able to solve.
> > >
> > > The setup is as follows:
> > >
> > > Linux 2.6 Kernel (SLES9-32bit, Post SP3)
> > > nssswitch.conf
> > > [...]
> > > groups: files ldap windbindd
> > > [...]
> > >
> > > A user in a an global samba/ldap group. This group is in a
> > local winbindgroup TESTGROUP.
> > > (This is right concept used and works for samba shares and
> > interactive logons directly to the server)
> > >
> > > There is a directory /test with the only acl TESTGROUP:rwx
> > >
> > > This works:
> > > su - $user
> > > cd /work
> > > mkdir test
> > >
> > > So all right's a resolved correctly
> > >
> > > This works not
> > > exportfs *:/work -o all_squash,anonuid=12345,anongid=12345
> > >
> > > uid of $user is 12345
> > >
> > > mount /work on some host on /mnt
> > > cd /mnt on the nfs client results in Permission denied
> > >
> > > setting an acl:
> > > setfacl -m u:$User:rwx
> > >
> > > results in cd /mnt and ls is working.
> > >
> > > my question is now:
> > > is the nfsd unable to resolv winbindd local groups?
> > >
> > > Mit freundlichem Gruss,
> > >
> > > Dirk Laurenz
> > > Systems Engineer
> > > S DE SE PS N/O
> > > Fujitsu Siemens Computers
> > > Hildesheimer Strasse 25
> > > 30880 Laatzen
> > > Germany
> > >
> > > Telephone: +49 511 84 89 18 08
> > > Telefax: +49 511 84 89 25 18 08
> > > Mobile: +49 170 22 10 781
> > > Email: mailto: [email protected]
> > > Internet: http://www.fujitsu-siemens.com
> > > Firmenangaben: http://www.fujitsu-siemens.de/imprint.html
> > >
> > >
> > >
> > >
> > >
> >
> > --------------------------------------------------------------
> > -----------
> > This SF.net email is sponsored by DB2 Express
> > Download DB2 Express C - the FREE version of DB2 express and take
> > control of your XML. No limits. Just data. Click to get it now.
> > http://sourceforge.net/powerbar/db2/
> > _______________________________________________
> > NFS maillist - [email protected]
> > https://lists.sourceforge.net/lists/listinfo/nfs
> >
>
> --------------------------------------------------------------
> -----------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> NFS maillist - [email protected]
> https://lists.sourceforge.net/lists/listinfo/nfs
>

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2007-06-20 14:18:36

by Trond Myklebust

[permalink] [raw]
Subject: Re: NFS and Samba Winbindd

On Wed, 2007-06-20 at 07:31 +0200, Laurenz, Dirk wrote:
> Hello List,
>
> the problem still persists. Does anyone have an idea?
> Can i increase the debug level a little bit to see, what
> the nfsd is doing to resolv memberships?

Do you have /lib/libnss_winbind.so installed, have you set up smb.conf
correctly, logged into the domain and started winbind? (see the full
description in "man winbind").

If it is all set up correctly, then you should be able to type

getent group TESTGROUP

on the command line, and see the group TESTGROUP being resolved to the
correct Windoze group entry.

Trond

> > -----Original Message-----
> > From: [email protected]
> > [mailto:[email protected]] On Behalf Of Laurenz, Dirk
> > Sent: Friday, June 15, 2007 11:58 AM
> > To: Chris Osicki; [email protected]
> > Subject: Re: [NFS] NFS and Samba Winbindd
> >
> > Hi,
> >
> > sorry, i mistyped this in the email on the server it is
> > correctly typed
> >
> > > -----Original Message-----
> > > From: [email protected]
> > > [mailto:[email protected]] On Behalf Of Chris Osicki
> > > Sent: Friday, June 15, 2007 11:44 AM
> > > To: [email protected]
> > > Subject: Re: [NFS] NFS and Samba Winbindd
> > >
> > >
> > >
> > > Hi
> > >
> > > Shouldn't it read winbind instead of winbindd in nsswitch.conf?
> > >
> > > Regards,
> > > Chris
> > >
> > > On Fri, 15 Jun 2007 08:50:36 +0200
> > > "Laurenz, Dirk" <[email protected]> wrote:
> > >
> > > > Hi,
> > > >
> > > > i have the following problem, which i'm not able to solve.
> > > >
> > > > The setup is as follows:
> > > >
> > > > Linux 2.6 Kernel (SLES9-32bit, Post SP3)
> > > > nssswitch.conf
> > > > [...]
> > > > groups: files ldap windbindd
> > > > [...]
> > > >
> > > > A user in a an global samba/ldap group. This group is in a
> > > local winbindgroup TESTGROUP.
> > > > (This is right concept used and works for samba shares and
> > > interactive logons directly to the server)
> > > >
> > > > There is a directory /test with the only acl TESTGROUP:rwx
> > > >
> > > > This works:
> > > > su - $user
> > > > cd /work
> > > > mkdir test
> > > >
> > > > So all right's a resolved correctly
> > > >
> > > > This works not
> > > > exportfs *:/work -o all_squash,anonuid=12345,anongid=12345
> > > >
> > > > uid of $user is 12345
> > > >
> > > > mount /work on some host on /mnt
> > > > cd /mnt on the nfs client results in Permission denied
> > > >
> > > > setting an acl:
> > > > setfacl -m u:$User:rwx
> > > >
> > > > results in cd /mnt and ls is working.
> > > >
> > > > my question is now:
> > > > is the nfsd unable to resolv winbindd local groups?
> > > >
> > > > Mit freundlichem Gruss,
> > > >
> > > > Dirk Laurenz
> > > > Systems Engineer
> > > > S DE SE PS N/O
> > > > Fujitsu Siemens Computers
> > > > Hildesheimer Strasse 25
> > > > 30880 Laatzen
> > > > Germany
> > > >
> > > > Telephone: +49 511 84 89 18 08
> > > > Telefax: +49 511 84 89 25 18 08
> > > > Mobile: +49 170 22 10 781
> > > > Email: mailto: [email protected]
> > > > Internet: http://www.fujitsu-siemens.com
> > > > Firmenangaben: http://www.fujitsu-siemens.de/imprint.html
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > > --------------------------------------------------------------
> > > -----------
> > > This SF.net email is sponsored by DB2 Express
> > > Download DB2 Express C - the FREE version of DB2 express and take
> > > control of your XML. No limits. Just data. Click to get it now.
> > > http://sourceforge.net/powerbar/db2/
> > > _______________________________________________
> > > NFS maillist - [email protected]
> > > https://lists.sourceforge.net/lists/listinfo/nfs
> > >
> >
> > --------------------------------------------------------------
> > -----------
> > This SF.net email is sponsored by DB2 Express
> > Download DB2 Express C - the FREE version of DB2 express and take
> > control of your XML. No limits. Just data. Click to get it now.
> > http://sourceforge.net/powerbar/db2/
> > _______________________________________________
> > NFS maillist - [email protected]
> > https://lists.sourceforge.net/lists/listinfo/nfs
> >
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> NFS maillist - [email protected]
> https://lists.sourceforge.net/lists/listinfo/nfs


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2007-06-14 15:46:08

by Trond Myklebust

[permalink] [raw]
Subject: Re: [PATCH]is_power_of_2-nfs/internal.h

On Thu, 2007-06-14 at 13:38 +0530, vignesh babu wrote:
> Replacing (n & (n-1)) in the context of power of 2 checks
> with is_power_of_2
>
> Signed-off-by: vignesh babu <[email protected]>
> ---
> diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
> index ad2b40d..5dca432 100644
> --- a/fs/nfs/internal.h
> +++ b/fs/nfs/internal.h
> @@ -3,6 +3,7 @@
> */
>
> #include <linux/mount.h>
> +#include <linux/log2.h>
>
> struct nfs_string;
> struct nfs_mount_data;
> @@ -167,7 +168,7 @@ static inline
> unsigned long nfs_block_bits(unsigned long bsize, unsigned char *nrbitsp)
> {
> /* make sure blocksize is a power of two */
> - if ((bsize & (bsize - 1)) || nrbitsp) {
> + if (is_power_of_2(bsize) || nrbitsp) {
> unsigned char nrbits;
>
> for (nrbits = 31; nrbits && !(bsize & (1 << nrbits)); nrbits--)
>

We don't need the extra test for bsize == 0 that this introduces: bsize
is guaranteed to be at least 1024 or greater.

Trond


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2007-06-14 15:59:58

by Yoann Padioleau

[permalink] [raw]
Subject: Re: [KJ] [PATCH]is_power_of_2-nfs/internal.h

vignesh babu <[email protected]> writes:

> Replacing (n & (n-1)) in the context of power of 2 checks
> with is_power_of_2
>
> Signed-off-by: vignesh babu <[email protected]>
> ---
> diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
> index ad2b40d..5dca432 100644
> --- a/fs/nfs/internal.h
> +++ b/fs/nfs/internal.h
> @@ -3,6 +3,7 @@
> */
>
> #include <linux/mount.h>
> +#include <linux/log2.h>
>
> struct nfs_string;
> struct nfs_mount_data;
> @@ -167,7 +168,7 @@ static inline
> unsigned long nfs_block_bits(unsigned long bsize, unsigned char *nrbitsp)
> {
> /* make sure blocksize is a power of two */
> - if ((bsize & (bsize - 1)) || nrbitsp) {
> + if (is_power_of_2(bsize) || nrbitsp) {

Did I miss something but why in this case it's not

+ if (!is_power_of_2(bsize) || nrbitsp) {

?


> unsigned char nrbits;
>
> for (nrbits = 31; nrbits && !(bsize & (1 << nrbits)); nrbits--)
>
> --
> Vignesh Babu BM
> _____________________________________________________________
> "Why is it that every time I'm with you, makes me believe in magic?"
>
> _______________________________________________
> Kernel-janitors mailing list
> [email protected]
> https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs