All of lore.kernel.org
 help / color / mirror / Atom feed
* linux-next: Tree for December 3
@ 2010-12-03  2:04 Stephen Rothwell
  2010-12-03 17:48 ` linux-next: Tree for December 3 (cifs) Randy Dunlap
  0 siblings, 1 reply; 23+ messages in thread
From: Stephen Rothwell @ 2010-12-03  2:04 UTC (permalink / raw)
  To: linux-next; +Cc: LKML

[-- Attachment #1: Type: text/plain, Size: 9036 bytes --]

Hi all,

Changes since 20101202:

The v4l-dvb tree still has its build failure for which I applied a patch.

The acpi tree still has its build failure so I used the version from
next-20101201.

The net tree gained a conflict against the wireless-current tree.

The tip tree still has its build failures so I have reverted 3 commits.

----------------------------------------------------------------------------

I have created today's linux-next tree at
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
(patches at http://www.kernel.org/pub/linux/kernel/v2.6/next/ ).  If you
are tracking the linux-next tree using git, you should not use "git pull"
to do so as that will try to merge the new linux-next release with the
old one.  You should use "git fetch" as mentioned in the FAQ on the wiki
(see below).

You can see which trees have been included by looking in the Next/Trees
file in the source.  There are also quilt-import.log and merge.log files
in the Next directory.  Between each merge, the tree was built with
a ppc64_defconfig for powerpc and an allmodconfig for x86_64. After the
final fixups (if any), it is also built with powerpc allnoconfig (32 and
64 bit), ppc44x_defconfig and allyesconfig (minus
CONFIG_PROFILE_ALL_BRANCHES - this fails its final link) and i386, sparc
and sparc64 defconfig. These builds also have
CONFIG_ENABLE_WARN_DEPRECATED, CONFIG_ENABLE_MUST_CHECK and
CONFIG_DEBUG_INFO disabled when necessary.

Below is a summary of the state of the merge.

We are up to 181 trees (counting Linus' and 26 trees of patches pending
for Linus' tree), more are welcome (even if they are currently empty).
Thanks to those who have contributed, and to those who haven't, please do.

Status of my local build tests will be at
http://kisskb.ellerman.id.au/linux-next .  If maintainers want to give
advice about cross compilers/configs that work, we are always open to add
more builds.

Thanks to Randy Dunlap for doing many randconfig builds.

There is a wiki covering stuff to do with linux-next at
http://linux.f-seidel.de/linux-next/pmwiki/ .  Thanks to Frank Seidel.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

$ git checkout master
$ git reset --hard stable
Merging origin/master
Merging fixes/fixes
Merging arm-current/master
Merging m68k-current/for-linus
Merging powerpc-merge/merge
Merging sparc-current/master
Merging scsi-rc-fixes/master
Merging net-current/master
Merging sound-current/for-linus
Merging pci-current/for-linus
Merging wireless-current/master
Merging kbuild-current/rc-fixes
Merging driver-core.current/driver-core-linus
Merging tty.current/tty-linus
Merging usb.current/usb-linus
Merging staging.current/staging-linus
Merging cpufreq-current/fixes
Merging input-current/for-linus
Merging md-current/for-linus
Merging audit-current/for-linus
Merging crypto-current/master
Merging ide-curent/master
Merging dwmw2/master
Merging sh-current/sh-fixes-for-linus
Merging rmobile-current/rmobile-fixes-for-linus
Merging fbdev-current/fbdev-fixes-for-linus
Merging gcl-current/merge
Merging arm/devel
Merging davinci/davinci-next
Merging i.MX/for-next
Merging msm/for-next
Merging omap/for-next
Merging pxa/for-next
Merging samsung/next-samsung
Merging s5p/for-next
Merging tegra/for-next
Merging ux500-core/ux500-core
Merging avr32/avr32-arch
Merging blackfin/for-linus
Merging cris/for-next
Merging ia64/test
Merging m68k/for-next
Merging m68knommu/for-next
Merging microblaze/next
Merging mips/mips-for-linux-next
Merging parisc/next
Merging powerpc/next
Merging 4xx/next
Merging 52xx-and-virtex/next
Merging galak/next
Merging s390/features
Merging sh/sh-latest
Merging rmobile/rmobile-latest
CONFLICT (content): Merge conflict in arch/arm/mach-shmobile/Kconfig
Applying: rmobile: merge fixup for clkdev changes
Merging sparc/master
Merging tile/master
Merging xtensa/master
CONFLICT (content): Merge conflict in arch/xtensa/configs/iss_defconfig
Merging ceph/for-next
Merging cifs/master
Merging configfs/linux-next
Merging ecryptfs/next
Merging ext3/for_next
Merging ext4/next
Merging fatfs/master
Merging fuse/for-next
Merging gfs2/master
Merging hfsplus/for-next
Merging jfs/next
Merging logfs/master
CONFLICT (content): Merge conflict in fs/logfs/logfs.h
Merging nfs/linux-next
Merging nfsd/nfsd-next
Merging nilfs2/for-next
Merging ocfs2/linux-next
Merging omfs/for-next
Merging squashfs/master
Merging udf/for_next
Merging v9fs/for-next
Merging ubifs/linux-next
Merging xfs/master
Merging vfs/for-next
Merging pci/linux-next
CONFLICT (content): Merge conflict in drivers/pci/pci-sysfs.c
Merging hid/for-next
CONFLICT (content): Merge conflict in drivers/hid/hid-input.c
Merging quilt/i2c
Merging bjdooks-i2c/next-i2c
Merging quilt/jdelvare-hwmon
Merging hwmon-staging/hwmon-next
Merging quilt/kernel-doc
Merging v4l-dvb/master
Applying: media: const and __devinitdata do not mix
Merging kbuild/for-next
Merging kconfig/for-next
Merging ide/master
Merging libata/NEXT
Merging infiniband/for-next
Merging acpi/test
$ git reset --hard HEAD^
Merging refs/next/20101201/acpi
Merging idle-test/idle-test
Merging ieee1394/for-next
Merging ubi/linux-next
Merging kvm/linux-next
Merging dlm/next
Merging swiotlb/master
Merging ibft/master
Merging scsi/master
Merging async_tx/next
Merging net/master
CONFLICT (content): Merge conflict in drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
Merging wireless/master
CONFLICT (content): Merge conflict in drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
Merging bluetooth/master
Merging mtd/master
Merging crypto/master
Merging sound/for-next
Merging sound-asoc/for-next
Merging cpufreq/next
Merging quilt/rr
Merging input/next
Merging lsm/for-next
Merging block/for-next
Merging quilt/device-mapper
Merging embedded/master
Merging firmware/master
Merging pcmcia/master
Merging battery/master
Merging leds/for-mm
Merging backlight/for-mm
Merging mmc/mmc-next
Merging kgdb/kgdb-next
Merging slab/for-next
Merging uclinux/for-next
Merging md/for-next
Merging mfd/for-next
CONFLICT (content): Merge conflict in drivers/mfd/wm8994-core.c
Merging hdlc/hdlc-next
Merging drm/drm-next
Merging fbdev/master
Merging viafb/viafb-next
Merging omap_dss2/for-next
Merging voltage/for-next
CONFLICT (content): Merge conflict in drivers/regulator/core.c
Merging security-testing/next
Merging selinux/master
Merging lblnet/master
Merging agp/agp-next
Merging watchdog/master
Merging bdev/master
Merging dwmw2-iommu/master
Merging cputime/cputime
Merging osd/linux-next
Merging jc_docs/docs-next
Merging nommu/master
Merging trivial/for-next
CONFLICT (content): Merge conflict in MAINTAINERS
CONFLICT (content): Merge conflict in drivers/scsi/bfa/bfa_fcpim.c
Merging audit/for-next
Merging suspend/linux-next
Merging fsnotify/for-next
Merging irda/for-next
Merging catalin/for-next
Merging alacrity/linux-next
CONFLICT (content): Merge conflict in drivers/Makefile
CONFLICT (content): Merge conflict in include/linux/Kbuild
CONFLICT (content): Merge conflict in lib/Kconfig
Merging i7core_edac/linux_next
Merging i7300_edac/linux_next
Merging devicetree/next-devicetree
Merging spi/next-spi
Merging tip/auto-latest
[master c0605ba] Revert "x86, nmi_watchdog: Remove all stub function calls from old nmi_watchdog"
[master fcb8eb6] Revert "x86, nmi_watchdog: Remove the old nmi_watchdog"
[master 637fc62] Revert "perf, arch: Cleanup perf-pmu init vs lockup-detector"
Merging rcu/rcu/next
Merging oprofile/for-next
Merging xen/upstream/xen
Merging swiotlb-xen/master
Merging xen-pvhvm/linux-next
Merging edac-amd/for-next
Merging percpu/for-next
Merging workqueues/for-next
Merging sfi/sfi-test
Merging asm-generic/next
Merging drivers-x86/linux-next
Merging hwpoison/hwpoison
Merging sysctl/master
Merging driver-core/driver-core-next
Merging tty/tty-next
Merging usb/usb-next
Merging staging/staging-next
CONFLICT (content): Merge conflict in drivers/staging/batman-adv/hard-interface.c
CONFLICT (content): Merge conflict in drivers/staging/batman-adv/soft-interface.c
CONFLICT (delete/modify): drivers/staging/winbond/sysdef.h deleted in staging/staging-next and modified in HEAD. Version HEAD of drivers/staging/winbond/sysdef.h left in tree.
$ git rm -f drivers/staging/winbond/sysdef.h
Merging slabh/slabh
Merging bkl-trivial/trivial
Merging bkl-llseek/llseek
Merging bkl-vfs/vfs
Merging bkl-config/config
CONFLICT (content): Merge conflict in arch/powerpc/kernel/setup_64.c
CONFLICT (content): Merge conflict in include/linux/hardirq.h
CONFLICT (content): Merge conflict in include/linux/smp_lock.h
Merging irqflags/master
Merging cleancache/linux-next
CONFLICT (content): Merge conflict in fs/ocfs2/super.c
CONFLICT (content): Merge conflict in include/linux/fs.h
CONFLICT (content): Merge conflict in mm/Kconfig
Merging scsi-post-merge/merge-base:master

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: Tree for December 3 (cifs)
  2010-12-03  2:04 linux-next: Tree for December 3 Stephen Rothwell
@ 2010-12-03 17:48 ` Randy Dunlap
  2010-12-06  7:09     ` Ingo Molnar
  0 siblings, 1 reply; 23+ messages in thread
From: Randy Dunlap @ 2010-12-03 17:48 UTC (permalink / raw)
  To: Stephen Rothwell, Steve French; +Cc: linux-next, LKML, linux-cifs

On Fri, 3 Dec 2010 13:04:40 +1100 Stephen Rothwell wrote:

> Hi all,
> 
> Changes since 20101202:


When CIFS_EXPERIMENTAL is not enabled:

(.text+0xdf6c9): undefined reference to `get_cifs_acl'

from fs/cifs/xattr.c:cifs_getxattr()


CONFIG_CIFS=y
# CONFIG_CIFS_STATS is not set
CONFIG_CIFS_WEAK_PW_HASH=y
# CONFIG_CIFS_UPCALL is not set
CONFIG_CIFS_XATTR=y
CONFIG_CIFS_POSIX=y
# CONFIG_CIFS_DEBUG2 is not set
# CONFIG_CIFS_DFS_UPCALL is not set
CONFIG_CIFS_FSCACHE=y
CONFIG_CIFS_ACL=y
# CONFIG_CIFS_EXPERIMENTAL is not set


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: Tree for December 3 (cifs)
  2010-12-03 17:48 ` linux-next: Tree for December 3 (cifs) Randy Dunlap
@ 2010-12-06  7:09     ` Ingo Molnar
  0 siblings, 0 replies; 23+ messages in thread
From: Ingo Molnar @ 2010-12-06  7:09 UTC (permalink / raw)
  To: Randy Dunlap, Steve French
  Cc: Stephen Rothwell, Steve French, linux-next, LKML, linux-cifs,
	Linus Torvalds, Andrew Morton


* Randy Dunlap <randy.dunlap@oracle.com> wrote:

> On Fri, 3 Dec 2010 13:04:40 +1100 Stephen Rothwell wrote:
> 
> > Hi all,
> > 
> > Changes since 20101202:
> 
> 
> When CIFS_EXPERIMENTAL is not enabled:
> 
> (.text+0xdf6c9): undefined reference to `get_cifs_acl'
> 
> from fs/cifs/xattr.c:cifs_getxattr()
> 
> 
> CONFIG_CIFS=y
> # CONFIG_CIFS_STATS is not set
> CONFIG_CIFS_WEAK_PW_HASH=y
> # CONFIG_CIFS_UPCALL is not set
> CONFIG_CIFS_XATTR=y
> CONFIG_CIFS_POSIX=y
> # CONFIG_CIFS_DEBUG2 is not set
> # CONFIG_CIFS_DFS_UPCALL is not set
> CONFIG_CIFS_FSCACHE=y
> CONFIG_CIFS_ACL=y
> # CONFIG_CIFS_EXPERIMENTAL is not set

And this build regression has been pushed upstream now, as of:

   8520eeaa1235: Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6

and it is triggering for me too:

   fs/built-in.o: In function `cifs_getxattr':
   (.text+0xc518e): undefined reference to `get_cifs_acl'

The regression got introduced by:

   fbeba8bb16d7: cifs: Handle extended attribute name cifs_acl to generate cifs acl blob (try #4)

Which introduced the new CIFS_ACL option.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: Tree for December 3 (cifs)
@ 2010-12-06  7:09     ` Ingo Molnar
  0 siblings, 0 replies; 23+ messages in thread
From: Ingo Molnar @ 2010-12-06  7:09 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Stephen Rothwell, Steve French, linux-next, LKML, linux-cifs,
	Linus Torvalds, Andrew Morton


* Randy Dunlap <randy.dunlap@oracle.com> wrote:

> On Fri, 3 Dec 2010 13:04:40 +1100 Stephen Rothwell wrote:
> 
> > Hi all,
> > 
> > Changes since 20101202:
> 
> 
> When CIFS_EXPERIMENTAL is not enabled:
> 
> (.text+0xdf6c9): undefined reference to `get_cifs_acl'
> 
> from fs/cifs/xattr.c:cifs_getxattr()
> 
> 
> CONFIG_CIFS=y
> # CONFIG_CIFS_STATS is not set
> CONFIG_CIFS_WEAK_PW_HASH=y
> # CONFIG_CIFS_UPCALL is not set
> CONFIG_CIFS_XATTR=y
> CONFIG_CIFS_POSIX=y
> # CONFIG_CIFS_DEBUG2 is not set
> # CONFIG_CIFS_DFS_UPCALL is not set
> CONFIG_CIFS_FSCACHE=y
> CONFIG_CIFS_ACL=y
> # CONFIG_CIFS_EXPERIMENTAL is not set

And this build regression has been pushed upstream now, as of:

   8520eeaa1235: Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6

and it is triggering for me too:

   fs/built-in.o: In function `cifs_getxattr':
   (.text+0xc518e): undefined reference to `get_cifs_acl'

The regression got introduced by:

   fbeba8bb16d7: cifs: Handle extended attribute name cifs_acl to generate cifs acl blob (try #4)

Which introduced the new CIFS_ACL option.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: Tree for December 3 (cifs)
  2010-12-06  7:09     ` Ingo Molnar
@ 2010-12-06 12:35         ` Jeff Layton
  -1 siblings, 0 replies; 23+ messages in thread
From: Jeff Layton @ 2010-12-06 12:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Randy Dunlap, Steve French, Stephen Rothwell,
	linux-next-u79uwXL29TY76Z2rM5mHXA, LKML,
	linux-cifs-u79uwXL29TY76Z2rM5mHXA, Linus Torvalds, Andrew Morton

On Mon, 6 Dec 2010 08:09:56 +0100
Ingo Molnar <mingo-X9Un+BFzKDI@public.gmane.org> wrote:

> 
> * Randy Dunlap <randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> wrote:
> 
> > On Fri, 3 Dec 2010 13:04:40 +1100 Stephen Rothwell wrote:
> > 
> > > Hi all,
> > > 
> > > Changes since 20101202:
> > 
> > 
> > When CIFS_EXPERIMENTAL is not enabled:
> > 
> > (.text+0xdf6c9): undefined reference to `get_cifs_acl'
> > 
> > from fs/cifs/xattr.c:cifs_getxattr()
> > 
> > 
> > CONFIG_CIFS=y
> > # CONFIG_CIFS_STATS is not set
> > CONFIG_CIFS_WEAK_PW_HASH=y
> > # CONFIG_CIFS_UPCALL is not set
> > CONFIG_CIFS_XATTR=y
> > CONFIG_CIFS_POSIX=y
> > # CONFIG_CIFS_DEBUG2 is not set
> > # CONFIG_CIFS_DFS_UPCALL is not set
> > CONFIG_CIFS_FSCACHE=y
> > CONFIG_CIFS_ACL=y
> > # CONFIG_CIFS_EXPERIMENTAL is not set
> 
> And this build regression has been pushed upstream now, as of:
> 
>    8520eeaa1235: Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
> 
> and it is triggering for me too:
> 
>    fs/built-in.o: In function `cifs_getxattr':
>    (.text+0xc518e): undefined reference to `get_cifs_acl'
> 
> The regression got introduced by:
> 
>    fbeba8bb16d7: cifs: Handle extended attribute name cifs_acl to generate cifs acl blob (try #4)
> 
> Which introduced the new CIFS_ACL option.
> 
> Thanks,
> 
> 	Ingo

Yeah, looks like this new Kconfig option depends on some code that's
under the (much-overloaded) CIFS_EXPERIMENTAL Kconfig option. I think
this patch needs some rework. The simple fix would be to make it
dependent on CIFS_EXPERIMENTAL, but that's rather icky since
CIFS_EXPERIMENTAL pulls in some rather broken stuff...

-- 
Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: Tree for December 3 (cifs)
@ 2010-12-06 12:35         ` Jeff Layton
  0 siblings, 0 replies; 23+ messages in thread
From: Jeff Layton @ 2010-12-06 12:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Randy Dunlap, Steve French, Stephen Rothwell, linux-next, LKML,
	linux-cifs, Linus Torvalds, Andrew Morton

On Mon, 6 Dec 2010 08:09:56 +0100
Ingo Molnar <mingo@elte.hu> wrote:

> 
> * Randy Dunlap <randy.dunlap@oracle.com> wrote:
> 
> > On Fri, 3 Dec 2010 13:04:40 +1100 Stephen Rothwell wrote:
> > 
> > > Hi all,
> > > 
> > > Changes since 20101202:
> > 
> > 
> > When CIFS_EXPERIMENTAL is not enabled:
> > 
> > (.text+0xdf6c9): undefined reference to `get_cifs_acl'
> > 
> > from fs/cifs/xattr.c:cifs_getxattr()
> > 
> > 
> > CONFIG_CIFS=y
> > # CONFIG_CIFS_STATS is not set
> > CONFIG_CIFS_WEAK_PW_HASH=y
> > # CONFIG_CIFS_UPCALL is not set
> > CONFIG_CIFS_XATTR=y
> > CONFIG_CIFS_POSIX=y
> > # CONFIG_CIFS_DEBUG2 is not set
> > # CONFIG_CIFS_DFS_UPCALL is not set
> > CONFIG_CIFS_FSCACHE=y
> > CONFIG_CIFS_ACL=y
> > # CONFIG_CIFS_EXPERIMENTAL is not set
> 
> And this build regression has been pushed upstream now, as of:
> 
>    8520eeaa1235: Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
> 
> and it is triggering for me too:
> 
>    fs/built-in.o: In function `cifs_getxattr':
>    (.text+0xc518e): undefined reference to `get_cifs_acl'
> 
> The regression got introduced by:
> 
>    fbeba8bb16d7: cifs: Handle extended attribute name cifs_acl to generate cifs acl blob (try #4)
> 
> Which introduced the new CIFS_ACL option.
> 
> Thanks,
> 
> 	Ingo

Yeah, looks like this new Kconfig option depends on some code that's
under the (much-overloaded) CIFS_EXPERIMENTAL Kconfig option. I think
this patch needs some rework. The simple fix would be to make it
dependent on CIFS_EXPERIMENTAL, but that's rather icky since
CIFS_EXPERIMENTAL pulls in some rather broken stuff...

-- 
Jeff Layton <jlayton@redhat.com>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: Tree for December 3 (cifs)
  2010-12-06 12:35         ` Jeff Layton
  (?)
@ 2010-12-06 15:40         ` Shirish Pargaonkar
       [not found]           ` <AANLkTimTFi6jji5wmnBTT25XYAXAhJYNY+YmqhW5McEC-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  -1 siblings, 1 reply; 23+ messages in thread
From: Shirish Pargaonkar @ 2010-12-06 15:40 UTC (permalink / raw)
  To: Jeff Layton
  Cc: Ingo Molnar, Randy Dunlap, Steve French, Stephen Rothwell,
	linux-next, LKML, linux-cifs, Linus Torvalds, Andrew Morton

On Mon, Dec 6, 2010 at 6:35 AM, Jeff Layton <jlayton@redhat.com> wrote:
> On Mon, 6 Dec 2010 08:09:56 +0100
> Ingo Molnar <mingo@elte.hu> wrote:
>
>>
>> * Randy Dunlap <randy.dunlap@oracle.com> wrote:
>>
>> > On Fri, 3 Dec 2010 13:04:40 +1100 Stephen Rothwell wrote:
>> >
>> > > Hi all,
>> > >
>> > > Changes since 20101202:
>> >
>> >
>> > When CIFS_EXPERIMENTAL is not enabled:
>> >
>> > (.text+0xdf6c9): undefined reference to `get_cifs_acl'
>> >
>> > from fs/cifs/xattr.c:cifs_getxattr()
>> >
>> >
>> > CONFIG_CIFS=y
>> > # CONFIG_CIFS_STATS is not set
>> > CONFIG_CIFS_WEAK_PW_HASH=y
>> > # CONFIG_CIFS_UPCALL is not set
>> > CONFIG_CIFS_XATTR=y
>> > CONFIG_CIFS_POSIX=y
>> > # CONFIG_CIFS_DEBUG2 is not set
>> > # CONFIG_CIFS_DFS_UPCALL is not set
>> > CONFIG_CIFS_FSCACHE=y
>> > CONFIG_CIFS_ACL=y
>> > # CONFIG_CIFS_EXPERIMENTAL is not set
>>
>> And this build regression has been pushed upstream now, as of:
>>
>>    8520eeaa1235: Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
>>
>> and it is triggering for me too:
>>
>>    fs/built-in.o: In function `cifs_getxattr':
>>    (.text+0xc518e): undefined reference to `get_cifs_acl'
>>
>> The regression got introduced by:
>>
>>    fbeba8bb16d7: cifs: Handle extended attribute name cifs_acl to generate cifs acl blob (try #4)
>>
>> Which introduced the new CIFS_ACL option.
>>
>> Thanks,
>>
>>       Ingo
>
> Yeah, looks like this new Kconfig option depends on some code that's
> under the (much-overloaded) CIFS_EXPERIMENTAL Kconfig option. I think
> this patch needs some rework. The simple fix would be to make it
> dependent on CIFS_EXPERIMENTAL, but that's rather icky since

Making CONFIG_CIFS_ACL dependent on CONFIG_CIFS_EXPERIMENTAL
works

 config CIFS_ACL
          bool "Provide CIFS ACL support (EXPERIMENTAL)"
-         depends on EXPERIMENTAL && CIFS_XATTR
+         depends on CIFS_EXPERIMENTAL && CIFS_XATTR
          help
            Allows to fetch CIFS/NTFS ACL from the server.  The DACL blob
            is handed over to the application/caller.

At the minimum function find_readable_file() and three functions
in cifssmb.c would not have to be in CIFS_EXPERIMENTAL.
And we would need to move some other cifs acl related functions
from under CIFS_ACL from CIFS_EXPERIMENTAL.

> CIFS_EXPERIMENTAL pulls in some rather broken stuff...
>
> --
> Jeff Layton <jlayton@redhat.com>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: Tree for December 3 (cifs)
  2010-12-06 15:40         ` Shirish Pargaonkar
@ 2010-12-06 15:50               ` Jeff Layton
  0 siblings, 0 replies; 23+ messages in thread
From: Jeff Layton @ 2010-12-06 15:50 UTC (permalink / raw)
  To: Shirish Pargaonkar
  Cc: Ingo Molnar, Randy Dunlap, Steve French, Stephen Rothwell,
	linux-next-u79uwXL29TY76Z2rM5mHXA, LKML,
	linux-cifs-u79uwXL29TY76Z2rM5mHXA, Linus Torvalds, Andrew Morton

On Mon, 6 Dec 2010 09:40:33 -0600
Shirish Pargaonkar <shirishpargaonkar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> On Mon, Dec 6, 2010 at 6:35 AM, Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
> > On Mon, 6 Dec 2010 08:09:56 +0100
> > Ingo Molnar <mingo-X9Un+BFzKDI@public.gmane.org> wrote:
> >
> >>
> >> * Randy Dunlap <randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> wrote:
> >>
> >> > On Fri, 3 Dec 2010 13:04:40 +1100 Stephen Rothwell wrote:
> >> >
> >> > > Hi all,
> >> > >
> >> > > Changes since 20101202:
> >> >
> >> >
> >> > When CIFS_EXPERIMENTAL is not enabled:
> >> >
> >> > (.text+0xdf6c9): undefined reference to `get_cifs_acl'
> >> >
> >> > from fs/cifs/xattr.c:cifs_getxattr()
> >> >
> >> >
> >> > CONFIG_CIFS=y
> >> > # CONFIG_CIFS_STATS is not set
> >> > CONFIG_CIFS_WEAK_PW_HASH=y
> >> > # CONFIG_CIFS_UPCALL is not set
> >> > CONFIG_CIFS_XATTR=y
> >> > CONFIG_CIFS_POSIX=y
> >> > # CONFIG_CIFS_DEBUG2 is not set
> >> > # CONFIG_CIFS_DFS_UPCALL is not set
> >> > CONFIG_CIFS_FSCACHE=y
> >> > CONFIG_CIFS_ACL=y
> >> > # CONFIG_CIFS_EXPERIMENTAL is not set
> >>
> >> And this build regression has been pushed upstream now, as of:
> >>
> >>    8520eeaa1235: Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
> >>
> >> and it is triggering for me too:
> >>
> >>    fs/built-in.o: In function `cifs_getxattr':
> >>    (.text+0xc518e): undefined reference to `get_cifs_acl'
> >>
> >> The regression got introduced by:
> >>
> >>    fbeba8bb16d7: cifs: Handle extended attribute name cifs_acl to generate cifs acl blob (try #4)
> >>
> >> Which introduced the new CIFS_ACL option.
> >>
> >> Thanks,
> >>
> >>       Ingo
> >
> > Yeah, looks like this new Kconfig option depends on some code that's
> > under the (much-overloaded) CIFS_EXPERIMENTAL Kconfig option. I think
> > this patch needs some rework. The simple fix would be to make it
> > dependent on CIFS_EXPERIMENTAL, but that's rather icky since
> 
> Making CONFIG_CIFS_ACL dependent on CONFIG_CIFS_EXPERIMENTAL
> works
> 
>  config CIFS_ACL
>           bool "Provide CIFS ACL support (EXPERIMENTAL)"
> -         depends on EXPERIMENTAL && CIFS_XATTR
> +         depends on CIFS_EXPERIMENTAL && CIFS_XATTR
>           help
>             Allows to fetch CIFS/NTFS ACL from the server.  The DACL blob
>             is handed over to the application/caller.
> 
> At the minimum function find_readable_file() and three functions
> in cifssmb.c would not have to be in CIFS_EXPERIMENTAL.
> And we would need to move some other cifs acl related functions
> from under CIFS_ACL from CIFS_EXPERIMENTAL.
> 

Ugh, let's not do that. CONFIG_CIFS_EXPERIMENTAL is like a box of
chocolates...when you enable it you just never know what you're going
to get...

I think the patch below is a better way to deal with this. It's larger
than I would like to see at this point in the release cycle, but we
might as well fix it the right way.

I also have some other patches to clean up CONFIG_CIFS_EXPERIMENTAL,
but I'll send those along separately for 2.6.38.

Steve, if this looks good, I'll send it along to you as a "formal"
patch for inclusion via your tree.

-------------------[snip]---------------------

cifs: fix use of CONFIG_CIFS_ACL

Some of the code under CONFIG_CIFS_ACL is dependent upon code under
CONFIG_CIFS_EXPERIMENTAL, but the Kconfig options don't reflect that
dependency. Move more of the ACL code out from under
CONFIG_CIFS_EXPERIMENTAL and under CONFIG_CIFS_ACL.

Also move find_readable_file out from other any sort of Kconfig
option and make it a function normally compiled in.

Reported-by: Randy Dunlap <randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 fs/cifs/Makefile    |    4 +-
 fs/cifs/cifsacl.c   |    3 -
 fs/cifs/cifsacl.h   |    4 -
 fs/cifs/cifsproto.h |    2 -
 fs/cifs/cifssmb.c   |  183 ++++++++++++++++++++++++++-------------------------
 fs/cifs/file.c      |    2 -
 fs/cifs/inode.c     |    8 +-
 7 files changed, 99 insertions(+), 107 deletions(-)

diff --git a/fs/cifs/Makefile b/fs/cifs/Makefile
index adefa60..43b19dd 100644
--- a/fs/cifs/Makefile
+++ b/fs/cifs/Makefile
@@ -6,7 +6,9 @@ obj-$(CONFIG_CIFS) += cifs.o
 cifs-y := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o \
 	  link.o misc.o netmisc.o smbdes.o smbencrypt.o transport.o asn1.o \
 	  md4.o md5.o cifs_unicode.o nterr.o xattr.o cifsencrypt.o \
-	  readdir.o ioctl.o sess.o export.o cifsacl.o
+	  readdir.o ioctl.o sess.o export.o
+
+cifs-$(CONFIG_CIFS_ACL) += cifsacl.o
 
 cifs-$(CONFIG_CIFS_UPCALL) += cifs_spnego.o
 
diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c
index c6ebea0..a437ec3 100644
--- a/fs/cifs/cifsacl.c
+++ b/fs/cifs/cifsacl.c
@@ -30,8 +30,6 @@
 #include "cifs_debug.h"
 
 
-#ifdef CONFIG_CIFS_EXPERIMENTAL
-
 static struct cifs_wksid wksidarr[NUM_WK_SIDS] = {
 	{{1, 0, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0} }, "null user"},
 	{{1, 1, {0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 0} }, "nobody"},
@@ -774,4 +772,3 @@ int mode_to_cifs_acl(struct inode *inode, const char *path, __u64 nmode)
 
 	return rc;
 }
-#endif /* CONFIG_CIFS_EXPERIMENTAL */
diff --git a/fs/cifs/cifsacl.h b/fs/cifs/cifsacl.h
index 6c8096c..c4ae7d0 100644
--- a/fs/cifs/cifsacl.h
+++ b/fs/cifs/cifsacl.h
@@ -74,11 +74,7 @@ struct cifs_wksid {
 	char sidname[SIDNAMELENGTH];
 } __attribute__((packed));
 
-#ifdef CONFIG_CIFS_EXPERIMENTAL
-
 extern int match_sid(struct cifs_sid *);
 extern int compare_sids(const struct cifs_sid *, const struct cifs_sid *);
 
-#endif /*  CONFIG_CIFS_EXPERIMENTAL */
-
 #endif /* _CIFSACL_H */
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
index 38cdec9..cb65499 100644
--- a/fs/cifs/cifsproto.h
+++ b/fs/cifs/cifsproto.h
@@ -80,9 +80,7 @@ extern bool is_valid_oplock_break(struct smb_hdr *smb,
 				  struct TCP_Server_Info *);
 extern bool is_size_safe_to_change(struct cifsInodeInfo *, __u64 eof);
 extern struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *, bool);
-#ifdef CONFIG_CIFS_EXPERIMENTAL
 extern struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *, bool);
-#endif
 extern unsigned int smbCalcSize(struct smb_hdr *ptr);
 extern unsigned int smbCalcSize_LE(struct smb_hdr *ptr);
 extern int decode_negTokenInit(unsigned char *security_blob, int length,
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 0ef7c3a..d7957a3 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -2478,95 +2478,6 @@ querySymLinkRetry:
 }
 
 #ifdef CONFIG_CIFS_EXPERIMENTAL
-/* Initialize NT TRANSACT SMB into small smb request buffer.
-   This assumes that all NT TRANSACTS that we init here have
-   total parm and data under about 400 bytes (to fit in small cifs
-   buffer size), which is the case so far, it easily fits. NB:
-	Setup words themselves and ByteCount
-	MaxSetupCount (size of returned setup area) and
-	MaxParameterCount (returned parms size) must be set by caller */
-static int
-smb_init_nttransact(const __u16 sub_command, const int setup_count,
-		   const int parm_len, struct cifsTconInfo *tcon,
-		   void **ret_buf)
-{
-	int rc;
-	__u32 temp_offset;
-	struct smb_com_ntransact_req *pSMB;
-
-	rc = small_smb_init(SMB_COM_NT_TRANSACT, 19 + setup_count, tcon,
-				(void **)&pSMB);
-	if (rc)
-		return rc;
-	*ret_buf = (void *)pSMB;
-	pSMB->Reserved = 0;
-	pSMB->TotalParameterCount = cpu_to_le32(parm_len);
-	pSMB->TotalDataCount  = 0;
-	pSMB->MaxDataCount = cpu_to_le32((tcon->ses->server->maxBuf -
-					  MAX_CIFS_HDR_SIZE) & 0xFFFFFF00);
-	pSMB->ParameterCount = pSMB->TotalParameterCount;
-	pSMB->DataCount  = pSMB->TotalDataCount;
-	temp_offset = offsetof(struct smb_com_ntransact_req, Parms) +
-			(setup_count * 2) - 4 /* for rfc1001 length itself */;
-	pSMB->ParameterOffset = cpu_to_le32(temp_offset);
-	pSMB->DataOffset = cpu_to_le32(temp_offset + parm_len);
-	pSMB->SetupCount = setup_count; /* no need to le convert byte fields */
-	pSMB->SubCommand = cpu_to_le16(sub_command);
-	return 0;
-}
-
-static int
-validate_ntransact(char *buf, char **ppparm, char **ppdata,
-		   __u32 *pparmlen, __u32 *pdatalen)
-{
-	char *end_of_smb;
-	__u32 data_count, data_offset, parm_count, parm_offset;
-	struct smb_com_ntransact_rsp *pSMBr;
-
-	*pdatalen = 0;
-	*pparmlen = 0;
-
-	if (buf == NULL)
-		return -EINVAL;
-
-	pSMBr = (struct smb_com_ntransact_rsp *)buf;
-
-	/* ByteCount was converted from little endian in SendReceive */
-	end_of_smb = 2 /* sizeof byte count */ + pSMBr->ByteCount +
-			(char *)&pSMBr->ByteCount;
-
-	data_offset = le32_to_cpu(pSMBr->DataOffset);
-	data_count = le32_to_cpu(pSMBr->DataCount);
-	parm_offset = le32_to_cpu(pSMBr->ParameterOffset);
-	parm_count = le32_to_cpu(pSMBr->ParameterCount);
-
-	*ppparm = (char *)&pSMBr->hdr.Protocol + parm_offset;
-	*ppdata = (char *)&pSMBr->hdr.Protocol + data_offset;
-
-	/* should we also check that parm and data areas do not overlap? */
-	if (*ppparm > end_of_smb) {
-		cFYI(1, "parms start after end of smb");
-		return -EINVAL;
-	} else if (parm_count + *ppparm > end_of_smb) {
-		cFYI(1, "parm end after end of smb");
-		return -EINVAL;
-	} else if (*ppdata > end_of_smb) {
-		cFYI(1, "data starts after end of smb");
-		return -EINVAL;
-	} else if (data_count + *ppdata > end_of_smb) {
-		cFYI(1, "data %p + count %d (%p) past smb end %p start %p",
-			*ppdata, data_count, (data_count + *ppdata),
-			end_of_smb, pSMBr);
-		return -EINVAL;
-	} else if (parm_count + data_count > pSMBr->ByteCount) {
-		cFYI(1, "parm count and data count larger than SMB");
-		return -EINVAL;
-	}
-	*pdatalen = data_count;
-	*pparmlen = parm_count;
-	return 0;
-}
-
 int
 CIFSSMBQueryReparseLinkInfo(const int xid, struct cifsTconInfo *tcon,
 			const unsigned char *searchName,
@@ -3056,7 +2967,97 @@ GetExtAttrOut:
 
 #endif /* CONFIG_POSIX */
 
-#ifdef CONFIG_CIFS_EXPERIMENTAL
+#ifdef CONFIG_CIFS_ACL
+/*
+ * Initialize NT TRANSACT SMB into small smb request buffer.  This assumes that
+ * all NT TRANSACTS that we init here have total parm and data under about 400
+ * bytes (to fit in small cifs buffer size), which is the case so far, it
+ * easily fits. NB: Setup words themselves and ByteCount MaxSetupCount (size of
+ * returned setup area) and MaxParameterCount (returned parms size) must be set
+ * by caller
+ */
+static int
+smb_init_nttransact(const __u16 sub_command, const int setup_count,
+		   const int parm_len, struct cifsTconInfo *tcon,
+		   void **ret_buf)
+{
+	int rc;
+	__u32 temp_offset;
+	struct smb_com_ntransact_req *pSMB;
+
+	rc = small_smb_init(SMB_COM_NT_TRANSACT, 19 + setup_count, tcon,
+				(void **)&pSMB);
+	if (rc)
+		return rc;
+	*ret_buf = (void *)pSMB;
+	pSMB->Reserved = 0;
+	pSMB->TotalParameterCount = cpu_to_le32(parm_len);
+	pSMB->TotalDataCount  = 0;
+	pSMB->MaxDataCount = cpu_to_le32((tcon->ses->server->maxBuf -
+					  MAX_CIFS_HDR_SIZE) & 0xFFFFFF00);
+	pSMB->ParameterCount = pSMB->TotalParameterCount;
+	pSMB->DataCount  = pSMB->TotalDataCount;
+	temp_offset = offsetof(struct smb_com_ntransact_req, Parms) +
+			(setup_count * 2) - 4 /* for rfc1001 length itself */;
+	pSMB->ParameterOffset = cpu_to_le32(temp_offset);
+	pSMB->DataOffset = cpu_to_le32(temp_offset + parm_len);
+	pSMB->SetupCount = setup_count; /* no need to le convert byte fields */
+	pSMB->SubCommand = cpu_to_le16(sub_command);
+	return 0;
+}
+
+static int
+validate_ntransact(char *buf, char **ppparm, char **ppdata,
+		   __u32 *pparmlen, __u32 *pdatalen)
+{
+	char *end_of_smb;
+	__u32 data_count, data_offset, parm_count, parm_offset;
+	struct smb_com_ntransact_rsp *pSMBr;
+
+	*pdatalen = 0;
+	*pparmlen = 0;
+
+	if (buf == NULL)
+		return -EINVAL;
+
+	pSMBr = (struct smb_com_ntransact_rsp *)buf;
+
+	/* ByteCount was converted from little endian in SendReceive */
+	end_of_smb = 2 /* sizeof byte count */ + pSMBr->ByteCount +
+			(char *)&pSMBr->ByteCount;
+
+	data_offset = le32_to_cpu(pSMBr->DataOffset);
+	data_count = le32_to_cpu(pSMBr->DataCount);
+	parm_offset = le32_to_cpu(pSMBr->ParameterOffset);
+	parm_count = le32_to_cpu(pSMBr->ParameterCount);
+
+	*ppparm = (char *)&pSMBr->hdr.Protocol + parm_offset;
+	*ppdata = (char *)&pSMBr->hdr.Protocol + data_offset;
+
+	/* should we also check that parm and data areas do not overlap? */
+	if (*ppparm > end_of_smb) {
+		cFYI(1, "parms start after end of smb");
+		return -EINVAL;
+	} else if (parm_count + *ppparm > end_of_smb) {
+		cFYI(1, "parm end after end of smb");
+		return -EINVAL;
+	} else if (*ppdata > end_of_smb) {
+		cFYI(1, "data starts after end of smb");
+		return -EINVAL;
+	} else if (data_count + *ppdata > end_of_smb) {
+		cFYI(1, "data %p + count %d (%p) past smb end %p start %p",
+			*ppdata, data_count, (data_count + *ppdata),
+			end_of_smb, pSMBr);
+		return -EINVAL;
+	} else if (parm_count + data_count > pSMBr->ByteCount) {
+		cFYI(1, "parm count and data count larger than SMB");
+		return -EINVAL;
+	}
+	*pdatalen = data_count;
+	*pparmlen = parm_count;
+	return 0;
+}
+
 /* Get Security Descriptor (by handle) from remote server for a file or dir */
 int
 CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, __u16 fid,
@@ -3214,7 +3215,7 @@ setCifsAclRetry:
 	return (rc);
 }
 
-#endif /* CONFIG_CIFS_EXPERIMENTAL */
+#endif /* CONFIG_CIFS_ACL */
 
 /* Legacy Query Path Information call for lookup to old servers such
    as Win9x/WinME */
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index b857ce5..5a28660 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -1108,7 +1108,6 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file,
 	return total_written;
 }
 
-#ifdef CONFIG_CIFS_EXPERIMENTAL
 struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode,
 					bool fsuid_only)
 {
@@ -1142,7 +1141,6 @@ struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode,
 	spin_unlock(&cifs_file_list_lock);
 	return NULL;
 }
-#endif
 
 struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode,
 					bool fsuid_only)
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 0023146..10d1cab 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -687,7 +687,7 @@ int cifs_get_inode_info(struct inode **pinode,
 			cFYI(1, "cifs_sfu_type failed: %d", tmprc);
 	}
 
-#ifdef CONFIG_CIFS_EXPERIMENTAL
+#ifdef CONFIG_CIFS_ACL
 	/* fill in 0777 bits from ACL */
 	if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
 		rc = cifs_acl_to_fattr(cifs_sb, &fattr, *pinode, full_path,
@@ -698,7 +698,7 @@ int cifs_get_inode_info(struct inode **pinode,
 			goto cgii_exit;
 		}
 	}
-#endif
+#endif /* CONFIG_CIFS_ACL */
 
 	/* fill in remaining high mode bits e.g. SUID, VTX */
 	if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL)
@@ -2128,7 +2128,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
 
 	if (attrs->ia_valid & ATTR_MODE) {
 		rc = 0;
-#ifdef CONFIG_CIFS_EXPERIMENTAL
+#ifdef CONFIG_CIFS_ACL
 		if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
 			rc = mode_to_cifs_acl(inode, full_path, mode);
 			if (rc) {
@@ -2137,7 +2137,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
 				goto cifs_setattr_exit;
 			}
 		} else
-#endif
+#endif /* CONFIG_CIFS_ACL */
 		if (((mode & S_IWUGO) == 0) &&
 		    (cifsInode->cifsAttrs & ATTR_READONLY) == 0) {
 
-- 
1.7.3.2

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: linux-next: Tree for December 3 (cifs)
@ 2010-12-06 15:50               ` Jeff Layton
  0 siblings, 0 replies; 23+ messages in thread
From: Jeff Layton @ 2010-12-06 15:50 UTC (permalink / raw)
  To: Shirish Pargaonkar
  Cc: Ingo Molnar, Randy Dunlap, Steve French, Stephen Rothwell,
	linux-next, LKML, linux-cifs, Linus Torvalds, Andrew Morton

On Mon, 6 Dec 2010 09:40:33 -0600
Shirish Pargaonkar <shirishpargaonkar@gmail.com> wrote:

> On Mon, Dec 6, 2010 at 6:35 AM, Jeff Layton <jlayton@redhat.com> wrote:
> > On Mon, 6 Dec 2010 08:09:56 +0100
> > Ingo Molnar <mingo@elte.hu> wrote:
> >
> >>
> >> * Randy Dunlap <randy.dunlap@oracle.com> wrote:
> >>
> >> > On Fri, 3 Dec 2010 13:04:40 +1100 Stephen Rothwell wrote:
> >> >
> >> > > Hi all,
> >> > >
> >> > > Changes since 20101202:
> >> >
> >> >
> >> > When CIFS_EXPERIMENTAL is not enabled:
> >> >
> >> > (.text+0xdf6c9): undefined reference to `get_cifs_acl'
> >> >
> >> > from fs/cifs/xattr.c:cifs_getxattr()
> >> >
> >> >
> >> > CONFIG_CIFS=y
> >> > # CONFIG_CIFS_STATS is not set
> >> > CONFIG_CIFS_WEAK_PW_HASH=y
> >> > # CONFIG_CIFS_UPCALL is not set
> >> > CONFIG_CIFS_XATTR=y
> >> > CONFIG_CIFS_POSIX=y
> >> > # CONFIG_CIFS_DEBUG2 is not set
> >> > # CONFIG_CIFS_DFS_UPCALL is not set
> >> > CONFIG_CIFS_FSCACHE=y
> >> > CONFIG_CIFS_ACL=y
> >> > # CONFIG_CIFS_EXPERIMENTAL is not set
> >>
> >> And this build regression has been pushed upstream now, as of:
> >>
> >>    8520eeaa1235: Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
> >>
> >> and it is triggering for me too:
> >>
> >>    fs/built-in.o: In function `cifs_getxattr':
> >>    (.text+0xc518e): undefined reference to `get_cifs_acl'
> >>
> >> The regression got introduced by:
> >>
> >>    fbeba8bb16d7: cifs: Handle extended attribute name cifs_acl to generate cifs acl blob (try #4)
> >>
> >> Which introduced the new CIFS_ACL option.
> >>
> >> Thanks,
> >>
> >>       Ingo
> >
> > Yeah, looks like this new Kconfig option depends on some code that's
> > under the (much-overloaded) CIFS_EXPERIMENTAL Kconfig option. I think
> > this patch needs some rework. The simple fix would be to make it
> > dependent on CIFS_EXPERIMENTAL, but that's rather icky since
> 
> Making CONFIG_CIFS_ACL dependent on CONFIG_CIFS_EXPERIMENTAL
> works
> 
>  config CIFS_ACL
>           bool "Provide CIFS ACL support (EXPERIMENTAL)"
> -         depends on EXPERIMENTAL && CIFS_XATTR
> +         depends on CIFS_EXPERIMENTAL && CIFS_XATTR
>           help
>             Allows to fetch CIFS/NTFS ACL from the server.  The DACL blob
>             is handed over to the application/caller.
> 
> At the minimum function find_readable_file() and three functions
> in cifssmb.c would not have to be in CIFS_EXPERIMENTAL.
> And we would need to move some other cifs acl related functions
> from under CIFS_ACL from CIFS_EXPERIMENTAL.
> 

Ugh, let's not do that. CONFIG_CIFS_EXPERIMENTAL is like a box of
chocolates...when you enable it you just never know what you're going
to get...

I think the patch below is a better way to deal with this. It's larger
than I would like to see at this point in the release cycle, but we
might as well fix it the right way.

I also have some other patches to clean up CONFIG_CIFS_EXPERIMENTAL,
but I'll send those along separately for 2.6.38.

Steve, if this looks good, I'll send it along to you as a "formal"
patch for inclusion via your tree.

-------------------[snip]---------------------

cifs: fix use of CONFIG_CIFS_ACL

Some of the code under CONFIG_CIFS_ACL is dependent upon code under
CONFIG_CIFS_EXPERIMENTAL, but the Kconfig options don't reflect that
dependency. Move more of the ACL code out from under
CONFIG_CIFS_EXPERIMENTAL and under CONFIG_CIFS_ACL.

Also move find_readable_file out from other any sort of Kconfig
option and make it a function normally compiled in.

Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
 fs/cifs/Makefile    |    4 +-
 fs/cifs/cifsacl.c   |    3 -
 fs/cifs/cifsacl.h   |    4 -
 fs/cifs/cifsproto.h |    2 -
 fs/cifs/cifssmb.c   |  183 ++++++++++++++++++++++++++-------------------------
 fs/cifs/file.c      |    2 -
 fs/cifs/inode.c     |    8 +-
 7 files changed, 99 insertions(+), 107 deletions(-)

diff --git a/fs/cifs/Makefile b/fs/cifs/Makefile
index adefa60..43b19dd 100644
--- a/fs/cifs/Makefile
+++ b/fs/cifs/Makefile
@@ -6,7 +6,9 @@ obj-$(CONFIG_CIFS) += cifs.o
 cifs-y := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o \
 	  link.o misc.o netmisc.o smbdes.o smbencrypt.o transport.o asn1.o \
 	  md4.o md5.o cifs_unicode.o nterr.o xattr.o cifsencrypt.o \
-	  readdir.o ioctl.o sess.o export.o cifsacl.o
+	  readdir.o ioctl.o sess.o export.o
+
+cifs-$(CONFIG_CIFS_ACL) += cifsacl.o
 
 cifs-$(CONFIG_CIFS_UPCALL) += cifs_spnego.o
 
diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c
index c6ebea0..a437ec3 100644
--- a/fs/cifs/cifsacl.c
+++ b/fs/cifs/cifsacl.c
@@ -30,8 +30,6 @@
 #include "cifs_debug.h"
 
 
-#ifdef CONFIG_CIFS_EXPERIMENTAL
-
 static struct cifs_wksid wksidarr[NUM_WK_SIDS] = {
 	{{1, 0, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0} }, "null user"},
 	{{1, 1, {0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 0} }, "nobody"},
@@ -774,4 +772,3 @@ int mode_to_cifs_acl(struct inode *inode, const char *path, __u64 nmode)
 
 	return rc;
 }
-#endif /* CONFIG_CIFS_EXPERIMENTAL */
diff --git a/fs/cifs/cifsacl.h b/fs/cifs/cifsacl.h
index 6c8096c..c4ae7d0 100644
--- a/fs/cifs/cifsacl.h
+++ b/fs/cifs/cifsacl.h
@@ -74,11 +74,7 @@ struct cifs_wksid {
 	char sidname[SIDNAMELENGTH];
 } __attribute__((packed));
 
-#ifdef CONFIG_CIFS_EXPERIMENTAL
-
 extern int match_sid(struct cifs_sid *);
 extern int compare_sids(const struct cifs_sid *, const struct cifs_sid *);
 
-#endif /*  CONFIG_CIFS_EXPERIMENTAL */
-
 #endif /* _CIFSACL_H */
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
index 38cdec9..cb65499 100644
--- a/fs/cifs/cifsproto.h
+++ b/fs/cifs/cifsproto.h
@@ -80,9 +80,7 @@ extern bool is_valid_oplock_break(struct smb_hdr *smb,
 				  struct TCP_Server_Info *);
 extern bool is_size_safe_to_change(struct cifsInodeInfo *, __u64 eof);
 extern struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *, bool);
-#ifdef CONFIG_CIFS_EXPERIMENTAL
 extern struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *, bool);
-#endif
 extern unsigned int smbCalcSize(struct smb_hdr *ptr);
 extern unsigned int smbCalcSize_LE(struct smb_hdr *ptr);
 extern int decode_negTokenInit(unsigned char *security_blob, int length,
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 0ef7c3a..d7957a3 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -2478,95 +2478,6 @@ querySymLinkRetry:
 }
 
 #ifdef CONFIG_CIFS_EXPERIMENTAL
-/* Initialize NT TRANSACT SMB into small smb request buffer.
-   This assumes that all NT TRANSACTS that we init here have
-   total parm and data under about 400 bytes (to fit in small cifs
-   buffer size), which is the case so far, it easily fits. NB:
-	Setup words themselves and ByteCount
-	MaxSetupCount (size of returned setup area) and
-	MaxParameterCount (returned parms size) must be set by caller */
-static int
-smb_init_nttransact(const __u16 sub_command, const int setup_count,
-		   const int parm_len, struct cifsTconInfo *tcon,
-		   void **ret_buf)
-{
-	int rc;
-	__u32 temp_offset;
-	struct smb_com_ntransact_req *pSMB;
-
-	rc = small_smb_init(SMB_COM_NT_TRANSACT, 19 + setup_count, tcon,
-				(void **)&pSMB);
-	if (rc)
-		return rc;
-	*ret_buf = (void *)pSMB;
-	pSMB->Reserved = 0;
-	pSMB->TotalParameterCount = cpu_to_le32(parm_len);
-	pSMB->TotalDataCount  = 0;
-	pSMB->MaxDataCount = cpu_to_le32((tcon->ses->server->maxBuf -
-					  MAX_CIFS_HDR_SIZE) & 0xFFFFFF00);
-	pSMB->ParameterCount = pSMB->TotalParameterCount;
-	pSMB->DataCount  = pSMB->TotalDataCount;
-	temp_offset = offsetof(struct smb_com_ntransact_req, Parms) +
-			(setup_count * 2) - 4 /* for rfc1001 length itself */;
-	pSMB->ParameterOffset = cpu_to_le32(temp_offset);
-	pSMB->DataOffset = cpu_to_le32(temp_offset + parm_len);
-	pSMB->SetupCount = setup_count; /* no need to le convert byte fields */
-	pSMB->SubCommand = cpu_to_le16(sub_command);
-	return 0;
-}
-
-static int
-validate_ntransact(char *buf, char **ppparm, char **ppdata,
-		   __u32 *pparmlen, __u32 *pdatalen)
-{
-	char *end_of_smb;
-	__u32 data_count, data_offset, parm_count, parm_offset;
-	struct smb_com_ntransact_rsp *pSMBr;
-
-	*pdatalen = 0;
-	*pparmlen = 0;
-
-	if (buf == NULL)
-		return -EINVAL;
-
-	pSMBr = (struct smb_com_ntransact_rsp *)buf;
-
-	/* ByteCount was converted from little endian in SendReceive */
-	end_of_smb = 2 /* sizeof byte count */ + pSMBr->ByteCount +
-			(char *)&pSMBr->ByteCount;
-
-	data_offset = le32_to_cpu(pSMBr->DataOffset);
-	data_count = le32_to_cpu(pSMBr->DataCount);
-	parm_offset = le32_to_cpu(pSMBr->ParameterOffset);
-	parm_count = le32_to_cpu(pSMBr->ParameterCount);
-
-	*ppparm = (char *)&pSMBr->hdr.Protocol + parm_offset;
-	*ppdata = (char *)&pSMBr->hdr.Protocol + data_offset;
-
-	/* should we also check that parm and data areas do not overlap? */
-	if (*ppparm > end_of_smb) {
-		cFYI(1, "parms start after end of smb");
-		return -EINVAL;
-	} else if (parm_count + *ppparm > end_of_smb) {
-		cFYI(1, "parm end after end of smb");
-		return -EINVAL;
-	} else if (*ppdata > end_of_smb) {
-		cFYI(1, "data starts after end of smb");
-		return -EINVAL;
-	} else if (data_count + *ppdata > end_of_smb) {
-		cFYI(1, "data %p + count %d (%p) past smb end %p start %p",
-			*ppdata, data_count, (data_count + *ppdata),
-			end_of_smb, pSMBr);
-		return -EINVAL;
-	} else if (parm_count + data_count > pSMBr->ByteCount) {
-		cFYI(1, "parm count and data count larger than SMB");
-		return -EINVAL;
-	}
-	*pdatalen = data_count;
-	*pparmlen = parm_count;
-	return 0;
-}
-
 int
 CIFSSMBQueryReparseLinkInfo(const int xid, struct cifsTconInfo *tcon,
 			const unsigned char *searchName,
@@ -3056,7 +2967,97 @@ GetExtAttrOut:
 
 #endif /* CONFIG_POSIX */
 
-#ifdef CONFIG_CIFS_EXPERIMENTAL
+#ifdef CONFIG_CIFS_ACL
+/*
+ * Initialize NT TRANSACT SMB into small smb request buffer.  This assumes that
+ * all NT TRANSACTS that we init here have total parm and data under about 400
+ * bytes (to fit in small cifs buffer size), which is the case so far, it
+ * easily fits. NB: Setup words themselves and ByteCount MaxSetupCount (size of
+ * returned setup area) and MaxParameterCount (returned parms size) must be set
+ * by caller
+ */
+static int
+smb_init_nttransact(const __u16 sub_command, const int setup_count,
+		   const int parm_len, struct cifsTconInfo *tcon,
+		   void **ret_buf)
+{
+	int rc;
+	__u32 temp_offset;
+	struct smb_com_ntransact_req *pSMB;
+
+	rc = small_smb_init(SMB_COM_NT_TRANSACT, 19 + setup_count, tcon,
+				(void **)&pSMB);
+	if (rc)
+		return rc;
+	*ret_buf = (void *)pSMB;
+	pSMB->Reserved = 0;
+	pSMB->TotalParameterCount = cpu_to_le32(parm_len);
+	pSMB->TotalDataCount  = 0;
+	pSMB->MaxDataCount = cpu_to_le32((tcon->ses->server->maxBuf -
+					  MAX_CIFS_HDR_SIZE) & 0xFFFFFF00);
+	pSMB->ParameterCount = pSMB->TotalParameterCount;
+	pSMB->DataCount  = pSMB->TotalDataCount;
+	temp_offset = offsetof(struct smb_com_ntransact_req, Parms) +
+			(setup_count * 2) - 4 /* for rfc1001 length itself */;
+	pSMB->ParameterOffset = cpu_to_le32(temp_offset);
+	pSMB->DataOffset = cpu_to_le32(temp_offset + parm_len);
+	pSMB->SetupCount = setup_count; /* no need to le convert byte fields */
+	pSMB->SubCommand = cpu_to_le16(sub_command);
+	return 0;
+}
+
+static int
+validate_ntransact(char *buf, char **ppparm, char **ppdata,
+		   __u32 *pparmlen, __u32 *pdatalen)
+{
+	char *end_of_smb;
+	__u32 data_count, data_offset, parm_count, parm_offset;
+	struct smb_com_ntransact_rsp *pSMBr;
+
+	*pdatalen = 0;
+	*pparmlen = 0;
+
+	if (buf == NULL)
+		return -EINVAL;
+
+	pSMBr = (struct smb_com_ntransact_rsp *)buf;
+
+	/* ByteCount was converted from little endian in SendReceive */
+	end_of_smb = 2 /* sizeof byte count */ + pSMBr->ByteCount +
+			(char *)&pSMBr->ByteCount;
+
+	data_offset = le32_to_cpu(pSMBr->DataOffset);
+	data_count = le32_to_cpu(pSMBr->DataCount);
+	parm_offset = le32_to_cpu(pSMBr->ParameterOffset);
+	parm_count = le32_to_cpu(pSMBr->ParameterCount);
+
+	*ppparm = (char *)&pSMBr->hdr.Protocol + parm_offset;
+	*ppdata = (char *)&pSMBr->hdr.Protocol + data_offset;
+
+	/* should we also check that parm and data areas do not overlap? */
+	if (*ppparm > end_of_smb) {
+		cFYI(1, "parms start after end of smb");
+		return -EINVAL;
+	} else if (parm_count + *ppparm > end_of_smb) {
+		cFYI(1, "parm end after end of smb");
+		return -EINVAL;
+	} else if (*ppdata > end_of_smb) {
+		cFYI(1, "data starts after end of smb");
+		return -EINVAL;
+	} else if (data_count + *ppdata > end_of_smb) {
+		cFYI(1, "data %p + count %d (%p) past smb end %p start %p",
+			*ppdata, data_count, (data_count + *ppdata),
+			end_of_smb, pSMBr);
+		return -EINVAL;
+	} else if (parm_count + data_count > pSMBr->ByteCount) {
+		cFYI(1, "parm count and data count larger than SMB");
+		return -EINVAL;
+	}
+	*pdatalen = data_count;
+	*pparmlen = parm_count;
+	return 0;
+}
+
 /* Get Security Descriptor (by handle) from remote server for a file or dir */
 int
 CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, __u16 fid,
@@ -3214,7 +3215,7 @@ setCifsAclRetry:
 	return (rc);
 }
 
-#endif /* CONFIG_CIFS_EXPERIMENTAL */
+#endif /* CONFIG_CIFS_ACL */
 
 /* Legacy Query Path Information call for lookup to old servers such
    as Win9x/WinME */
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index b857ce5..5a28660 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -1108,7 +1108,6 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file,
 	return total_written;
 }
 
-#ifdef CONFIG_CIFS_EXPERIMENTAL
 struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode,
 					bool fsuid_only)
 {
@@ -1142,7 +1141,6 @@ struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode,
 	spin_unlock(&cifs_file_list_lock);
 	return NULL;
 }
-#endif
 
 struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode,
 					bool fsuid_only)
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 0023146..10d1cab 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -687,7 +687,7 @@ int cifs_get_inode_info(struct inode **pinode,
 			cFYI(1, "cifs_sfu_type failed: %d", tmprc);
 	}
 
-#ifdef CONFIG_CIFS_EXPERIMENTAL
+#ifdef CONFIG_CIFS_ACL
 	/* fill in 0777 bits from ACL */
 	if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
 		rc = cifs_acl_to_fattr(cifs_sb, &fattr, *pinode, full_path,
@@ -698,7 +698,7 @@ int cifs_get_inode_info(struct inode **pinode,
 			goto cgii_exit;
 		}
 	}
-#endif
+#endif /* CONFIG_CIFS_ACL */
 
 	/* fill in remaining high mode bits e.g. SUID, VTX */
 	if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL)
@@ -2128,7 +2128,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
 
 	if (attrs->ia_valid & ATTR_MODE) {
 		rc = 0;
-#ifdef CONFIG_CIFS_EXPERIMENTAL
+#ifdef CONFIG_CIFS_ACL
 		if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
 			rc = mode_to_cifs_acl(inode, full_path, mode);
 			if (rc) {
@@ -2137,7 +2137,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
 				goto cifs_setattr_exit;
 			}
 		} else
-#endif
+#endif /* CONFIG_CIFS_ACL */
 		if (((mode & S_IWUGO) == 0) &&
 		    (cifsInode->cifsAttrs & ATTR_READONLY) == 0) {
 
-- 
1.7.3.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: linux-next: Tree for December 3 (cifs)
  2010-12-06 15:50               ` Jeff Layton
@ 2010-12-06 16:13                   ` Shirish Pargaonkar
  -1 siblings, 0 replies; 23+ messages in thread
From: Shirish Pargaonkar @ 2010-12-06 16:13 UTC (permalink / raw)
  To: Jeff Layton
  Cc: Ingo Molnar, Randy Dunlap, Steve French, Stephen Rothwell,
	linux-next-u79uwXL29TY76Z2rM5mHXA, LKML,
	linux-cifs-u79uwXL29TY76Z2rM5mHXA, Linus Torvalds, Andrew Morton

On Mon, Dec 6, 2010 at 9:50 AM, Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
> On Mon, 6 Dec 2010 09:40:33 -0600
> Shirish Pargaonkar <shirishpargaonkar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
>> On Mon, Dec 6, 2010 at 6:35 AM, Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
>> > On Mon, 6 Dec 2010 08:09:56 +0100
>> > Ingo Molnar <mingo-X9Un+BFzKDI@public.gmane.org> wrote:
>> >
>> >>
>> >> * Randy Dunlap <randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> wrote:
>> >>
>> >> > On Fri, 3 Dec 2010 13:04:40 +1100 Stephen Rothwell wrote:
>> >> >
>> >> > > Hi all,
>> >> > >
>> >> > > Changes since 20101202:
>> >> >
>> >> >
>> >> > When CIFS_EXPERIMENTAL is not enabled:
>> >> >
>> >> > (.text+0xdf6c9): undefined reference to `get_cifs_acl'
>> >> >
>> >> > from fs/cifs/xattr.c:cifs_getxattr()
>> >> >
>> >> >
>> >> > CONFIG_CIFS=y
>> >> > # CONFIG_CIFS_STATS is not set
>> >> > CONFIG_CIFS_WEAK_PW_HASH=y
>> >> > # CONFIG_CIFS_UPCALL is not set
>> >> > CONFIG_CIFS_XATTR=y
>> >> > CONFIG_CIFS_POSIX=y
>> >> > # CONFIG_CIFS_DEBUG2 is not set
>> >> > # CONFIG_CIFS_DFS_UPCALL is not set
>> >> > CONFIG_CIFS_FSCACHE=y
>> >> > CONFIG_CIFS_ACL=y
>> >> > # CONFIG_CIFS_EXPERIMENTAL is not set
>> >>
>> >> And this build regression has been pushed upstream now, as of:
>> >>
>> >>    8520eeaa1235: Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
>> >>
>> >> and it is triggering for me too:
>> >>
>> >>    fs/built-in.o: In function `cifs_getxattr':
>> >>    (.text+0xc518e): undefined reference to `get_cifs_acl'
>> >>
>> >> The regression got introduced by:
>> >>
>> >>    fbeba8bb16d7: cifs: Handle extended attribute name cifs_acl to generate cifs acl blob (try #4)
>> >>
>> >> Which introduced the new CIFS_ACL option.
>> >>
>> >> Thanks,
>> >>
>> >>       Ingo
>> >
>> > Yeah, looks like this new Kconfig option depends on some code that's
>> > under the (much-overloaded) CIFS_EXPERIMENTAL Kconfig option. I think
>> > this patch needs some rework. The simple fix would be to make it
>> > dependent on CIFS_EXPERIMENTAL, but that's rather icky since
>>
>> Making CONFIG_CIFS_ACL dependent on CONFIG_CIFS_EXPERIMENTAL
>> works
>>
>>  config CIFS_ACL
>>           bool "Provide CIFS ACL support (EXPERIMENTAL)"
>> -         depends on EXPERIMENTAL && CIFS_XATTR
>> +         depends on CIFS_EXPERIMENTAL && CIFS_XATTR
>>           help
>>             Allows to fetch CIFS/NTFS ACL from the server.  The DACL blob
>>             is handed over to the application/caller.
>>
>> At the minimum function find_readable_file() and three functions
>> in cifssmb.c would not have to be in CIFS_EXPERIMENTAL.
>> And we would need to move some other cifs acl related functions
>> from under CIFS_ACL from CIFS_EXPERIMENTAL.
>>
>
> Ugh, let's not do that. CONFIG_CIFS_EXPERIMENTAL is like a box of
> chocolates...when you enable it you just never know what you're going
> to get...
>
> I think the patch below is a better way to deal with this. It's larger
> than I would like to see at this point in the release cycle, but we
> might as well fix it the right way.
>
> I also have some other patches to clean up CONFIG_CIFS_EXPERIMENTAL,
> but I'll send those along separately for 2.6.38.
>
> Steve, if this looks good, I'll send it along to you as a "formal"
> patch for inclusion via your tree.
>
> -------------------[snip]---------------------
>
> cifs: fix use of CONFIG_CIFS_ACL
>
> Some of the code under CONFIG_CIFS_ACL is dependent upon code under
> CONFIG_CIFS_EXPERIMENTAL, but the Kconfig options don't reflect that
> dependency. Move more of the ACL code out from under
> CONFIG_CIFS_EXPERIMENTAL and under CONFIG_CIFS_ACL.
>
> Also move find_readable_file out from other any sort of Kconfig
> option and make it a function normally compiled in.
>
> Reported-by: Randy Dunlap <randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
>  fs/cifs/Makefile    |    4 +-
>  fs/cifs/cifsacl.c   |    3 -
>  fs/cifs/cifsacl.h   |    4 -
>  fs/cifs/cifsproto.h |    2 -
>  fs/cifs/cifssmb.c   |  183 ++++++++++++++++++++++++++-------------------------
>  fs/cifs/file.c      |    2 -
>  fs/cifs/inode.c     |    8 +-
>  7 files changed, 99 insertions(+), 107 deletions(-)
>
> diff --git a/fs/cifs/Makefile b/fs/cifs/Makefile
> index adefa60..43b19dd 100644
> --- a/fs/cifs/Makefile
> +++ b/fs/cifs/Makefile
> @@ -6,7 +6,9 @@ obj-$(CONFIG_CIFS) += cifs.o
>  cifs-y := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o \
>          link.o misc.o netmisc.o smbdes.o smbencrypt.o transport.o asn1.o \
>          md4.o md5.o cifs_unicode.o nterr.o xattr.o cifsencrypt.o \
> -         readdir.o ioctl.o sess.o export.o cifsacl.o
> +         readdir.o ioctl.o sess.o export.o
> +
> +cifs-$(CONFIG_CIFS_ACL) += cifsacl.o
>
>  cifs-$(CONFIG_CIFS_UPCALL) += cifs_spnego.o
>
> diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c
> index c6ebea0..a437ec3 100644
> --- a/fs/cifs/cifsacl.c
> +++ b/fs/cifs/cifsacl.c
> @@ -30,8 +30,6 @@
>  #include "cifs_debug.h"
>
>
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
> -
>  static struct cifs_wksid wksidarr[NUM_WK_SIDS] = {
>        {{1, 0, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0} }, "null user"},
>        {{1, 1, {0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 0} }, "nobody"},
> @@ -774,4 +772,3 @@ int mode_to_cifs_acl(struct inode *inode, const char *path, __u64 nmode)
>
>        return rc;
>  }
> -#endif /* CONFIG_CIFS_EXPERIMENTAL */
> diff --git a/fs/cifs/cifsacl.h b/fs/cifs/cifsacl.h
> index 6c8096c..c4ae7d0 100644
> --- a/fs/cifs/cifsacl.h
> +++ b/fs/cifs/cifsacl.h
> @@ -74,11 +74,7 @@ struct cifs_wksid {
>        char sidname[SIDNAMELENGTH];
>  } __attribute__((packed));
>
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
> -
>  extern int match_sid(struct cifs_sid *);
>  extern int compare_sids(const struct cifs_sid *, const struct cifs_sid *);
>
> -#endif /*  CONFIG_CIFS_EXPERIMENTAL */
> -
>  #endif /* _CIFSACL_H */
> diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
> index 38cdec9..cb65499 100644
> --- a/fs/cifs/cifsproto.h
> +++ b/fs/cifs/cifsproto.h
> @@ -80,9 +80,7 @@ extern bool is_valid_oplock_break(struct smb_hdr *smb,
>                                  struct TCP_Server_Info *);
>  extern bool is_size_safe_to_change(struct cifsInodeInfo *, __u64 eof);
>  extern struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *, bool);
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
>  extern struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *, bool);
> -#endif
>  extern unsigned int smbCalcSize(struct smb_hdr *ptr);
>  extern unsigned int smbCalcSize_LE(struct smb_hdr *ptr);
>  extern int decode_negTokenInit(unsigned char *security_blob, int length,
> diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
> index 0ef7c3a..d7957a3 100644
> --- a/fs/cifs/cifssmb.c
> +++ b/fs/cifs/cifssmb.c
> @@ -2478,95 +2478,6 @@ querySymLinkRetry:
>  }
>
>  #ifdef CONFIG_CIFS_EXPERIMENTAL
> -/* Initialize NT TRANSACT SMB into small smb request buffer.
> -   This assumes that all NT TRANSACTS that we init here have
> -   total parm and data under about 400 bytes (to fit in small cifs
> -   buffer size), which is the case so far, it easily fits. NB:
> -       Setup words themselves and ByteCount
> -       MaxSetupCount (size of returned setup area) and
> -       MaxParameterCount (returned parms size) must be set by caller */
> -static int
> -smb_init_nttransact(const __u16 sub_command, const int setup_count,
> -                  const int parm_len, struct cifsTconInfo *tcon,
> -                  void **ret_buf)
> -{
> -       int rc;
> -       __u32 temp_offset;
> -       struct smb_com_ntransact_req *pSMB;
> -
> -       rc = small_smb_init(SMB_COM_NT_TRANSACT, 19 + setup_count, tcon,
> -                               (void **)&pSMB);
> -       if (rc)
> -               return rc;
> -       *ret_buf = (void *)pSMB;
> -       pSMB->Reserved = 0;
> -       pSMB->TotalParameterCount = cpu_to_le32(parm_len);
> -       pSMB->TotalDataCount  = 0;
> -       pSMB->MaxDataCount = cpu_to_le32((tcon->ses->server->maxBuf -
> -                                         MAX_CIFS_HDR_SIZE) & 0xFFFFFF00);
> -       pSMB->ParameterCount = pSMB->TotalParameterCount;
> -       pSMB->DataCount  = pSMB->TotalDataCount;
> -       temp_offset = offsetof(struct smb_com_ntransact_req, Parms) +
> -                       (setup_count * 2) - 4 /* for rfc1001 length itself */;
> -       pSMB->ParameterOffset = cpu_to_le32(temp_offset);
> -       pSMB->DataOffset = cpu_to_le32(temp_offset + parm_len);
> -       pSMB->SetupCount = setup_count; /* no need to le convert byte fields */
> -       pSMB->SubCommand = cpu_to_le16(sub_command);
> -       return 0;
> -}
> -
> -static int
> -validate_ntransact(char *buf, char **ppparm, char **ppdata,
> -                  __u32 *pparmlen, __u32 *pdatalen)
> -{
> -       char *end_of_smb;
> -       __u32 data_count, data_offset, parm_count, parm_offset;
> -       struct smb_com_ntransact_rsp *pSMBr;
> -
> -       *pdatalen = 0;
> -       *pparmlen = 0;
> -
> -       if (buf == NULL)
> -               return -EINVAL;
> -
> -       pSMBr = (struct smb_com_ntransact_rsp *)buf;
> -
> -       /* ByteCount was converted from little endian in SendReceive */
> -       end_of_smb = 2 /* sizeof byte count */ + pSMBr->ByteCount +
> -                       (char *)&pSMBr->ByteCount;
> -
> -       data_offset = le32_to_cpu(pSMBr->DataOffset);
> -       data_count = le32_to_cpu(pSMBr->DataCount);
> -       parm_offset = le32_to_cpu(pSMBr->ParameterOffset);
> -       parm_count = le32_to_cpu(pSMBr->ParameterCount);
> -
> -       *ppparm = (char *)&pSMBr->hdr.Protocol + parm_offset;
> -       *ppdata = (char *)&pSMBr->hdr.Protocol + data_offset;
> -
> -       /* should we also check that parm and data areas do not overlap? */
> -       if (*ppparm > end_of_smb) {
> -               cFYI(1, "parms start after end of smb");
> -               return -EINVAL;
> -       } else if (parm_count + *ppparm > end_of_smb) {
> -               cFYI(1, "parm end after end of smb");
> -               return -EINVAL;
> -       } else if (*ppdata > end_of_smb) {
> -               cFYI(1, "data starts after end of smb");
> -               return -EINVAL;
> -       } else if (data_count + *ppdata > end_of_smb) {
> -               cFYI(1, "data %p + count %d (%p) past smb end %p start %p",
> -                       *ppdata, data_count, (data_count + *ppdata),
> -                       end_of_smb, pSMBr);
> -               return -EINVAL;
> -       } else if (parm_count + data_count > pSMBr->ByteCount) {
> -               cFYI(1, "parm count and data count larger than SMB");
> -               return -EINVAL;
> -       }
> -       *pdatalen = data_count;
> -       *pparmlen = parm_count;
> -       return 0;
> -}
> -
>  int
>  CIFSSMBQueryReparseLinkInfo(const int xid, struct cifsTconInfo *tcon,
>                        const unsigned char *searchName,
> @@ -3056,7 +2967,97 @@ GetExtAttrOut:
>
>  #endif /* CONFIG_POSIX */
>
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
> +#ifdef CONFIG_CIFS_ACL
> +/*
> + * Initialize NT TRANSACT SMB into small smb request buffer.  This assumes that
> + * all NT TRANSACTS that we init here have total parm and data under about 400
> + * bytes (to fit in small cifs buffer size), which is the case so far, it
> + * easily fits. NB: Setup words themselves and ByteCount MaxSetupCount (size of
> + * returned setup area) and MaxParameterCount (returned parms size) must be set
> + * by caller
> + */
> +static int
> +smb_init_nttransact(const __u16 sub_command, const int setup_count,
> +                  const int parm_len, struct cifsTconInfo *tcon,
> +                  void **ret_buf)
> +{
> +       int rc;
> +       __u32 temp_offset;
> +       struct smb_com_ntransact_req *pSMB;
> +
> +       rc = small_smb_init(SMB_COM_NT_TRANSACT, 19 + setup_count, tcon,
> +                               (void **)&pSMB);
> +       if (rc)
> +               return rc;
> +       *ret_buf = (void *)pSMB;
> +       pSMB->Reserved = 0;
> +       pSMB->TotalParameterCount = cpu_to_le32(parm_len);
> +       pSMB->TotalDataCount  = 0;
> +       pSMB->MaxDataCount = cpu_to_le32((tcon->ses->server->maxBuf -
> +                                         MAX_CIFS_HDR_SIZE) & 0xFFFFFF00);
> +       pSMB->ParameterCount = pSMB->TotalParameterCount;
> +       pSMB->DataCount  = pSMB->TotalDataCount;
> +       temp_offset = offsetof(struct smb_com_ntransact_req, Parms) +
> +                       (setup_count * 2) - 4 /* for rfc1001 length itself */;
> +       pSMB->ParameterOffset = cpu_to_le32(temp_offset);
> +       pSMB->DataOffset = cpu_to_le32(temp_offset + parm_len);
> +       pSMB->SetupCount = setup_count; /* no need to le convert byte fields */
> +       pSMB->SubCommand = cpu_to_le16(sub_command);
> +       return 0;
> +}
> +
> +static int
> +validate_ntransact(char *buf, char **ppparm, char **ppdata,
> +                  __u32 *pparmlen, __u32 *pdatalen)
> +{
> +       char *end_of_smb;
> +       __u32 data_count, data_offset, parm_count, parm_offset;
> +       struct smb_com_ntransact_rsp *pSMBr;
> +
> +       *pdatalen = 0;
> +       *pparmlen = 0;
> +
> +       if (buf == NULL)
> +               return -EINVAL;
> +
> +       pSMBr = (struct smb_com_ntransact_rsp *)buf;
> +
> +       /* ByteCount was converted from little endian in SendReceive */
> +       end_of_smb = 2 /* sizeof byte count */ + pSMBr->ByteCount +
> +                       (char *)&pSMBr->ByteCount;
> +
> +       data_offset = le32_to_cpu(pSMBr->DataOffset);
> +       data_count = le32_to_cpu(pSMBr->DataCount);
> +       parm_offset = le32_to_cpu(pSMBr->ParameterOffset);
> +       parm_count = le32_to_cpu(pSMBr->ParameterCount);
> +
> +       *ppparm = (char *)&pSMBr->hdr.Protocol + parm_offset;
> +       *ppdata = (char *)&pSMBr->hdr.Protocol + data_offset;
> +
> +       /* should we also check that parm and data areas do not overlap? */
> +       if (*ppparm > end_of_smb) {
> +               cFYI(1, "parms start after end of smb");
> +               return -EINVAL;
> +       } else if (parm_count + *ppparm > end_of_smb) {
> +               cFYI(1, "parm end after end of smb");
> +               return -EINVAL;
> +       } else if (*ppdata > end_of_smb) {
> +               cFYI(1, "data starts after end of smb");
> +               return -EINVAL;
> +       } else if (data_count + *ppdata > end_of_smb) {
> +               cFYI(1, "data %p + count %d (%p) past smb end %p start %p",
> +                       *ppdata, data_count, (data_count + *ppdata),
> +                       end_of_smb, pSMBr);
> +               return -EINVAL;
> +       } else if (parm_count + data_count > pSMBr->ByteCount) {
> +               cFYI(1, "parm count and data count larger than SMB");
> +               return -EINVAL;
> +       }
> +       *pdatalen = data_count;
> +       *pparmlen = parm_count;
> +       return 0;
> +}
> +
>  /* Get Security Descriptor (by handle) from remote server for a file or dir */
>  int
>  CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, __u16 fid,
> @@ -3214,7 +3215,7 @@ setCifsAclRetry:
>        return (rc);
>  }
>
> -#endif /* CONFIG_CIFS_EXPERIMENTAL */
> +#endif /* CONFIG_CIFS_ACL */
>
>  /* Legacy Query Path Information call for lookup to old servers such
>    as Win9x/WinME */
> diff --git a/fs/cifs/file.c b/fs/cifs/file.c
> index b857ce5..5a28660 100644
> --- a/fs/cifs/file.c
> +++ b/fs/cifs/file.c
> @@ -1108,7 +1108,6 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file,
>        return total_written;
>  }
>
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
>  struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode,
>                                        bool fsuid_only)
>  {
> @@ -1142,7 +1141,6 @@ struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode,
>        spin_unlock(&cifs_file_list_lock);
>        return NULL;
>  }
> -#endif
>
>  struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode,
>                                        bool fsuid_only)
> diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
> index 0023146..10d1cab 100644
> --- a/fs/cifs/inode.c
> +++ b/fs/cifs/inode.c
> @@ -687,7 +687,7 @@ int cifs_get_inode_info(struct inode **pinode,
>                        cFYI(1, "cifs_sfu_type failed: %d", tmprc);
>        }
>
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
> +#ifdef CONFIG_CIFS_ACL
>        /* fill in 0777 bits from ACL */
>        if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
>                rc = cifs_acl_to_fattr(cifs_sb, &fattr, *pinode, full_path,
> @@ -698,7 +698,7 @@ int cifs_get_inode_info(struct inode **pinode,
>                        goto cgii_exit;
>                }
>        }
> -#endif
> +#endif /* CONFIG_CIFS_ACL */
>
>        /* fill in remaining high mode bits e.g. SUID, VTX */
>        if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL)
> @@ -2128,7 +2128,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
>
>        if (attrs->ia_valid & ATTR_MODE) {
>                rc = 0;
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
> +#ifdef CONFIG_CIFS_ACL
>                if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
>                        rc = mode_to_cifs_acl(inode, full_path, mode);
>                        if (rc) {
> @@ -2137,7 +2137,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
>                                goto cifs_setattr_exit;
>                        }
>                } else
> -#endif
> +#endif /* CONFIG_CIFS_ACL */
>                if (((mode & S_IWUGO) == 0) &&
>                    (cifsInode->cifsAttrs & ATTR_READONLY) == 0) {
>
> --
> 1.7.3.2
>
>

Jeff, patch looks good except I have one comment, I will state it
that when the patch is posted on cifs mailing list.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: Tree for December 3 (cifs)
@ 2010-12-06 16:13                   ` Shirish Pargaonkar
  0 siblings, 0 replies; 23+ messages in thread
From: Shirish Pargaonkar @ 2010-12-06 16:13 UTC (permalink / raw)
  To: Jeff Layton
  Cc: Ingo Molnar, Randy Dunlap, Steve French, Stephen Rothwell,
	linux-next, LKML, linux-cifs, Linus Torvalds, Andrew Morton

On Mon, Dec 6, 2010 at 9:50 AM, Jeff Layton <jlayton@redhat.com> wrote:
> On Mon, 6 Dec 2010 09:40:33 -0600
> Shirish Pargaonkar <shirishpargaonkar@gmail.com> wrote:
>
>> On Mon, Dec 6, 2010 at 6:35 AM, Jeff Layton <jlayton@redhat.com> wrote:
>> > On Mon, 6 Dec 2010 08:09:56 +0100
>> > Ingo Molnar <mingo@elte.hu> wrote:
>> >
>> >>
>> >> * Randy Dunlap <randy.dunlap@oracle.com> wrote:
>> >>
>> >> > On Fri, 3 Dec 2010 13:04:40 +1100 Stephen Rothwell wrote:
>> >> >
>> >> > > Hi all,
>> >> > >
>> >> > > Changes since 20101202:
>> >> >
>> >> >
>> >> > When CIFS_EXPERIMENTAL is not enabled:
>> >> >
>> >> > (.text+0xdf6c9): undefined reference to `get_cifs_acl'
>> >> >
>> >> > from fs/cifs/xattr.c:cifs_getxattr()
>> >> >
>> >> >
>> >> > CONFIG_CIFS=y
>> >> > # CONFIG_CIFS_STATS is not set
>> >> > CONFIG_CIFS_WEAK_PW_HASH=y
>> >> > # CONFIG_CIFS_UPCALL is not set
>> >> > CONFIG_CIFS_XATTR=y
>> >> > CONFIG_CIFS_POSIX=y
>> >> > # CONFIG_CIFS_DEBUG2 is not set
>> >> > # CONFIG_CIFS_DFS_UPCALL is not set
>> >> > CONFIG_CIFS_FSCACHE=y
>> >> > CONFIG_CIFS_ACL=y
>> >> > # CONFIG_CIFS_EXPERIMENTAL is not set
>> >>
>> >> And this build regression has been pushed upstream now, as of:
>> >>
>> >>    8520eeaa1235: Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
>> >>
>> >> and it is triggering for me too:
>> >>
>> >>    fs/built-in.o: In function `cifs_getxattr':
>> >>    (.text+0xc518e): undefined reference to `get_cifs_acl'
>> >>
>> >> The regression got introduced by:
>> >>
>> >>    fbeba8bb16d7: cifs: Handle extended attribute name cifs_acl to generate cifs acl blob (try #4)
>> >>
>> >> Which introduced the new CIFS_ACL option.
>> >>
>> >> Thanks,
>> >>
>> >>       Ingo
>> >
>> > Yeah, looks like this new Kconfig option depends on some code that's
>> > under the (much-overloaded) CIFS_EXPERIMENTAL Kconfig option. I think
>> > this patch needs some rework. The simple fix would be to make it
>> > dependent on CIFS_EXPERIMENTAL, but that's rather icky since
>>
>> Making CONFIG_CIFS_ACL dependent on CONFIG_CIFS_EXPERIMENTAL
>> works
>>
>>  config CIFS_ACL
>>           bool "Provide CIFS ACL support (EXPERIMENTAL)"
>> -         depends on EXPERIMENTAL && CIFS_XATTR
>> +         depends on CIFS_EXPERIMENTAL && CIFS_XATTR
>>           help
>>             Allows to fetch CIFS/NTFS ACL from the server.  The DACL blob
>>             is handed over to the application/caller.
>>
>> At the minimum function find_readable_file() and three functions
>> in cifssmb.c would not have to be in CIFS_EXPERIMENTAL.
>> And we would need to move some other cifs acl related functions
>> from under CIFS_ACL from CIFS_EXPERIMENTAL.
>>
>
> Ugh, let's not do that. CONFIG_CIFS_EXPERIMENTAL is like a box of
> chocolates...when you enable it you just never know what you're going
> to get...
>
> I think the patch below is a better way to deal with this. It's larger
> than I would like to see at this point in the release cycle, but we
> might as well fix it the right way.
>
> I also have some other patches to clean up CONFIG_CIFS_EXPERIMENTAL,
> but I'll send those along separately for 2.6.38.
>
> Steve, if this looks good, I'll send it along to you as a "formal"
> patch for inclusion via your tree.
>
> -------------------[snip]---------------------
>
> cifs: fix use of CONFIG_CIFS_ACL
>
> Some of the code under CONFIG_CIFS_ACL is dependent upon code under
> CONFIG_CIFS_EXPERIMENTAL, but the Kconfig options don't reflect that
> dependency. Move more of the ACL code out from under
> CONFIG_CIFS_EXPERIMENTAL and under CONFIG_CIFS_ACL.
>
> Also move find_readable_file out from other any sort of Kconfig
> option and make it a function normally compiled in.
>
> Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
> Signed-off-by: Jeff Layton <jlayton@redhat.com>
> ---
>  fs/cifs/Makefile    |    4 +-
>  fs/cifs/cifsacl.c   |    3 -
>  fs/cifs/cifsacl.h   |    4 -
>  fs/cifs/cifsproto.h |    2 -
>  fs/cifs/cifssmb.c   |  183 ++++++++++++++++++++++++++-------------------------
>  fs/cifs/file.c      |    2 -
>  fs/cifs/inode.c     |    8 +-
>  7 files changed, 99 insertions(+), 107 deletions(-)
>
> diff --git a/fs/cifs/Makefile b/fs/cifs/Makefile
> index adefa60..43b19dd 100644
> --- a/fs/cifs/Makefile
> +++ b/fs/cifs/Makefile
> @@ -6,7 +6,9 @@ obj-$(CONFIG_CIFS) += cifs.o
>  cifs-y := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o \
>          link.o misc.o netmisc.o smbdes.o smbencrypt.o transport.o asn1.o \
>          md4.o md5.o cifs_unicode.o nterr.o xattr.o cifsencrypt.o \
> -         readdir.o ioctl.o sess.o export.o cifsacl.o
> +         readdir.o ioctl.o sess.o export.o
> +
> +cifs-$(CONFIG_CIFS_ACL) += cifsacl.o
>
>  cifs-$(CONFIG_CIFS_UPCALL) += cifs_spnego.o
>
> diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c
> index c6ebea0..a437ec3 100644
> --- a/fs/cifs/cifsacl.c
> +++ b/fs/cifs/cifsacl.c
> @@ -30,8 +30,6 @@
>  #include "cifs_debug.h"
>
>
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
> -
>  static struct cifs_wksid wksidarr[NUM_WK_SIDS] = {
>        {{1, 0, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0} }, "null user"},
>        {{1, 1, {0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 0} }, "nobody"},
> @@ -774,4 +772,3 @@ int mode_to_cifs_acl(struct inode *inode, const char *path, __u64 nmode)
>
>        return rc;
>  }
> -#endif /* CONFIG_CIFS_EXPERIMENTAL */
> diff --git a/fs/cifs/cifsacl.h b/fs/cifs/cifsacl.h
> index 6c8096c..c4ae7d0 100644
> --- a/fs/cifs/cifsacl.h
> +++ b/fs/cifs/cifsacl.h
> @@ -74,11 +74,7 @@ struct cifs_wksid {
>        char sidname[SIDNAMELENGTH];
>  } __attribute__((packed));
>
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
> -
>  extern int match_sid(struct cifs_sid *);
>  extern int compare_sids(const struct cifs_sid *, const struct cifs_sid *);
>
> -#endif /*  CONFIG_CIFS_EXPERIMENTAL */
> -
>  #endif /* _CIFSACL_H */
> diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
> index 38cdec9..cb65499 100644
> --- a/fs/cifs/cifsproto.h
> +++ b/fs/cifs/cifsproto.h
> @@ -80,9 +80,7 @@ extern bool is_valid_oplock_break(struct smb_hdr *smb,
>                                  struct TCP_Server_Info *);
>  extern bool is_size_safe_to_change(struct cifsInodeInfo *, __u64 eof);
>  extern struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *, bool);
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
>  extern struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *, bool);
> -#endif
>  extern unsigned int smbCalcSize(struct smb_hdr *ptr);
>  extern unsigned int smbCalcSize_LE(struct smb_hdr *ptr);
>  extern int decode_negTokenInit(unsigned char *security_blob, int length,
> diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
> index 0ef7c3a..d7957a3 100644
> --- a/fs/cifs/cifssmb.c
> +++ b/fs/cifs/cifssmb.c
> @@ -2478,95 +2478,6 @@ querySymLinkRetry:
>  }
>
>  #ifdef CONFIG_CIFS_EXPERIMENTAL
> -/* Initialize NT TRANSACT SMB into small smb request buffer.
> -   This assumes that all NT TRANSACTS that we init here have
> -   total parm and data under about 400 bytes (to fit in small cifs
> -   buffer size), which is the case so far, it easily fits. NB:
> -       Setup words themselves and ByteCount
> -       MaxSetupCount (size of returned setup area) and
> -       MaxParameterCount (returned parms size) must be set by caller */
> -static int
> -smb_init_nttransact(const __u16 sub_command, const int setup_count,
> -                  const int parm_len, struct cifsTconInfo *tcon,
> -                  void **ret_buf)
> -{
> -       int rc;
> -       __u32 temp_offset;
> -       struct smb_com_ntransact_req *pSMB;
> -
> -       rc = small_smb_init(SMB_COM_NT_TRANSACT, 19 + setup_count, tcon,
> -                               (void **)&pSMB);
> -       if (rc)
> -               return rc;
> -       *ret_buf = (void *)pSMB;
> -       pSMB->Reserved = 0;
> -       pSMB->TotalParameterCount = cpu_to_le32(parm_len);
> -       pSMB->TotalDataCount  = 0;
> -       pSMB->MaxDataCount = cpu_to_le32((tcon->ses->server->maxBuf -
> -                                         MAX_CIFS_HDR_SIZE) & 0xFFFFFF00);
> -       pSMB->ParameterCount = pSMB->TotalParameterCount;
> -       pSMB->DataCount  = pSMB->TotalDataCount;
> -       temp_offset = offsetof(struct smb_com_ntransact_req, Parms) +
> -                       (setup_count * 2) - 4 /* for rfc1001 length itself */;
> -       pSMB->ParameterOffset = cpu_to_le32(temp_offset);
> -       pSMB->DataOffset = cpu_to_le32(temp_offset + parm_len);
> -       pSMB->SetupCount = setup_count; /* no need to le convert byte fields */
> -       pSMB->SubCommand = cpu_to_le16(sub_command);
> -       return 0;
> -}
> -
> -static int
> -validate_ntransact(char *buf, char **ppparm, char **ppdata,
> -                  __u32 *pparmlen, __u32 *pdatalen)
> -{
> -       char *end_of_smb;
> -       __u32 data_count, data_offset, parm_count, parm_offset;
> -       struct smb_com_ntransact_rsp *pSMBr;
> -
> -       *pdatalen = 0;
> -       *pparmlen = 0;
> -
> -       if (buf == NULL)
> -               return -EINVAL;
> -
> -       pSMBr = (struct smb_com_ntransact_rsp *)buf;
> -
> -       /* ByteCount was converted from little endian in SendReceive */
> -       end_of_smb = 2 /* sizeof byte count */ + pSMBr->ByteCount +
> -                       (char *)&pSMBr->ByteCount;
> -
> -       data_offset = le32_to_cpu(pSMBr->DataOffset);
> -       data_count = le32_to_cpu(pSMBr->DataCount);
> -       parm_offset = le32_to_cpu(pSMBr->ParameterOffset);
> -       parm_count = le32_to_cpu(pSMBr->ParameterCount);
> -
> -       *ppparm = (char *)&pSMBr->hdr.Protocol + parm_offset;
> -       *ppdata = (char *)&pSMBr->hdr.Protocol + data_offset;
> -
> -       /* should we also check that parm and data areas do not overlap? */
> -       if (*ppparm > end_of_smb) {
> -               cFYI(1, "parms start after end of smb");
> -               return -EINVAL;
> -       } else if (parm_count + *ppparm > end_of_smb) {
> -               cFYI(1, "parm end after end of smb");
> -               return -EINVAL;
> -       } else if (*ppdata > end_of_smb) {
> -               cFYI(1, "data starts after end of smb");
> -               return -EINVAL;
> -       } else if (data_count + *ppdata > end_of_smb) {
> -               cFYI(1, "data %p + count %d (%p) past smb end %p start %p",
> -                       *ppdata, data_count, (data_count + *ppdata),
> -                       end_of_smb, pSMBr);
> -               return -EINVAL;
> -       } else if (parm_count + data_count > pSMBr->ByteCount) {
> -               cFYI(1, "parm count and data count larger than SMB");
> -               return -EINVAL;
> -       }
> -       *pdatalen = data_count;
> -       *pparmlen = parm_count;
> -       return 0;
> -}
> -
>  int
>  CIFSSMBQueryReparseLinkInfo(const int xid, struct cifsTconInfo *tcon,
>                        const unsigned char *searchName,
> @@ -3056,7 +2967,97 @@ GetExtAttrOut:
>
>  #endif /* CONFIG_POSIX */
>
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
> +#ifdef CONFIG_CIFS_ACL
> +/*
> + * Initialize NT TRANSACT SMB into small smb request buffer.  This assumes that
> + * all NT TRANSACTS that we init here have total parm and data under about 400
> + * bytes (to fit in small cifs buffer size), which is the case so far, it
> + * easily fits. NB: Setup words themselves and ByteCount MaxSetupCount (size of
> + * returned setup area) and MaxParameterCount (returned parms size) must be set
> + * by caller
> + */
> +static int
> +smb_init_nttransact(const __u16 sub_command, const int setup_count,
> +                  const int parm_len, struct cifsTconInfo *tcon,
> +                  void **ret_buf)
> +{
> +       int rc;
> +       __u32 temp_offset;
> +       struct smb_com_ntransact_req *pSMB;
> +
> +       rc = small_smb_init(SMB_COM_NT_TRANSACT, 19 + setup_count, tcon,
> +                               (void **)&pSMB);
> +       if (rc)
> +               return rc;
> +       *ret_buf = (void *)pSMB;
> +       pSMB->Reserved = 0;
> +       pSMB->TotalParameterCount = cpu_to_le32(parm_len);
> +       pSMB->TotalDataCount  = 0;
> +       pSMB->MaxDataCount = cpu_to_le32((tcon->ses->server->maxBuf -
> +                                         MAX_CIFS_HDR_SIZE) & 0xFFFFFF00);
> +       pSMB->ParameterCount = pSMB->TotalParameterCount;
> +       pSMB->DataCount  = pSMB->TotalDataCount;
> +       temp_offset = offsetof(struct smb_com_ntransact_req, Parms) +
> +                       (setup_count * 2) - 4 /* for rfc1001 length itself */;
> +       pSMB->ParameterOffset = cpu_to_le32(temp_offset);
> +       pSMB->DataOffset = cpu_to_le32(temp_offset + parm_len);
> +       pSMB->SetupCount = setup_count; /* no need to le convert byte fields */
> +       pSMB->SubCommand = cpu_to_le16(sub_command);
> +       return 0;
> +}
> +
> +static int
> +validate_ntransact(char *buf, char **ppparm, char **ppdata,
> +                  __u32 *pparmlen, __u32 *pdatalen)
> +{
> +       char *end_of_smb;
> +       __u32 data_count, data_offset, parm_count, parm_offset;
> +       struct smb_com_ntransact_rsp *pSMBr;
> +
> +       *pdatalen = 0;
> +       *pparmlen = 0;
> +
> +       if (buf == NULL)
> +               return -EINVAL;
> +
> +       pSMBr = (struct smb_com_ntransact_rsp *)buf;
> +
> +       /* ByteCount was converted from little endian in SendReceive */
> +       end_of_smb = 2 /* sizeof byte count */ + pSMBr->ByteCount +
> +                       (char *)&pSMBr->ByteCount;
> +
> +       data_offset = le32_to_cpu(pSMBr->DataOffset);
> +       data_count = le32_to_cpu(pSMBr->DataCount);
> +       parm_offset = le32_to_cpu(pSMBr->ParameterOffset);
> +       parm_count = le32_to_cpu(pSMBr->ParameterCount);
> +
> +       *ppparm = (char *)&pSMBr->hdr.Protocol + parm_offset;
> +       *ppdata = (char *)&pSMBr->hdr.Protocol + data_offset;
> +
> +       /* should we also check that parm and data areas do not overlap? */
> +       if (*ppparm > end_of_smb) {
> +               cFYI(1, "parms start after end of smb");
> +               return -EINVAL;
> +       } else if (parm_count + *ppparm > end_of_smb) {
> +               cFYI(1, "parm end after end of smb");
> +               return -EINVAL;
> +       } else if (*ppdata > end_of_smb) {
> +               cFYI(1, "data starts after end of smb");
> +               return -EINVAL;
> +       } else if (data_count + *ppdata > end_of_smb) {
> +               cFYI(1, "data %p + count %d (%p) past smb end %p start %p",
> +                       *ppdata, data_count, (data_count + *ppdata),
> +                       end_of_smb, pSMBr);
> +               return -EINVAL;
> +       } else if (parm_count + data_count > pSMBr->ByteCount) {
> +               cFYI(1, "parm count and data count larger than SMB");
> +               return -EINVAL;
> +       }
> +       *pdatalen = data_count;
> +       *pparmlen = parm_count;
> +       return 0;
> +}
> +
>  /* Get Security Descriptor (by handle) from remote server for a file or dir */
>  int
>  CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, __u16 fid,
> @@ -3214,7 +3215,7 @@ setCifsAclRetry:
>        return (rc);
>  }
>
> -#endif /* CONFIG_CIFS_EXPERIMENTAL */
> +#endif /* CONFIG_CIFS_ACL */
>
>  /* Legacy Query Path Information call for lookup to old servers such
>    as Win9x/WinME */
> diff --git a/fs/cifs/file.c b/fs/cifs/file.c
> index b857ce5..5a28660 100644
> --- a/fs/cifs/file.c
> +++ b/fs/cifs/file.c
> @@ -1108,7 +1108,6 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file,
>        return total_written;
>  }
>
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
>  struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode,
>                                        bool fsuid_only)
>  {
> @@ -1142,7 +1141,6 @@ struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode,
>        spin_unlock(&cifs_file_list_lock);
>        return NULL;
>  }
> -#endif
>
>  struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode,
>                                        bool fsuid_only)
> diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
> index 0023146..10d1cab 100644
> --- a/fs/cifs/inode.c
> +++ b/fs/cifs/inode.c
> @@ -687,7 +687,7 @@ int cifs_get_inode_info(struct inode **pinode,
>                        cFYI(1, "cifs_sfu_type failed: %d", tmprc);
>        }
>
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
> +#ifdef CONFIG_CIFS_ACL
>        /* fill in 0777 bits from ACL */
>        if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
>                rc = cifs_acl_to_fattr(cifs_sb, &fattr, *pinode, full_path,
> @@ -698,7 +698,7 @@ int cifs_get_inode_info(struct inode **pinode,
>                        goto cgii_exit;
>                }
>        }
> -#endif
> +#endif /* CONFIG_CIFS_ACL */
>
>        /* fill in remaining high mode bits e.g. SUID, VTX */
>        if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL)
> @@ -2128,7 +2128,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
>
>        if (attrs->ia_valid & ATTR_MODE) {
>                rc = 0;
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
> +#ifdef CONFIG_CIFS_ACL
>                if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
>                        rc = mode_to_cifs_acl(inode, full_path, mode);
>                        if (rc) {
> @@ -2137,7 +2137,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
>                                goto cifs_setattr_exit;
>                        }
>                } else
> -#endif
> +#endif /* CONFIG_CIFS_ACL */
>                if (((mode & S_IWUGO) == 0) &&
>                    (cifsInode->cifsAttrs & ATTR_READONLY) == 0) {
>
> --
> 1.7.3.2
>
>

Jeff, patch looks good except I have one comment, I will state it
that when the patch is posted on cifs mailing list.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: Tree for December 3 (cifs)
       [not found]               ` <20101206105021.2b6bfc96-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
  2010-12-06 16:13                   ` Shirish Pargaonkar
@ 2010-12-06 16:22                 ` Shirish Pargaonkar
       [not found]                   ` <AANLkTinbR4+gtYt7-8ZFS7kdkWAs0CFxCD_mq9oy1Pa_@mail.gmail.com>
  2010-12-06 16:43                   ` Randy Dunlap
  2 siblings, 1 reply; 23+ messages in thread
From: Shirish Pargaonkar @ 2010-12-06 16:22 UTC (permalink / raw)
  To: Jeff Layton
  Cc: sfrench-eUNUBHrolfbYtjvyW6yDsg, linux-cifs-u79uwXL29TY76Z2rM5mHXA

On Mon, Dec 6, 2010 at 9:50 AM, Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
> On Mon, 6 Dec 2010 09:40:33 -0600
> Shirish Pargaonkar <shirishpargaonkar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
>> On Mon, Dec 6, 2010 at 6:35 AM, Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
>> > On Mon, 6 Dec 2010 08:09:56 +0100
>> > Ingo Molnar <mingo-X9Un+BFzKDI@public.gmane.org> wrote:
>> >
>> >>
>> >> * Randy Dunlap <randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> wrote:
>> >>
>> >> > On Fri, 3 Dec 2010 13:04:40 +1100 Stephen Rothwell wrote:
>> >> >
>> >> > > Hi all,
>> >> > >
>> >> > > Changes since 20101202:
>> >> >
>> >> >
>> >> > When CIFS_EXPERIMENTAL is not enabled:
>> >> >
>> >> > (.text+0xdf6c9): undefined reference to `get_cifs_acl'
>> >> >
>> >> > from fs/cifs/xattr.c:cifs_getxattr()
>> >> >
>> >> >
>> >> > CONFIG_CIFS=y
>> >> > # CONFIG_CIFS_STATS is not set
>> >> > CONFIG_CIFS_WEAK_PW_HASH=y
>> >> > # CONFIG_CIFS_UPCALL is not set
>> >> > CONFIG_CIFS_XATTR=y
>> >> > CONFIG_CIFS_POSIX=y
>> >> > # CONFIG_CIFS_DEBUG2 is not set
>> >> > # CONFIG_CIFS_DFS_UPCALL is not set
>> >> > CONFIG_CIFS_FSCACHE=y
>> >> > CONFIG_CIFS_ACL=y
>> >> > # CONFIG_CIFS_EXPERIMENTAL is not set
>> >>
>> >> And this build regression has been pushed upstream now, as of:
>> >>
>> >>    8520eeaa1235: Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
>> >>
>> >> and it is triggering for me too:
>> >>
>> >>    fs/built-in.o: In function `cifs_getxattr':
>> >>    (.text+0xc518e): undefined reference to `get_cifs_acl'
>> >>
>> >> The regression got introduced by:
>> >>
>> >>    fbeba8bb16d7: cifs: Handle extended attribute name cifs_acl to generate cifs acl blob (try #4)
>> >>
>> >> Which introduced the new CIFS_ACL option.
>> >>
>> >> Thanks,
>> >>
>> >>       Ingo
>> >
>> > Yeah, looks like this new Kconfig option depends on some code that's
>> > under the (much-overloaded) CIFS_EXPERIMENTAL Kconfig option. I think
>> > this patch needs some rework. The simple fix would be to make it
>> > dependent on CIFS_EXPERIMENTAL, but that's rather icky since
>>
>> Making CONFIG_CIFS_ACL dependent on CONFIG_CIFS_EXPERIMENTAL
>> works
>>
>>  config CIFS_ACL
>>           bool "Provide CIFS ACL support (EXPERIMENTAL)"
>> -         depends on EXPERIMENTAL && CIFS_XATTR
>> +         depends on CIFS_EXPERIMENTAL && CIFS_XATTR
>>           help
>>             Allows to fetch CIFS/NTFS ACL from the server.  The DACL blob
>>             is handed over to the application/caller.
>>
>> At the minimum function find_readable_file() and three functions
>> in cifssmb.c would not have to be in CIFS_EXPERIMENTAL.
>> And we would need to move some other cifs acl related functions
>> from under CIFS_ACL from CIFS_EXPERIMENTAL.
>>
>
> Ugh, let's not do that. CONFIG_CIFS_EXPERIMENTAL is like a box of
> chocolates...when you enable it you just never know what you're going
> to get...
>
> I think the patch below is a better way to deal with this. It's larger
> than I would like to see at this point in the release cycle, but we
> might as well fix it the right way.
>
> I also have some other patches to clean up CONFIG_CIFS_EXPERIMENTAL,
> but I'll send those along separately for 2.6.38.
>
> Steve, if this looks good, I'll send it along to you as a "formal"
> patch for inclusion via your tree.
>
> -------------------[snip]---------------------
>
> cifs: fix use of CONFIG_CIFS_ACL
>
> Some of the code under CONFIG_CIFS_ACL is dependent upon code under
> CONFIG_CIFS_EXPERIMENTAL, but the Kconfig options don't reflect that
> dependency. Move more of the ACL code out from under
> CONFIG_CIFS_EXPERIMENTAL and under CONFIG_CIFS_ACL.
>
> Also move find_readable_file out from other any sort of Kconfig
> option and make it a function normally compiled in.
>
> Reported-by: Randy Dunlap <randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
>  fs/cifs/Makefile    |    4 +-
>  fs/cifs/cifsacl.c   |    3 -
>  fs/cifs/cifsacl.h   |    4 -
>  fs/cifs/cifsproto.h |    2 -
>  fs/cifs/cifssmb.c   |  183 ++++++++++++++++++++++++++-------------------------
>  fs/cifs/file.c      |    2 -
>  fs/cifs/inode.c     |    8 +-
>  7 files changed, 99 insertions(+), 107 deletions(-)
>
> diff --git a/fs/cifs/Makefile b/fs/cifs/Makefile
> index adefa60..43b19dd 100644
> --- a/fs/cifs/Makefile
> +++ b/fs/cifs/Makefile
> @@ -6,7 +6,9 @@ obj-$(CONFIG_CIFS) += cifs.o
>  cifs-y := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o \
>          link.o misc.o netmisc.o smbdes.o smbencrypt.o transport.o asn1.o \
>          md4.o md5.o cifs_unicode.o nterr.o xattr.o cifsencrypt.o \
> -         readdir.o ioctl.o sess.o export.o cifsacl.o
> +         readdir.o ioctl.o sess.o export.o
> +
> +cifs-$(CONFIG_CIFS_ACL) += cifsacl.o
>
>  cifs-$(CONFIG_CIFS_UPCALL) += cifs_spnego.o
>
> diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c
> index c6ebea0..a437ec3 100644
> --- a/fs/cifs/cifsacl.c
> +++ b/fs/cifs/cifsacl.c
> @@ -30,8 +30,6 @@
>  #include "cifs_debug.h"
>
>
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
> -
>  static struct cifs_wksid wksidarr[NUM_WK_SIDS] = {
>        {{1, 0, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0} }, "null user"},
>        {{1, 1, {0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 0} }, "nobody"},
> @@ -774,4 +772,3 @@ int mode_to_cifs_acl(struct inode *inode, const char *path, __u64 nmode)
>
>        return rc;
>  }
> -#endif /* CONFIG_CIFS_EXPERIMENTAL */
> diff --git a/fs/cifs/cifsacl.h b/fs/cifs/cifsacl.h
> index 6c8096c..c4ae7d0 100644
> --- a/fs/cifs/cifsacl.h
> +++ b/fs/cifs/cifsacl.h
> @@ -74,11 +74,7 @@ struct cifs_wksid {
>        char sidname[SIDNAMELENGTH];
>  } __attribute__((packed));
>
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
> -
>  extern int match_sid(struct cifs_sid *);
>  extern int compare_sids(const struct cifs_sid *, const struct cifs_sid *);
>
> -#endif /*  CONFIG_CIFS_EXPERIMENTAL */
> -
>  #endif /* _CIFSACL_H */
> diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
> index 38cdec9..cb65499 100644
> --- a/fs/cifs/cifsproto.h
> +++ b/fs/cifs/cifsproto.h
> @@ -80,9 +80,7 @@ extern bool is_valid_oplock_break(struct smb_hdr *smb,
>                                  struct TCP_Server_Info *);
>  extern bool is_size_safe_to_change(struct cifsInodeInfo *, __u64 eof);
>  extern struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *, bool);
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
>  extern struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *, bool);
> -#endif
>  extern unsigned int smbCalcSize(struct smb_hdr *ptr);
>  extern unsigned int smbCalcSize_LE(struct smb_hdr *ptr);
>  extern int decode_negTokenInit(unsigned char *security_blob, int length,
> diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
> index 0ef7c3a..d7957a3 100644
> --- a/fs/cifs/cifssmb.c
> +++ b/fs/cifs/cifssmb.c
> @@ -2478,95 +2478,6 @@ querySymLinkRetry:
>  }
>
>  #ifdef CONFIG_CIFS_EXPERIMENTAL
> -/* Initialize NT TRANSACT SMB into small smb request buffer.
> -   This assumes that all NT TRANSACTS that we init here have
> -   total parm and data under about 400 bytes (to fit in small cifs
> -   buffer size), which is the case so far, it easily fits. NB:
> -       Setup words themselves and ByteCount
> -       MaxSetupCount (size of returned setup area) and
> -       MaxParameterCount (returned parms size) must be set by caller */
> -static int
> -smb_init_nttransact(const __u16 sub_command, const int setup_count,
> -                  const int parm_len, struct cifsTconInfo *tcon,
> -                  void **ret_buf)
> -{
> -       int rc;
> -       __u32 temp_offset;
> -       struct smb_com_ntransact_req *pSMB;
> -
> -       rc = small_smb_init(SMB_COM_NT_TRANSACT, 19 + setup_count, tcon,
> -                               (void **)&pSMB);
> -       if (rc)
> -               return rc;
> -       *ret_buf = (void *)pSMB;
> -       pSMB->Reserved = 0;
> -       pSMB->TotalParameterCount = cpu_to_le32(parm_len);
> -       pSMB->TotalDataCount  = 0;
> -       pSMB->MaxDataCount = cpu_to_le32((tcon->ses->server->maxBuf -
> -                                         MAX_CIFS_HDR_SIZE) & 0xFFFFFF00);
> -       pSMB->ParameterCount = pSMB->TotalParameterCount;
> -       pSMB->DataCount  = pSMB->TotalDataCount;
> -       temp_offset = offsetof(struct smb_com_ntransact_req, Parms) +
> -                       (setup_count * 2) - 4 /* for rfc1001 length itself */;
> -       pSMB->ParameterOffset = cpu_to_le32(temp_offset);
> -       pSMB->DataOffset = cpu_to_le32(temp_offset + parm_len);
> -       pSMB->SetupCount = setup_count; /* no need to le convert byte fields */
> -       pSMB->SubCommand = cpu_to_le16(sub_command);
> -       return 0;
> -}
> -
> -static int
> -validate_ntransact(char *buf, char **ppparm, char **ppdata,
> -                  __u32 *pparmlen, __u32 *pdatalen)
> -{
> -       char *end_of_smb;
> -       __u32 data_count, data_offset, parm_count, parm_offset;
> -       struct smb_com_ntransact_rsp *pSMBr;
> -
> -       *pdatalen = 0;
> -       *pparmlen = 0;
> -
> -       if (buf == NULL)
> -               return -EINVAL;
> -
> -       pSMBr = (struct smb_com_ntransact_rsp *)buf;
> -
> -       /* ByteCount was converted from little endian in SendReceive */
> -       end_of_smb = 2 /* sizeof byte count */ + pSMBr->ByteCount +
> -                       (char *)&pSMBr->ByteCount;
> -
> -       data_offset = le32_to_cpu(pSMBr->DataOffset);
> -       data_count = le32_to_cpu(pSMBr->DataCount);
> -       parm_offset = le32_to_cpu(pSMBr->ParameterOffset);
> -       parm_count = le32_to_cpu(pSMBr->ParameterCount);
> -
> -       *ppparm = (char *)&pSMBr->hdr.Protocol + parm_offset;
> -       *ppdata = (char *)&pSMBr->hdr.Protocol + data_offset;
> -
> -       /* should we also check that parm and data areas do not overlap? */
> -       if (*ppparm > end_of_smb) {
> -               cFYI(1, "parms start after end of smb");
> -               return -EINVAL;
> -       } else if (parm_count + *ppparm > end_of_smb) {
> -               cFYI(1, "parm end after end of smb");
> -               return -EINVAL;
> -       } else if (*ppdata > end_of_smb) {
> -               cFYI(1, "data starts after end of smb");
> -               return -EINVAL;
> -       } else if (data_count + *ppdata > end_of_smb) {
> -               cFYI(1, "data %p + count %d (%p) past smb end %p start %p",
> -                       *ppdata, data_count, (data_count + *ppdata),
> -                       end_of_smb, pSMBr);
> -               return -EINVAL;
> -       } else if (parm_count + data_count > pSMBr->ByteCount) {
> -               cFYI(1, "parm count and data count larger than SMB");
> -               return -EINVAL;
> -       }
> -       *pdatalen = data_count;
> -       *pparmlen = parm_count;
> -       return 0;
> -}
> -
>  int
>  CIFSSMBQueryReparseLinkInfo(const int xid, struct cifsTconInfo *tcon,
>                        const unsigned char *searchName,
> @@ -3056,7 +2967,97 @@ GetExtAttrOut:
>
>  #endif /* CONFIG_POSIX */
>
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
> +#ifdef CONFIG_CIFS_ACL
> +/*
> + * Initialize NT TRANSACT SMB into small smb request buffer.  This assumes that
> + * all NT TRANSACTS that we init here have total parm and data under about 400
> + * bytes (to fit in small cifs buffer size), which is the case so far, it
> + * easily fits. NB: Setup words themselves and ByteCount MaxSetupCount (size of
> + * returned setup area) and MaxParameterCount (returned parms size) must be set
> + * by caller
> + */
> +static int
> +smb_init_nttransact(const __u16 sub_command, const int setup_count,
> +                  const int parm_len, struct cifsTconInfo *tcon,
> +                  void **ret_buf)
> +{
> +       int rc;
> +       __u32 temp_offset;
> +       struct smb_com_ntransact_req *pSMB;
> +
> +       rc = small_smb_init(SMB_COM_NT_TRANSACT, 19 + setup_count, tcon,
> +                               (void **)&pSMB);
> +       if (rc)
> +               return rc;
> +       *ret_buf = (void *)pSMB;
> +       pSMB->Reserved = 0;
> +       pSMB->TotalParameterCount = cpu_to_le32(parm_len);
> +       pSMB->TotalDataCount  = 0;
> +       pSMB->MaxDataCount = cpu_to_le32((tcon->ses->server->maxBuf -
> +                                         MAX_CIFS_HDR_SIZE) & 0xFFFFFF00);
> +       pSMB->ParameterCount = pSMB->TotalParameterCount;
> +       pSMB->DataCount  = pSMB->TotalDataCount;
> +       temp_offset = offsetof(struct smb_com_ntransact_req, Parms) +
> +                       (setup_count * 2) - 4 /* for rfc1001 length itself */;
> +       pSMB->ParameterOffset = cpu_to_le32(temp_offset);
> +       pSMB->DataOffset = cpu_to_le32(temp_offset + parm_len);
> +       pSMB->SetupCount = setup_count; /* no need to le convert byte fields */
> +       pSMB->SubCommand = cpu_to_le16(sub_command);
> +       return 0;
> +}
> +
> +static int
> +validate_ntransact(char *buf, char **ppparm, char **ppdata,
> +                  __u32 *pparmlen, __u32 *pdatalen)
> +{
> +       char *end_of_smb;
> +       __u32 data_count, data_offset, parm_count, parm_offset;
> +       struct smb_com_ntransact_rsp *pSMBr;
> +
> +       *pdatalen = 0;
> +       *pparmlen = 0;
> +
> +       if (buf == NULL)
> +               return -EINVAL;
> +
> +       pSMBr = (struct smb_com_ntransact_rsp *)buf;
> +
> +       /* ByteCount was converted from little endian in SendReceive */
> +       end_of_smb = 2 /* sizeof byte count */ + pSMBr->ByteCount +
> +                       (char *)&pSMBr->ByteCount;
> +
> +       data_offset = le32_to_cpu(pSMBr->DataOffset);
> +       data_count = le32_to_cpu(pSMBr->DataCount);
> +       parm_offset = le32_to_cpu(pSMBr->ParameterOffset);
> +       parm_count = le32_to_cpu(pSMBr->ParameterCount);
> +
> +       *ppparm = (char *)&pSMBr->hdr.Protocol + parm_offset;
> +       *ppdata = (char *)&pSMBr->hdr.Protocol + data_offset;
> +
> +       /* should we also check that parm and data areas do not overlap? */
> +       if (*ppparm > end_of_smb) {
> +               cFYI(1, "parms start after end of smb");
> +               return -EINVAL;
> +       } else if (parm_count + *ppparm > end_of_smb) {
> +               cFYI(1, "parm end after end of smb");
> +               return -EINVAL;
> +       } else if (*ppdata > end_of_smb) {
> +               cFYI(1, "data starts after end of smb");
> +               return -EINVAL;
> +       } else if (data_count + *ppdata > end_of_smb) {
> +               cFYI(1, "data %p + count %d (%p) past smb end %p start %p",
> +                       *ppdata, data_count, (data_count + *ppdata),
> +                       end_of_smb, pSMBr);
> +               return -EINVAL;
> +       } else if (parm_count + data_count > pSMBr->ByteCount) {
> +               cFYI(1, "parm count and data count larger than SMB");
> +               return -EINVAL;
> +       }
> +       *pdatalen = data_count;
> +       *pparmlen = parm_count;
> +       return 0;
> +}
> +

Jeff, comment being, functions smb_nt_transact and validate_nttransact
although used by only cifs acl related functions, probably were not meant
to be limited to CIFS_ACL config option code, I think they existed even
before cifs acl code came into existence, not 100% sure.

>  /* Get Security Descriptor (by handle) from remote server for a file or dir */
>  int
>  CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, __u16 fid,
> @@ -3214,7 +3215,7 @@ setCifsAclRetry:
>        return (rc);
>  }
>
> -#endif /* CONFIG_CIFS_EXPERIMENTAL */
> +#endif /* CONFIG_CIFS_ACL */
>
>  /* Legacy Query Path Information call for lookup to old servers such
>    as Win9x/WinME */
> diff --git a/fs/cifs/file.c b/fs/cifs/file.c
> index b857ce5..5a28660 100644
> --- a/fs/cifs/file.c
> +++ b/fs/cifs/file.c
> @@ -1108,7 +1108,6 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file,
>        return total_written;
>  }
>
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
>  struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode,
>                                        bool fsuid_only)
>  {
> @@ -1142,7 +1141,6 @@ struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode,
>        spin_unlock(&cifs_file_list_lock);
>        return NULL;
>  }
> -#endif
>
>  struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode,
>                                        bool fsuid_only)
> diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
> index 0023146..10d1cab 100644
> --- a/fs/cifs/inode.c
> +++ b/fs/cifs/inode.c
> @@ -687,7 +687,7 @@ int cifs_get_inode_info(struct inode **pinode,
>                        cFYI(1, "cifs_sfu_type failed: %d", tmprc);
>        }
>
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
> +#ifdef CONFIG_CIFS_ACL
>        /* fill in 0777 bits from ACL */
>        if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
>                rc = cifs_acl_to_fattr(cifs_sb, &fattr, *pinode, full_path,
> @@ -698,7 +698,7 @@ int cifs_get_inode_info(struct inode **pinode,
>                        goto cgii_exit;
>                }
>        }
> -#endif
> +#endif /* CONFIG_CIFS_ACL */
>
>        /* fill in remaining high mode bits e.g. SUID, VTX */
>        if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL)
> @@ -2128,7 +2128,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
>
>        if (attrs->ia_valid & ATTR_MODE) {
>                rc = 0;
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
> +#ifdef CONFIG_CIFS_ACL
>                if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
>                        rc = mode_to_cifs_acl(inode, full_path, mode);
>                        if (rc) {
> @@ -2137,7 +2137,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
>                                goto cifs_setattr_exit;
>                        }
>                } else
> -#endif
> +#endif /* CONFIG_CIFS_ACL */
>                if (((mode & S_IWUGO) == 0) &&
>                    (cifsInode->cifsAttrs & ATTR_READONLY) == 0) {
>
> --
> 1.7.3.2
>
>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: Tree for December 3 (cifs)
  2010-12-06 15:50               ` Jeff Layton
@ 2010-12-06 16:43                   ` Randy Dunlap
  -1 siblings, 0 replies; 23+ messages in thread
From: Randy Dunlap @ 2010-12-06 16:43 UTC (permalink / raw)
  To: Jeff Layton
  Cc: Shirish Pargaonkar, Ingo Molnar, Steve French, Stephen Rothwell,
	linux-next-u79uwXL29TY76Z2rM5mHXA, LKML,
	linux-cifs-u79uwXL29TY76Z2rM5mHXA, Linus Torvalds, Andrew Morton

On 12/06/10 07:50, Jeff Layton wrote:
> On Mon, 6 Dec 2010 09:40:33 -0600
> Shirish Pargaonkar <shirishpargaonkar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> 
>> On Mon, Dec 6, 2010 at 6:35 AM, Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
>>> On Mon, 6 Dec 2010 08:09:56 +0100
>>> Ingo Molnar <mingo-X9Un+BFzKDI@public.gmane.org> wrote:
>>>
>>>>
>>>> * Randy Dunlap <randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> wrote:
>>>>
>>>>> On Fri, 3 Dec 2010 13:04:40 +1100 Stephen Rothwell wrote:
>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> Changes since 20101202:
>>>>>
>>>>>
>>>>> When CIFS_EXPERIMENTAL is not enabled:
>>>>>
>>>>> (.text+0xdf6c9): undefined reference to `get_cifs_acl'
>>>>>
>>>>> from fs/cifs/xattr.c:cifs_getxattr()
>>>>>
>>>>>
>>>>> CONFIG_CIFS=y
>>>>> # CONFIG_CIFS_STATS is not set
>>>>> CONFIG_CIFS_WEAK_PW_HASH=y
>>>>> # CONFIG_CIFS_UPCALL is not set
>>>>> CONFIG_CIFS_XATTR=y
>>>>> CONFIG_CIFS_POSIX=y
>>>>> # CONFIG_CIFS_DEBUG2 is not set
>>>>> # CONFIG_CIFS_DFS_UPCALL is not set
>>>>> CONFIG_CIFS_FSCACHE=y
>>>>> CONFIG_CIFS_ACL=y
>>>>> # CONFIG_CIFS_EXPERIMENTAL is not set
>>>>
>>>> And this build regression has been pushed upstream now, as of:
>>>>
>>>>    8520eeaa1235: Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
>>>>
>>>> and it is triggering for me too:
>>>>
>>>>    fs/built-in.o: In function `cifs_getxattr':
>>>>    (.text+0xc518e): undefined reference to `get_cifs_acl'
>>>>
>>>> The regression got introduced by:
>>>>
>>>>    fbeba8bb16d7: cifs: Handle extended attribute name cifs_acl to generate cifs acl blob (try #4)
>>>>
>>>> Which introduced the new CIFS_ACL option.
>>>>
>>>> Thanks,
>>>>
>>>>       Ingo
>>>
>>> Yeah, looks like this new Kconfig option depends on some code that's
>>> under the (much-overloaded) CIFS_EXPERIMENTAL Kconfig option. I think
>>> this patch needs some rework. The simple fix would be to make it
>>> dependent on CIFS_EXPERIMENTAL, but that's rather icky since
>>
>> Making CONFIG_CIFS_ACL dependent on CONFIG_CIFS_EXPERIMENTAL
>> works
>>
>>  config CIFS_ACL
>>           bool "Provide CIFS ACL support (EXPERIMENTAL)"
>> -         depends on EXPERIMENTAL && CIFS_XATTR
>> +         depends on CIFS_EXPERIMENTAL && CIFS_XATTR
>>           help
>>             Allows to fetch CIFS/NTFS ACL from the server.  The DACL blob
>>             is handed over to the application/caller.
>>
>> At the minimum function find_readable_file() and three functions
>> in cifssmb.c would not have to be in CIFS_EXPERIMENTAL.
>> And we would need to move some other cifs acl related functions
>> from under CIFS_ACL from CIFS_EXPERIMENTAL.
>>
> 
> Ugh, let's not do that. CONFIG_CIFS_EXPERIMENTAL is like a box of
> chocolates...when you enable it you just never know what you're going
> to get...
> 
> I think the patch below is a better way to deal with this. It's larger
> than I would like to see at this point in the release cycle, but we
> might as well fix it the right way.
> 
> I also have some other patches to clean up CONFIG_CIFS_EXPERIMENTAL,
> but I'll send those along separately for 2.6.38.
> 
> Steve, if this looks good, I'll send it along to you as a "formal"
> patch for inclusion via your tree.

Thanks, that works.

Acked-by: Randy Dunlap <randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>


> -------------------[snip]---------------------
> 
> cifs: fix use of CONFIG_CIFS_ACL
> 
> Some of the code under CONFIG_CIFS_ACL is dependent upon code under
> CONFIG_CIFS_EXPERIMENTAL, but the Kconfig options don't reflect that
> dependency. Move more of the ACL code out from under
> CONFIG_CIFS_EXPERIMENTAL and under CONFIG_CIFS_ACL.
> 
> Also move find_readable_file out from other any sort of Kconfig
> option and make it a function normally compiled in.
> 
> Reported-by: Randy Dunlap <randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
>  fs/cifs/Makefile    |    4 +-
>  fs/cifs/cifsacl.c   |    3 -
>  fs/cifs/cifsacl.h   |    4 -
>  fs/cifs/cifsproto.h |    2 -
>  fs/cifs/cifssmb.c   |  183 ++++++++++++++++++++++++++-------------------------
>  fs/cifs/file.c      |    2 -
>  fs/cifs/inode.c     |    8 +-
>  7 files changed, 99 insertions(+), 107 deletions(-)
> 
> diff --git a/fs/cifs/Makefile b/fs/cifs/Makefile
> index adefa60..43b19dd 100644
> --- a/fs/cifs/Makefile
> +++ b/fs/cifs/Makefile
> @@ -6,7 +6,9 @@ obj-$(CONFIG_CIFS) += cifs.o
>  cifs-y := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o \
>  	  link.o misc.o netmisc.o smbdes.o smbencrypt.o transport.o asn1.o \
>  	  md4.o md5.o cifs_unicode.o nterr.o xattr.o cifsencrypt.o \
> -	  readdir.o ioctl.o sess.o export.o cifsacl.o
> +	  readdir.o ioctl.o sess.o export.o
> +
> +cifs-$(CONFIG_CIFS_ACL) += cifsacl.o
>  
>  cifs-$(CONFIG_CIFS_UPCALL) += cifs_spnego.o
>  
> diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c
> index c6ebea0..a437ec3 100644
> --- a/fs/cifs/cifsacl.c
> +++ b/fs/cifs/cifsacl.c
> @@ -30,8 +30,6 @@
>  #include "cifs_debug.h"
>  
>  
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
> -
>  static struct cifs_wksid wksidarr[NUM_WK_SIDS] = {
>  	{{1, 0, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0} }, "null user"},
>  	{{1, 1, {0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 0} }, "nobody"},
> @@ -774,4 +772,3 @@ int mode_to_cifs_acl(struct inode *inode, const char *path, __u64 nmode)
>  
>  	return rc;
>  }
> -#endif /* CONFIG_CIFS_EXPERIMENTAL */
> diff --git a/fs/cifs/cifsacl.h b/fs/cifs/cifsacl.h
> index 6c8096c..c4ae7d0 100644
> --- a/fs/cifs/cifsacl.h
> +++ b/fs/cifs/cifsacl.h
> @@ -74,11 +74,7 @@ struct cifs_wksid {
>  	char sidname[SIDNAMELENGTH];
>  } __attribute__((packed));
>  
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
> -
>  extern int match_sid(struct cifs_sid *);
>  extern int compare_sids(const struct cifs_sid *, const struct cifs_sid *);
>  
> -#endif /*  CONFIG_CIFS_EXPERIMENTAL */
> -
>  #endif /* _CIFSACL_H */
> diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
> index 38cdec9..cb65499 100644
> --- a/fs/cifs/cifsproto.h
> +++ b/fs/cifs/cifsproto.h
> @@ -80,9 +80,7 @@ extern bool is_valid_oplock_break(struct smb_hdr *smb,
>  				  struct TCP_Server_Info *);
>  extern bool is_size_safe_to_change(struct cifsInodeInfo *, __u64 eof);
>  extern struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *, bool);
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
>  extern struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *, bool);
> -#endif
>  extern unsigned int smbCalcSize(struct smb_hdr *ptr);
>  extern unsigned int smbCalcSize_LE(struct smb_hdr *ptr);
>  extern int decode_negTokenInit(unsigned char *security_blob, int length,
> diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
> index 0ef7c3a..d7957a3 100644
> --- a/fs/cifs/cifssmb.c
> +++ b/fs/cifs/cifssmb.c
> @@ -2478,95 +2478,6 @@ querySymLinkRetry:
>  }
>  
>  #ifdef CONFIG_CIFS_EXPERIMENTAL
> -/* Initialize NT TRANSACT SMB into small smb request buffer.
> -   This assumes that all NT TRANSACTS that we init here have
> -   total parm and data under about 400 bytes (to fit in small cifs
> -   buffer size), which is the case so far, it easily fits. NB:
> -	Setup words themselves and ByteCount
> -	MaxSetupCount (size of returned setup area) and
> -	MaxParameterCount (returned parms size) must be set by caller */
> -static int
> -smb_init_nttransact(const __u16 sub_command, const int setup_count,
> -		   const int parm_len, struct cifsTconInfo *tcon,
> -		   void **ret_buf)
> -{
> -	int rc;
> -	__u32 temp_offset;
> -	struct smb_com_ntransact_req *pSMB;
> -
> -	rc = small_smb_init(SMB_COM_NT_TRANSACT, 19 + setup_count, tcon,
> -				(void **)&pSMB);
> -	if (rc)
> -		return rc;
> -	*ret_buf = (void *)pSMB;
> -	pSMB->Reserved = 0;
> -	pSMB->TotalParameterCount = cpu_to_le32(parm_len);
> -	pSMB->TotalDataCount  = 0;
> -	pSMB->MaxDataCount = cpu_to_le32((tcon->ses->server->maxBuf -
> -					  MAX_CIFS_HDR_SIZE) & 0xFFFFFF00);
> -	pSMB->ParameterCount = pSMB->TotalParameterCount;
> -	pSMB->DataCount  = pSMB->TotalDataCount;
> -	temp_offset = offsetof(struct smb_com_ntransact_req, Parms) +
> -			(setup_count * 2) - 4 /* for rfc1001 length itself */;
> -	pSMB->ParameterOffset = cpu_to_le32(temp_offset);
> -	pSMB->DataOffset = cpu_to_le32(temp_offset + parm_len);
> -	pSMB->SetupCount = setup_count; /* no need to le convert byte fields */
> -	pSMB->SubCommand = cpu_to_le16(sub_command);
> -	return 0;
> -}
> -
> -static int
> -validate_ntransact(char *buf, char **ppparm, char **ppdata,
> -		   __u32 *pparmlen, __u32 *pdatalen)
> -{
> -	char *end_of_smb;
> -	__u32 data_count, data_offset, parm_count, parm_offset;
> -	struct smb_com_ntransact_rsp *pSMBr;
> -
> -	*pdatalen = 0;
> -	*pparmlen = 0;
> -
> -	if (buf == NULL)
> -		return -EINVAL;
> -
> -	pSMBr = (struct smb_com_ntransact_rsp *)buf;
> -
> -	/* ByteCount was converted from little endian in SendReceive */
> -	end_of_smb = 2 /* sizeof byte count */ + pSMBr->ByteCount +
> -			(char *)&pSMBr->ByteCount;
> -
> -	data_offset = le32_to_cpu(pSMBr->DataOffset);
> -	data_count = le32_to_cpu(pSMBr->DataCount);
> -	parm_offset = le32_to_cpu(pSMBr->ParameterOffset);
> -	parm_count = le32_to_cpu(pSMBr->ParameterCount);
> -
> -	*ppparm = (char *)&pSMBr->hdr.Protocol + parm_offset;
> -	*ppdata = (char *)&pSMBr->hdr.Protocol + data_offset;
> -
> -	/* should we also check that parm and data areas do not overlap? */
> -	if (*ppparm > end_of_smb) {
> -		cFYI(1, "parms start after end of smb");
> -		return -EINVAL;
> -	} else if (parm_count + *ppparm > end_of_smb) {
> -		cFYI(1, "parm end after end of smb");
> -		return -EINVAL;
> -	} else if (*ppdata > end_of_smb) {
> -		cFYI(1, "data starts after end of smb");
> -		return -EINVAL;
> -	} else if (data_count + *ppdata > end_of_smb) {
> -		cFYI(1, "data %p + count %d (%p) past smb end %p start %p",
> -			*ppdata, data_count, (data_count + *ppdata),
> -			end_of_smb, pSMBr);
> -		return -EINVAL;
> -	} else if (parm_count + data_count > pSMBr->ByteCount) {
> -		cFYI(1, "parm count and data count larger than SMB");
> -		return -EINVAL;
> -	}
> -	*pdatalen = data_count;
> -	*pparmlen = parm_count;
> -	return 0;
> -}
> -
>  int
>  CIFSSMBQueryReparseLinkInfo(const int xid, struct cifsTconInfo *tcon,
>  			const unsigned char *searchName,
> @@ -3056,7 +2967,97 @@ GetExtAttrOut:
>  
>  #endif /* CONFIG_POSIX */
>  
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
> +#ifdef CONFIG_CIFS_ACL
> +/*
> + * Initialize NT TRANSACT SMB into small smb request buffer.  This assumes that
> + * all NT TRANSACTS that we init here have total parm and data under about 400
> + * bytes (to fit in small cifs buffer size), which is the case so far, it
> + * easily fits. NB: Setup words themselves and ByteCount MaxSetupCount (size of
> + * returned setup area) and MaxParameterCount (returned parms size) must be set
> + * by caller
> + */
> +static int
> +smb_init_nttransact(const __u16 sub_command, const int setup_count,
> +		   const int parm_len, struct cifsTconInfo *tcon,
> +		   void **ret_buf)
> +{
> +	int rc;
> +	__u32 temp_offset;
> +	struct smb_com_ntransact_req *pSMB;
> +
> +	rc = small_smb_init(SMB_COM_NT_TRANSACT, 19 + setup_count, tcon,
> +				(void **)&pSMB);
> +	if (rc)
> +		return rc;
> +	*ret_buf = (void *)pSMB;
> +	pSMB->Reserved = 0;
> +	pSMB->TotalParameterCount = cpu_to_le32(parm_len);
> +	pSMB->TotalDataCount  = 0;
> +	pSMB->MaxDataCount = cpu_to_le32((tcon->ses->server->maxBuf -
> +					  MAX_CIFS_HDR_SIZE) & 0xFFFFFF00);
> +	pSMB->ParameterCount = pSMB->TotalParameterCount;
> +	pSMB->DataCount  = pSMB->TotalDataCount;
> +	temp_offset = offsetof(struct smb_com_ntransact_req, Parms) +
> +			(setup_count * 2) - 4 /* for rfc1001 length itself */;
> +	pSMB->ParameterOffset = cpu_to_le32(temp_offset);
> +	pSMB->DataOffset = cpu_to_le32(temp_offset + parm_len);
> +	pSMB->SetupCount = setup_count; /* no need to le convert byte fields */
> +	pSMB->SubCommand = cpu_to_le16(sub_command);
> +	return 0;
> +}
> +
> +static int
> +validate_ntransact(char *buf, char **ppparm, char **ppdata,
> +		   __u32 *pparmlen, __u32 *pdatalen)
> +{
> +	char *end_of_smb;
> +	__u32 data_count, data_offset, parm_count, parm_offset;
> +	struct smb_com_ntransact_rsp *pSMBr;
> +
> +	*pdatalen = 0;
> +	*pparmlen = 0;
> +
> +	if (buf == NULL)
> +		return -EINVAL;
> +
> +	pSMBr = (struct smb_com_ntransact_rsp *)buf;
> +
> +	/* ByteCount was converted from little endian in SendReceive */
> +	end_of_smb = 2 /* sizeof byte count */ + pSMBr->ByteCount +
> +			(char *)&pSMBr->ByteCount;
> +
> +	data_offset = le32_to_cpu(pSMBr->DataOffset);
> +	data_count = le32_to_cpu(pSMBr->DataCount);
> +	parm_offset = le32_to_cpu(pSMBr->ParameterOffset);
> +	parm_count = le32_to_cpu(pSMBr->ParameterCount);
> +
> +	*ppparm = (char *)&pSMBr->hdr.Protocol + parm_offset;
> +	*ppdata = (char *)&pSMBr->hdr.Protocol + data_offset;
> +
> +	/* should we also check that parm and data areas do not overlap? */
> +	if (*ppparm > end_of_smb) {
> +		cFYI(1, "parms start after end of smb");
> +		return -EINVAL;
> +	} else if (parm_count + *ppparm > end_of_smb) {
> +		cFYI(1, "parm end after end of smb");
> +		return -EINVAL;
> +	} else if (*ppdata > end_of_smb) {
> +		cFYI(1, "data starts after end of smb");
> +		return -EINVAL;
> +	} else if (data_count + *ppdata > end_of_smb) {
> +		cFYI(1, "data %p + count %d (%p) past smb end %p start %p",
> +			*ppdata, data_count, (data_count + *ppdata),
> +			end_of_smb, pSMBr);
> +		return -EINVAL;
> +	} else if (parm_count + data_count > pSMBr->ByteCount) {
> +		cFYI(1, "parm count and data count larger than SMB");
> +		return -EINVAL;
> +	}
> +	*pdatalen = data_count;
> +	*pparmlen = parm_count;
> +	return 0;
> +}
> +
>  /* Get Security Descriptor (by handle) from remote server for a file or dir */
>  int
>  CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, __u16 fid,
> @@ -3214,7 +3215,7 @@ setCifsAclRetry:
>  	return (rc);
>  }
>  
> -#endif /* CONFIG_CIFS_EXPERIMENTAL */
> +#endif /* CONFIG_CIFS_ACL */
>  
>  /* Legacy Query Path Information call for lookup to old servers such
>     as Win9x/WinME */
> diff --git a/fs/cifs/file.c b/fs/cifs/file.c
> index b857ce5..5a28660 100644
> --- a/fs/cifs/file.c
> +++ b/fs/cifs/file.c
> @@ -1108,7 +1108,6 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file,
>  	return total_written;
>  }
>  
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
>  struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode,
>  					bool fsuid_only)
>  {
> @@ -1142,7 +1141,6 @@ struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode,
>  	spin_unlock(&cifs_file_list_lock);
>  	return NULL;
>  }
> -#endif
>  
>  struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode,
>  					bool fsuid_only)
> diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
> index 0023146..10d1cab 100644
> --- a/fs/cifs/inode.c
> +++ b/fs/cifs/inode.c
> @@ -687,7 +687,7 @@ int cifs_get_inode_info(struct inode **pinode,
>  			cFYI(1, "cifs_sfu_type failed: %d", tmprc);
>  	}
>  
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
> +#ifdef CONFIG_CIFS_ACL
>  	/* fill in 0777 bits from ACL */
>  	if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
>  		rc = cifs_acl_to_fattr(cifs_sb, &fattr, *pinode, full_path,
> @@ -698,7 +698,7 @@ int cifs_get_inode_info(struct inode **pinode,
>  			goto cgii_exit;
>  		}
>  	}
> -#endif
> +#endif /* CONFIG_CIFS_ACL */
>  
>  	/* fill in remaining high mode bits e.g. SUID, VTX */
>  	if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL)
> @@ -2128,7 +2128,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
>  
>  	if (attrs->ia_valid & ATTR_MODE) {
>  		rc = 0;
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
> +#ifdef CONFIG_CIFS_ACL
>  		if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
>  			rc = mode_to_cifs_acl(inode, full_path, mode);
>  			if (rc) {
> @@ -2137,7 +2137,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
>  				goto cifs_setattr_exit;
>  			}
>  		} else
> -#endif
> +#endif /* CONFIG_CIFS_ACL */
>  		if (((mode & S_IWUGO) == 0) &&
>  		    (cifsInode->cifsAttrs & ATTR_READONLY) == 0) {
>  


-- 
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: Tree for December 3 (cifs)
@ 2010-12-06 16:43                   ` Randy Dunlap
  0 siblings, 0 replies; 23+ messages in thread
From: Randy Dunlap @ 2010-12-06 16:43 UTC (permalink / raw)
  To: Jeff Layton
  Cc: Shirish Pargaonkar, Ingo Molnar, Steve French, Stephen Rothwell,
	linux-next, LKML, linux-cifs, Linus Torvalds, Andrew Morton

On 12/06/10 07:50, Jeff Layton wrote:
> On Mon, 6 Dec 2010 09:40:33 -0600
> Shirish Pargaonkar <shirishpargaonkar@gmail.com> wrote:
> 
>> On Mon, Dec 6, 2010 at 6:35 AM, Jeff Layton <jlayton@redhat.com> wrote:
>>> On Mon, 6 Dec 2010 08:09:56 +0100
>>> Ingo Molnar <mingo@elte.hu> wrote:
>>>
>>>>
>>>> * Randy Dunlap <randy.dunlap@oracle.com> wrote:
>>>>
>>>>> On Fri, 3 Dec 2010 13:04:40 +1100 Stephen Rothwell wrote:
>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> Changes since 20101202:
>>>>>
>>>>>
>>>>> When CIFS_EXPERIMENTAL is not enabled:
>>>>>
>>>>> (.text+0xdf6c9): undefined reference to `get_cifs_acl'
>>>>>
>>>>> from fs/cifs/xattr.c:cifs_getxattr()
>>>>>
>>>>>
>>>>> CONFIG_CIFS=y
>>>>> # CONFIG_CIFS_STATS is not set
>>>>> CONFIG_CIFS_WEAK_PW_HASH=y
>>>>> # CONFIG_CIFS_UPCALL is not set
>>>>> CONFIG_CIFS_XATTR=y
>>>>> CONFIG_CIFS_POSIX=y
>>>>> # CONFIG_CIFS_DEBUG2 is not set
>>>>> # CONFIG_CIFS_DFS_UPCALL is not set
>>>>> CONFIG_CIFS_FSCACHE=y
>>>>> CONFIG_CIFS_ACL=y
>>>>> # CONFIG_CIFS_EXPERIMENTAL is not set
>>>>
>>>> And this build regression has been pushed upstream now, as of:
>>>>
>>>>    8520eeaa1235: Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
>>>>
>>>> and it is triggering for me too:
>>>>
>>>>    fs/built-in.o: In function `cifs_getxattr':
>>>>    (.text+0xc518e): undefined reference to `get_cifs_acl'
>>>>
>>>> The regression got introduced by:
>>>>
>>>>    fbeba8bb16d7: cifs: Handle extended attribute name cifs_acl to generate cifs acl blob (try #4)
>>>>
>>>> Which introduced the new CIFS_ACL option.
>>>>
>>>> Thanks,
>>>>
>>>>       Ingo
>>>
>>> Yeah, looks like this new Kconfig option depends on some code that's
>>> under the (much-overloaded) CIFS_EXPERIMENTAL Kconfig option. I think
>>> this patch needs some rework. The simple fix would be to make it
>>> dependent on CIFS_EXPERIMENTAL, but that's rather icky since
>>
>> Making CONFIG_CIFS_ACL dependent on CONFIG_CIFS_EXPERIMENTAL
>> works
>>
>>  config CIFS_ACL
>>           bool "Provide CIFS ACL support (EXPERIMENTAL)"
>> -         depends on EXPERIMENTAL && CIFS_XATTR
>> +         depends on CIFS_EXPERIMENTAL && CIFS_XATTR
>>           help
>>             Allows to fetch CIFS/NTFS ACL from the server.  The DACL blob
>>             is handed over to the application/caller.
>>
>> At the minimum function find_readable_file() and three functions
>> in cifssmb.c would not have to be in CIFS_EXPERIMENTAL.
>> And we would need to move some other cifs acl related functions
>> from under CIFS_ACL from CIFS_EXPERIMENTAL.
>>
> 
> Ugh, let's not do that. CONFIG_CIFS_EXPERIMENTAL is like a box of
> chocolates...when you enable it you just never know what you're going
> to get...
> 
> I think the patch below is a better way to deal with this. It's larger
> than I would like to see at this point in the release cycle, but we
> might as well fix it the right way.
> 
> I also have some other patches to clean up CONFIG_CIFS_EXPERIMENTAL,
> but I'll send those along separately for 2.6.38.
> 
> Steve, if this looks good, I'll send it along to you as a "formal"
> patch for inclusion via your tree.

Thanks, that works.

Acked-by: Randy Dunlap <randy.dunlap@oracle.com>


> -------------------[snip]---------------------
> 
> cifs: fix use of CONFIG_CIFS_ACL
> 
> Some of the code under CONFIG_CIFS_ACL is dependent upon code under
> CONFIG_CIFS_EXPERIMENTAL, but the Kconfig options don't reflect that
> dependency. Move more of the ACL code out from under
> CONFIG_CIFS_EXPERIMENTAL and under CONFIG_CIFS_ACL.
> 
> Also move find_readable_file out from other any sort of Kconfig
> option and make it a function normally compiled in.
> 
> Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
> Signed-off-by: Jeff Layton <jlayton@redhat.com>
> ---
>  fs/cifs/Makefile    |    4 +-
>  fs/cifs/cifsacl.c   |    3 -
>  fs/cifs/cifsacl.h   |    4 -
>  fs/cifs/cifsproto.h |    2 -
>  fs/cifs/cifssmb.c   |  183 ++++++++++++++++++++++++++-------------------------
>  fs/cifs/file.c      |    2 -
>  fs/cifs/inode.c     |    8 +-
>  7 files changed, 99 insertions(+), 107 deletions(-)
> 
> diff --git a/fs/cifs/Makefile b/fs/cifs/Makefile
> index adefa60..43b19dd 100644
> --- a/fs/cifs/Makefile
> +++ b/fs/cifs/Makefile
> @@ -6,7 +6,9 @@ obj-$(CONFIG_CIFS) += cifs.o
>  cifs-y := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o \
>  	  link.o misc.o netmisc.o smbdes.o smbencrypt.o transport.o asn1.o \
>  	  md4.o md5.o cifs_unicode.o nterr.o xattr.o cifsencrypt.o \
> -	  readdir.o ioctl.o sess.o export.o cifsacl.o
> +	  readdir.o ioctl.o sess.o export.o
> +
> +cifs-$(CONFIG_CIFS_ACL) += cifsacl.o
>  
>  cifs-$(CONFIG_CIFS_UPCALL) += cifs_spnego.o
>  
> diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c
> index c6ebea0..a437ec3 100644
> --- a/fs/cifs/cifsacl.c
> +++ b/fs/cifs/cifsacl.c
> @@ -30,8 +30,6 @@
>  #include "cifs_debug.h"
>  
>  
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
> -
>  static struct cifs_wksid wksidarr[NUM_WK_SIDS] = {
>  	{{1, 0, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0} }, "null user"},
>  	{{1, 1, {0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 0} }, "nobody"},
> @@ -774,4 +772,3 @@ int mode_to_cifs_acl(struct inode *inode, const char *path, __u64 nmode)
>  
>  	return rc;
>  }
> -#endif /* CONFIG_CIFS_EXPERIMENTAL */
> diff --git a/fs/cifs/cifsacl.h b/fs/cifs/cifsacl.h
> index 6c8096c..c4ae7d0 100644
> --- a/fs/cifs/cifsacl.h
> +++ b/fs/cifs/cifsacl.h
> @@ -74,11 +74,7 @@ struct cifs_wksid {
>  	char sidname[SIDNAMELENGTH];
>  } __attribute__((packed));
>  
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
> -
>  extern int match_sid(struct cifs_sid *);
>  extern int compare_sids(const struct cifs_sid *, const struct cifs_sid *);
>  
> -#endif /*  CONFIG_CIFS_EXPERIMENTAL */
> -
>  #endif /* _CIFSACL_H */
> diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
> index 38cdec9..cb65499 100644
> --- a/fs/cifs/cifsproto.h
> +++ b/fs/cifs/cifsproto.h
> @@ -80,9 +80,7 @@ extern bool is_valid_oplock_break(struct smb_hdr *smb,
>  				  struct TCP_Server_Info *);
>  extern bool is_size_safe_to_change(struct cifsInodeInfo *, __u64 eof);
>  extern struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *, bool);
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
>  extern struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *, bool);
> -#endif
>  extern unsigned int smbCalcSize(struct smb_hdr *ptr);
>  extern unsigned int smbCalcSize_LE(struct smb_hdr *ptr);
>  extern int decode_negTokenInit(unsigned char *security_blob, int length,
> diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
> index 0ef7c3a..d7957a3 100644
> --- a/fs/cifs/cifssmb.c
> +++ b/fs/cifs/cifssmb.c
> @@ -2478,95 +2478,6 @@ querySymLinkRetry:
>  }
>  
>  #ifdef CONFIG_CIFS_EXPERIMENTAL
> -/* Initialize NT TRANSACT SMB into small smb request buffer.
> -   This assumes that all NT TRANSACTS that we init here have
> -   total parm and data under about 400 bytes (to fit in small cifs
> -   buffer size), which is the case so far, it easily fits. NB:
> -	Setup words themselves and ByteCount
> -	MaxSetupCount (size of returned setup area) and
> -	MaxParameterCount (returned parms size) must be set by caller */
> -static int
> -smb_init_nttransact(const __u16 sub_command, const int setup_count,
> -		   const int parm_len, struct cifsTconInfo *tcon,
> -		   void **ret_buf)
> -{
> -	int rc;
> -	__u32 temp_offset;
> -	struct smb_com_ntransact_req *pSMB;
> -
> -	rc = small_smb_init(SMB_COM_NT_TRANSACT, 19 + setup_count, tcon,
> -				(void **)&pSMB);
> -	if (rc)
> -		return rc;
> -	*ret_buf = (void *)pSMB;
> -	pSMB->Reserved = 0;
> -	pSMB->TotalParameterCount = cpu_to_le32(parm_len);
> -	pSMB->TotalDataCount  = 0;
> -	pSMB->MaxDataCount = cpu_to_le32((tcon->ses->server->maxBuf -
> -					  MAX_CIFS_HDR_SIZE) & 0xFFFFFF00);
> -	pSMB->ParameterCount = pSMB->TotalParameterCount;
> -	pSMB->DataCount  = pSMB->TotalDataCount;
> -	temp_offset = offsetof(struct smb_com_ntransact_req, Parms) +
> -			(setup_count * 2) - 4 /* for rfc1001 length itself */;
> -	pSMB->ParameterOffset = cpu_to_le32(temp_offset);
> -	pSMB->DataOffset = cpu_to_le32(temp_offset + parm_len);
> -	pSMB->SetupCount = setup_count; /* no need to le convert byte fields */
> -	pSMB->SubCommand = cpu_to_le16(sub_command);
> -	return 0;
> -}
> -
> -static int
> -validate_ntransact(char *buf, char **ppparm, char **ppdata,
> -		   __u32 *pparmlen, __u32 *pdatalen)
> -{
> -	char *end_of_smb;
> -	__u32 data_count, data_offset, parm_count, parm_offset;
> -	struct smb_com_ntransact_rsp *pSMBr;
> -
> -	*pdatalen = 0;
> -	*pparmlen = 0;
> -
> -	if (buf == NULL)
> -		return -EINVAL;
> -
> -	pSMBr = (struct smb_com_ntransact_rsp *)buf;
> -
> -	/* ByteCount was converted from little endian in SendReceive */
> -	end_of_smb = 2 /* sizeof byte count */ + pSMBr->ByteCount +
> -			(char *)&pSMBr->ByteCount;
> -
> -	data_offset = le32_to_cpu(pSMBr->DataOffset);
> -	data_count = le32_to_cpu(pSMBr->DataCount);
> -	parm_offset = le32_to_cpu(pSMBr->ParameterOffset);
> -	parm_count = le32_to_cpu(pSMBr->ParameterCount);
> -
> -	*ppparm = (char *)&pSMBr->hdr.Protocol + parm_offset;
> -	*ppdata = (char *)&pSMBr->hdr.Protocol + data_offset;
> -
> -	/* should we also check that parm and data areas do not overlap? */
> -	if (*ppparm > end_of_smb) {
> -		cFYI(1, "parms start after end of smb");
> -		return -EINVAL;
> -	} else if (parm_count + *ppparm > end_of_smb) {
> -		cFYI(1, "parm end after end of smb");
> -		return -EINVAL;
> -	} else if (*ppdata > end_of_smb) {
> -		cFYI(1, "data starts after end of smb");
> -		return -EINVAL;
> -	} else if (data_count + *ppdata > end_of_smb) {
> -		cFYI(1, "data %p + count %d (%p) past smb end %p start %p",
> -			*ppdata, data_count, (data_count + *ppdata),
> -			end_of_smb, pSMBr);
> -		return -EINVAL;
> -	} else if (parm_count + data_count > pSMBr->ByteCount) {
> -		cFYI(1, "parm count and data count larger than SMB");
> -		return -EINVAL;
> -	}
> -	*pdatalen = data_count;
> -	*pparmlen = parm_count;
> -	return 0;
> -}
> -
>  int
>  CIFSSMBQueryReparseLinkInfo(const int xid, struct cifsTconInfo *tcon,
>  			const unsigned char *searchName,
> @@ -3056,7 +2967,97 @@ GetExtAttrOut:
>  
>  #endif /* CONFIG_POSIX */
>  
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
> +#ifdef CONFIG_CIFS_ACL
> +/*
> + * Initialize NT TRANSACT SMB into small smb request buffer.  This assumes that
> + * all NT TRANSACTS that we init here have total parm and data under about 400
> + * bytes (to fit in small cifs buffer size), which is the case so far, it
> + * easily fits. NB: Setup words themselves and ByteCount MaxSetupCount (size of
> + * returned setup area) and MaxParameterCount (returned parms size) must be set
> + * by caller
> + */
> +static int
> +smb_init_nttransact(const __u16 sub_command, const int setup_count,
> +		   const int parm_len, struct cifsTconInfo *tcon,
> +		   void **ret_buf)
> +{
> +	int rc;
> +	__u32 temp_offset;
> +	struct smb_com_ntransact_req *pSMB;
> +
> +	rc = small_smb_init(SMB_COM_NT_TRANSACT, 19 + setup_count, tcon,
> +				(void **)&pSMB);
> +	if (rc)
> +		return rc;
> +	*ret_buf = (void *)pSMB;
> +	pSMB->Reserved = 0;
> +	pSMB->TotalParameterCount = cpu_to_le32(parm_len);
> +	pSMB->TotalDataCount  = 0;
> +	pSMB->MaxDataCount = cpu_to_le32((tcon->ses->server->maxBuf -
> +					  MAX_CIFS_HDR_SIZE) & 0xFFFFFF00);
> +	pSMB->ParameterCount = pSMB->TotalParameterCount;
> +	pSMB->DataCount  = pSMB->TotalDataCount;
> +	temp_offset = offsetof(struct smb_com_ntransact_req, Parms) +
> +			(setup_count * 2) - 4 /* for rfc1001 length itself */;
> +	pSMB->ParameterOffset = cpu_to_le32(temp_offset);
> +	pSMB->DataOffset = cpu_to_le32(temp_offset + parm_len);
> +	pSMB->SetupCount = setup_count; /* no need to le convert byte fields */
> +	pSMB->SubCommand = cpu_to_le16(sub_command);
> +	return 0;
> +}
> +
> +static int
> +validate_ntransact(char *buf, char **ppparm, char **ppdata,
> +		   __u32 *pparmlen, __u32 *pdatalen)
> +{
> +	char *end_of_smb;
> +	__u32 data_count, data_offset, parm_count, parm_offset;
> +	struct smb_com_ntransact_rsp *pSMBr;
> +
> +	*pdatalen = 0;
> +	*pparmlen = 0;
> +
> +	if (buf == NULL)
> +		return -EINVAL;
> +
> +	pSMBr = (struct smb_com_ntransact_rsp *)buf;
> +
> +	/* ByteCount was converted from little endian in SendReceive */
> +	end_of_smb = 2 /* sizeof byte count */ + pSMBr->ByteCount +
> +			(char *)&pSMBr->ByteCount;
> +
> +	data_offset = le32_to_cpu(pSMBr->DataOffset);
> +	data_count = le32_to_cpu(pSMBr->DataCount);
> +	parm_offset = le32_to_cpu(pSMBr->ParameterOffset);
> +	parm_count = le32_to_cpu(pSMBr->ParameterCount);
> +
> +	*ppparm = (char *)&pSMBr->hdr.Protocol + parm_offset;
> +	*ppdata = (char *)&pSMBr->hdr.Protocol + data_offset;
> +
> +	/* should we also check that parm and data areas do not overlap? */
> +	if (*ppparm > end_of_smb) {
> +		cFYI(1, "parms start after end of smb");
> +		return -EINVAL;
> +	} else if (parm_count + *ppparm > end_of_smb) {
> +		cFYI(1, "parm end after end of smb");
> +		return -EINVAL;
> +	} else if (*ppdata > end_of_smb) {
> +		cFYI(1, "data starts after end of smb");
> +		return -EINVAL;
> +	} else if (data_count + *ppdata > end_of_smb) {
> +		cFYI(1, "data %p + count %d (%p) past smb end %p start %p",
> +			*ppdata, data_count, (data_count + *ppdata),
> +			end_of_smb, pSMBr);
> +		return -EINVAL;
> +	} else if (parm_count + data_count > pSMBr->ByteCount) {
> +		cFYI(1, "parm count and data count larger than SMB");
> +		return -EINVAL;
> +	}
> +	*pdatalen = data_count;
> +	*pparmlen = parm_count;
> +	return 0;
> +}
> +
>  /* Get Security Descriptor (by handle) from remote server for a file or dir */
>  int
>  CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, __u16 fid,
> @@ -3214,7 +3215,7 @@ setCifsAclRetry:
>  	return (rc);
>  }
>  
> -#endif /* CONFIG_CIFS_EXPERIMENTAL */
> +#endif /* CONFIG_CIFS_ACL */
>  
>  /* Legacy Query Path Information call for lookup to old servers such
>     as Win9x/WinME */
> diff --git a/fs/cifs/file.c b/fs/cifs/file.c
> index b857ce5..5a28660 100644
> --- a/fs/cifs/file.c
> +++ b/fs/cifs/file.c
> @@ -1108,7 +1108,6 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file,
>  	return total_written;
>  }
>  
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
>  struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode,
>  					bool fsuid_only)
>  {
> @@ -1142,7 +1141,6 @@ struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode,
>  	spin_unlock(&cifs_file_list_lock);
>  	return NULL;
>  }
> -#endif
>  
>  struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode,
>  					bool fsuid_only)
> diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
> index 0023146..10d1cab 100644
> --- a/fs/cifs/inode.c
> +++ b/fs/cifs/inode.c
> @@ -687,7 +687,7 @@ int cifs_get_inode_info(struct inode **pinode,
>  			cFYI(1, "cifs_sfu_type failed: %d", tmprc);
>  	}
>  
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
> +#ifdef CONFIG_CIFS_ACL
>  	/* fill in 0777 bits from ACL */
>  	if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
>  		rc = cifs_acl_to_fattr(cifs_sb, &fattr, *pinode, full_path,
> @@ -698,7 +698,7 @@ int cifs_get_inode_info(struct inode **pinode,
>  			goto cgii_exit;
>  		}
>  	}
> -#endif
> +#endif /* CONFIG_CIFS_ACL */
>  
>  	/* fill in remaining high mode bits e.g. SUID, VTX */
>  	if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL)
> @@ -2128,7 +2128,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
>  
>  	if (attrs->ia_valid & ATTR_MODE) {
>  		rc = 0;
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
> +#ifdef CONFIG_CIFS_ACL
>  		if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
>  			rc = mode_to_cifs_acl(inode, full_path, mode);
>  			if (rc) {
> @@ -2137,7 +2137,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
>  				goto cifs_setattr_exit;
>  			}
>  		} else
> -#endif
> +#endif /* CONFIG_CIFS_ACL */
>  		if (((mode & S_IWUGO) == 0) &&
>  		    (cifsInode->cifsAttrs & ATTR_READONLY) == 0) {
>  


-- 
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: Tree for December 3 (cifs)
       [not found]                     ` <AANLkTinbR4+gtYt7-8ZFS7kdkWAs0CFxCD_mq9oy1Pa_-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2010-12-06 17:30                       ` Jeff Layton
  0 siblings, 0 replies; 23+ messages in thread
From: Jeff Layton @ 2010-12-06 17:30 UTC (permalink / raw)
  To: Steve French
  Cc: Shirish Pargaonkar, sfrench-eUNUBHrolfbYtjvyW6yDsg,
	linux-cifs-u79uwXL29TY76Z2rM5mHXA

On Mon, 6 Dec 2010 10:24:59 -0600
Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> On Mon, Dec 6, 2010 at 10:22 AM, Shirish Pargaonkar <
> shirishpargaonkar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> 
> > On Mon, Dec 6, 2010 at 9:50 AM, Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
> > > On Mon, 6 Dec 2010 09:40:33 -0600
> > > Shirish Pargaonkar <shirishpargaonkar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > >
> > >> On Mon, Dec 6, 2010 at 6:35 AM, Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
> > >> > On Mon, 6 Dec 2010 08:09:56 +0100
> > >> > Ingo Molnar <mingo-X9Un+BFzKDI@public.gmane.org> wrote:
> > >> >
> > >> >>
> > >> >> * Randy Dunlap <randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> wrote:
> > >> >>
> > >> >> > On Fri, 3 Dec 2010 13:04:40 +1100 Stephen Rothwell wrote:
> > >> >> >
> > >> >> > > Hi all,
> > >> >> > >
> > >> >> > > Changes since 20101202:
> > >> >> >
> > >> >> >
> > >> >> > When CIFS_EXPERIMENTAL is not enabled:
> > >> >> >
> > >> >> > (.text+0xdf6c9): undefined reference to `get_cifs_acl'
> > >> >> >
> > >> >> > from fs/cifs/xattr.c:cifs_getxattr()
> > >> >> >
> > >> >> >
> > >> >> > CONFIG_CIFS=y
> > >> >> > # CONFIG_CIFS_STATS is not set
> > >> >> > CONFIG_CIFS_WEAK_PW_HASH=y
> > >> >> > # CONFIG_CIFS_UPCALL is not set
> > >> >> > CONFIG_CIFS_XATTR=y
> > >> >> > CONFIG_CIFS_POSIX=y
> > >> >> > # CONFIG_CIFS_DEBUG2 is not set
> > >> >> > # CONFIG_CIFS_DFS_UPCALL is not set
> > >> >> > CONFIG_CIFS_FSCACHE=y
> > >> >> > CONFIG_CIFS_ACL=y
> > >> >> > # CONFIG_CIFS_EXPERIMENTAL is not set
> > >> >>
> > >> >> And this build regression has been pushed upstream now, as of:
> > >> >>
> > >> >>    8520eeaa1235: Merge git://
> > git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
> > >> >>
> > >> >> and it is triggering for me too:
> > >> >>
> > >> >>    fs/built-in.o: In function `cifs_getxattr':
> > >> >>    (.text+0xc518e): undefined reference to `get_cifs_acl'
> > >> >>
> > >> >> The regression got introduced by:
> > >> >>
> > >> >>    fbeba8bb16d7: cifs: Handle extended attribute name cifs_acl to
> > generate cifs acl blob (try #4)
> > >> >>
> > >> >> Which introduced the new CIFS_ACL option.
> > >> >>
> > >> >> Thanks,
> > >> >>
> > >> >>       Ingo
> > >> >
> > >> > Yeah, looks like this new Kconfig option depends on some code that's
> > >> > under the (much-overloaded) CIFS_EXPERIMENTAL Kconfig option. I think
> > >> > this patch needs some rework. The simple fix would be to make it
> > >> > dependent on CIFS_EXPERIMENTAL, but that's rather icky since
> > >>
> > >> Making CONFIG_CIFS_ACL dependent on CONFIG_CIFS_EXPERIMENTAL
> > >> works
> > >>
> > >>  config CIFS_ACL
> > >>           bool "Provide CIFS ACL support (EXPERIMENTAL)"
> > >> -         depends on EXPERIMENTAL && CIFS_XATTR
> > >> +         depends on CIFS_EXPERIMENTAL && CIFS_XATTR
> > >>           help
> > >>             Allows to fetch CIFS/NTFS ACL from the server.  The DACL
> > blob
> > >>             is handed over to the application/caller.
> > >>
> > >> At the minimum function find_readable_file() and three functions
> > >> in cifssmb.c would not have to be in CIFS_EXPERIMENTAL.
> > >> And we would need to move some other cifs acl related functions
> > >> from under CIFS_ACL from CIFS_EXPERIMENTAL.
> > >>
> > >
> > > Ugh, let's not do that. CONFIG_CIFS_EXPERIMENTAL is like a box of
> > > chocolates...when you enable it you just never know what you're going
> > > to get...
> > >
> > > I think the patch below is a better way to deal with this. It's larger
> > > than I would like to see at this point in the release cycle, but we
> > > might as well fix it the right way.
> > >
> > > I also have some other patches to clean up CONFIG_CIFS_EXPERIMENTAL,
> > > but I'll send those along separately for 2.6.38.
> > >
> > > Steve, if this looks good, I'll send it along to you as a "formal"
> > > patch for inclusion via your tree.
> > >
> > > -------------------[snip]---------------------
> > >
> > > cifs: fix use of CONFIG_CIFS_ACL
> > >
> > > Some of the code under CONFIG_CIFS_ACL is dependent upon code under
> > > CONFIG_CIFS_EXPERIMENTAL, but the Kconfig options don't reflect that
> > > dependency. Move more of the ACL code out from under
> > > CONFIG_CIFS_EXPERIMENTAL and under CONFIG_CIFS_ACL.
> > >
> > > Also move find_readable_file out from other any sort of Kconfig
> > > option and make it a function normally compiled in.
> > >
> > > Reported-by: Randy Dunlap <randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> > > Signed-off-by: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> > > ---
> > >  fs/cifs/Makefile    |    4 +-
> > >  fs/cifs/cifsacl.c   |    3 -
> > >  fs/cifs/cifsacl.h   |    4 -
> > >  fs/cifs/cifsproto.h |    2 -
> > >  fs/cifs/cifssmb.c   |  183
> > ++++++++++++++++++++++++++-------------------------
> > >  fs/cifs/file.c      |    2 -
> > >  fs/cifs/inode.c     |    8 +-
> > >  7 files changed, 99 insertions(+), 107 deletions(-)
> > >
> > > diff --git a/fs/cifs/Makefile b/fs/cifs/Makefile
> > > index adefa60..43b19dd 100644
> > > --- a/fs/cifs/Makefile
> > > +++ b/fs/cifs/Makefile
> > > @@ -6,7 +6,9 @@ obj-$(CONFIG_CIFS) += cifs.o
> > >  cifs-y := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o
> > \
> > >          link.o misc.o netmisc.o smbdes.o smbencrypt.o transport.o asn1.o
> > \
> > >          md4.o md5.o cifs_unicode.o nterr.o xattr.o cifsencrypt.o \
> > > -         readdir.o ioctl.o sess.o export.o cifsacl.o
> > > +         readdir.o ioctl.o sess.o export.o
> > > +
> > > +cifs-$(CONFIG_CIFS_ACL) += cifsacl.o
> > >
> > >  cifs-$(CONFIG_CIFS_UPCALL) += cifs_spnego.o
> > >
> > > diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c
> > > index c6ebea0..a437ec3 100644
> > > --- a/fs/cifs/cifsacl.c
> > > +++ b/fs/cifs/cifsacl.c
> > > @@ -30,8 +30,6 @@
> > >  #include "cifs_debug.h"
> > >
> > >
> > > -#ifdef CONFIG_CIFS_EXPERIMENTAL
> > > -
> > >  static struct cifs_wksid wksidarr[NUM_WK_SIDS] = {
> > >        {{1, 0, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0} }, "null user"},
> > >        {{1, 1, {0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 0} }, "nobody"},
> > > @@ -774,4 +772,3 @@ int mode_to_cifs_acl(struct inode *inode, const char
> > *path, __u64 nmode)
> > >
> > >        return rc;
> > >  }
> > > -#endif /* CONFIG_CIFS_EXPERIMENTAL */
> > > diff --git a/fs/cifs/cifsacl.h b/fs/cifs/cifsacl.h
> > > index 6c8096c..c4ae7d0 100644
> > > --- a/fs/cifs/cifsacl.h
> > > +++ b/fs/cifs/cifsacl.h
> > > @@ -74,11 +74,7 @@ struct cifs_wksid {
> > >        char sidname[SIDNAMELENGTH];
> > >  } __attribute__((packed));
> > >
> > > -#ifdef CONFIG_CIFS_EXPERIMENTAL
> > > -
> > >  extern int match_sid(struct cifs_sid *);
> > >  extern int compare_sids(const struct cifs_sid *, const struct cifs_sid
> > *);
> > >
> > > -#endif /*  CONFIG_CIFS_EXPERIMENTAL */
> > > -
> > >  #endif /* _CIFSACL_H */
> > > diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
> > > index 38cdec9..cb65499 100644
> > > --- a/fs/cifs/cifsproto.h
> > > +++ b/fs/cifs/cifsproto.h
> > > @@ -80,9 +80,7 @@ extern bool is_valid_oplock_break(struct smb_hdr *smb,
> > >                                  struct TCP_Server_Info *);
> > >  extern bool is_size_safe_to_change(struct cifsInodeInfo *, __u64 eof);
> > >  extern struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *,
> > bool);
> > > -#ifdef CONFIG_CIFS_EXPERIMENTAL
> > >  extern struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *,
> > bool);
> > > -#endif
> > >  extern unsigned int smbCalcSize(struct smb_hdr *ptr);
> > >  extern unsigned int smbCalcSize_LE(struct smb_hdr *ptr);
> > >  extern int decode_negTokenInit(unsigned char *security_blob, int length,
> > > diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
> > > index 0ef7c3a..d7957a3 100644
> > > --- a/fs/cifs/cifssmb.c
> > > +++ b/fs/cifs/cifssmb.c
> > > @@ -2478,95 +2478,6 @@ querySymLinkRetry:
> > >  }
> > >
> > >  #ifdef CONFIG_CIFS_EXPERIMENTAL
> > > -/* Initialize NT TRANSACT SMB into small smb request buffer.
> > > -   This assumes that all NT TRANSACTS that we init here have
> > > -   total parm and data under about 400 bytes (to fit in small cifs
> > > -   buffer size), which is the case so far, it easily fits. NB:
> > > -       Setup words themselves and ByteCount
> > > -       MaxSetupCount (size of returned setup area) and
> > > -       MaxParameterCount (returned parms size) must be set by caller */
> > > -static int
> > > -smb_init_nttransact(const __u16 sub_command, const int setup_count,
> > > -                  const int parm_len, struct cifsTconInfo *tcon,
> > > -                  void **ret_buf)
> > > -{
> > > -       int rc;
> > > -       __u32 temp_offset;
> > > -       struct smb_com_ntransact_req *pSMB;
> > > -
> > > -       rc = small_smb_init(SMB_COM_NT_TRANSACT, 19 + setup_count, tcon,
> > > -                               (void **)&pSMB);
> > > -       if (rc)
> > > -               return rc;
> > > -       *ret_buf = (void *)pSMB;
> > > -       pSMB->Reserved = 0;
> > > -       pSMB->TotalParameterCount = cpu_to_le32(parm_len);
> > > -       pSMB->TotalDataCount  = 0;
> > > -       pSMB->MaxDataCount = cpu_to_le32((tcon->ses->server->maxBuf -
> > > -                                         MAX_CIFS_HDR_SIZE) &
> > 0xFFFFFF00);
> > > -       pSMB->ParameterCount = pSMB->TotalParameterCount;
> > > -       pSMB->DataCount  = pSMB->TotalDataCount;
> > > -       temp_offset = offsetof(struct smb_com_ntransact_req, Parms) +
> > > -                       (setup_count * 2) - 4 /* for rfc1001 length
> > itself */;
> > > -       pSMB->ParameterOffset = cpu_to_le32(temp_offset);
> > > -       pSMB->DataOffset = cpu_to_le32(temp_offset + parm_len);
> > > -       pSMB->SetupCount = setup_count; /* no need to le convert byte
> > fields */
> > > -       pSMB->SubCommand = cpu_to_le16(sub_command);
> > > -       return 0;
> > > -}
> > > -
> > > -static int
> > > -validate_ntransact(char *buf, char **ppparm, char **ppdata,
> > > -                  __u32 *pparmlen, __u32 *pdatalen)
> > > -{
> > > -       char *end_of_smb;
> > > -       __u32 data_count, data_offset, parm_count, parm_offset;
> > > -       struct smb_com_ntransact_rsp *pSMBr;
> > > -
> > > -       *pdatalen = 0;
> > > -       *pparmlen = 0;
> > > -
> > > -       if (buf == NULL)
> > > -               return -EINVAL;
> > > -
> > > -       pSMBr = (struct smb_com_ntransact_rsp *)buf;
> > > -
> > > -       /* ByteCount was converted from little endian in SendReceive */
> > > -       end_of_smb = 2 /* sizeof byte count */ + pSMBr->ByteCount +
> > > -                       (char *)&pSMBr->ByteCount;
> > > -
> > > -       data_offset = le32_to_cpu(pSMBr->DataOffset);
> > > -       data_count = le32_to_cpu(pSMBr->DataCount);
> > > -       parm_offset = le32_to_cpu(pSMBr->ParameterOffset);
> > > -       parm_count = le32_to_cpu(pSMBr->ParameterCount);
> > > -
> > > -       *ppparm = (char *)&pSMBr->hdr.Protocol + parm_offset;
> > > -       *ppdata = (char *)&pSMBr->hdr.Protocol + data_offset;
> > > -
> > > -       /* should we also check that parm and data areas do not overlap?
> > */
> > > -       if (*ppparm > end_of_smb) {
> > > -               cFYI(1, "parms start after end of smb");
> > > -               return -EINVAL;
> > > -       } else if (parm_count + *ppparm > end_of_smb) {
> > > -               cFYI(1, "parm end after end of smb");
> > > -               return -EINVAL;
> > > -       } else if (*ppdata > end_of_smb) {
> > > -               cFYI(1, "data starts after end of smb");
> > > -               return -EINVAL;
> > > -       } else if (data_count + *ppdata > end_of_smb) {
> > > -               cFYI(1, "data %p + count %d (%p) past smb end %p start
> > %p",
> > > -                       *ppdata, data_count, (data_count + *ppdata),
> > > -                       end_of_smb, pSMBr);
> > > -               return -EINVAL;
> > > -       } else if (parm_count + data_count > pSMBr->ByteCount) {
> > > -               cFYI(1, "parm count and data count larger than SMB");
> > > -               return -EINVAL;
> > > -       }
> > > -       *pdatalen = data_count;
> > > -       *pparmlen = parm_count;
> > > -       return 0;
> > > -}
> > > -
> > >  int
> > >  CIFSSMBQueryReparseLinkInfo(const int xid, struct cifsTconInfo *tcon,
> > >                        const unsigned char *searchName,
> > > @@ -3056,7 +2967,97 @@ GetExtAttrOut:
> > >
> > >  #endif /* CONFIG_POSIX */
> > >
> > > -#ifdef CONFIG_CIFS_EXPERIMENTAL
> > > +#ifdef CONFIG_CIFS_ACL
> > > +/*
> > > + * Initialize NT TRANSACT SMB into small smb request buffer.  This
> > assumes that
> > > + * all NT TRANSACTS that we init here have total parm and data under
> > about 400
> > > + * bytes (to fit in small cifs buffer size), which is the case so far,
> > it
> > > + * easily fits. NB: Setup words themselves and ByteCount MaxSetupCount
> > (size of
> > > + * returned setup area) and MaxParameterCount (returned parms size) must
> > be set
> > > + * by caller
> > > + */
> > > +static int
> > > +smb_init_nttransact(const __u16 sub_command, const int setup_count,
> > > +                  const int parm_len, struct cifsTconInfo *tcon,
> > > +                  void **ret_buf)
> > > +{
> > > +       int rc;
> > > +       __u32 temp_offset;
> > > +       struct smb_com_ntransact_req *pSMB;
> > > +
> > > +       rc = small_smb_init(SMB_COM_NT_TRANSACT, 19 + setup_count, tcon,
> > > +                               (void **)&pSMB);
> > > +       if (rc)
> > > +               return rc;
> > > +       *ret_buf = (void *)pSMB;
> > > +       pSMB->Reserved = 0;
> > > +       pSMB->TotalParameterCount = cpu_to_le32(parm_len);
> > > +       pSMB->TotalDataCount  = 0;
> > > +       pSMB->MaxDataCount = cpu_to_le32((tcon->ses->server->maxBuf -
> > > +                                         MAX_CIFS_HDR_SIZE) &
> > 0xFFFFFF00);
> > > +       pSMB->ParameterCount = pSMB->TotalParameterCount;
> > > +       pSMB->DataCount  = pSMB->TotalDataCount;
> > > +       temp_offset = offsetof(struct smb_com_ntransact_req, Parms) +
> > > +                       (setup_count * 2) - 4 /* for rfc1001 length
> > itself */;
> > > +       pSMB->ParameterOffset = cpu_to_le32(temp_offset);
> > > +       pSMB->DataOffset = cpu_to_le32(temp_offset + parm_len);
> > > +       pSMB->SetupCount = setup_count; /* no need to le convert byte
> > fields */
> > > +       pSMB->SubCommand = cpu_to_le16(sub_command);
> > > +       return 0;
> > > +}
> > > +
> > > +static int
> > > +validate_ntransact(char *buf, char **ppparm, char **ppdata,
> > > +                  __u32 *pparmlen, __u32 *pdatalen)
> > > +{
> > > +       char *end_of_smb;
> > > +       __u32 data_count, data_offset, parm_count, parm_offset;
> > > +       struct smb_com_ntransact_rsp *pSMBr;
> > > +
> > > +       *pdatalen = 0;
> > > +       *pparmlen = 0;
> > > +
> > > +       if (buf == NULL)
> > > +               return -EINVAL;
> > > +
> > > +       pSMBr = (struct smb_com_ntransact_rsp *)buf;
> > > +
> > > +       /* ByteCount was converted from little endian in SendReceive */
> > > +       end_of_smb = 2 /* sizeof byte count */ + pSMBr->ByteCount +
> > > +                       (char *)&pSMBr->ByteCount;
> > > +
> > > +       data_offset = le32_to_cpu(pSMBr->DataOffset);
> > > +       data_count = le32_to_cpu(pSMBr->DataCount);
> > > +       parm_offset = le32_to_cpu(pSMBr->ParameterOffset);
> > > +       parm_count = le32_to_cpu(pSMBr->ParameterCount);
> > > +
> > > +       *ppparm = (char *)&pSMBr->hdr.Protocol + parm_offset;
> > > +       *ppdata = (char *)&pSMBr->hdr.Protocol + data_offset;
> > > +
> > > +       /* should we also check that parm and data areas do not overlap?
> > */
> > > +       if (*ppparm > end_of_smb) {
> > > +               cFYI(1, "parms start after end of smb");
> > > +               return -EINVAL;
> > > +       } else if (parm_count + *ppparm > end_of_smb) {
> > > +               cFYI(1, "parm end after end of smb");
> > > +               return -EINVAL;
> > > +       } else if (*ppdata > end_of_smb) {
> > > +               cFYI(1, "data starts after end of smb");
> > > +               return -EINVAL;
> > > +       } else if (data_count + *ppdata > end_of_smb) {
> > > +               cFYI(1, "data %p + count %d (%p) past smb end %p start
> > %p",
> > > +                       *ppdata, data_count, (data_count + *ppdata),
> > > +                       end_of_smb, pSMBr);
> > > +               return -EINVAL;
> > > +       } else if (parm_count + data_count > pSMBr->ByteCount) {
> > > +               cFYI(1, "parm count and data count larger than SMB");
> > > +               return -EINVAL;
> > > +       }
> > > +       *pdatalen = data_count;
> > > +       *pparmlen = parm_count;
> > > +       return 0;
> > > +}
> > > +
> >
> > Jeff, comment being, functions smb_nt_transact and validate_nttransact
> > although used by only cifs acl related functions, probably were not meant
> > to be limited to CIFS_ACL config option code, I think they existed even
> > before cifs acl code came into existence, not 100% sure.
> >
> > smb_nt_transact and validate_nttransact don't need to be in experimental
> ifdef.  They have been around for years.
> 

The problem there is that moving those functions out of the ifdef
will cause a compiler warning about unused functions when
CONFIG_CIFS_ACL is disabled. I think we ought to just leave the patch
as-is. We can always move those functions out from under the ifdef
later if needed...

-- 
Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: Tree for December 3
  2009-12-03 14:13   ` Stephen Rothwell
@ 2009-12-03 14:18     ` Jiri Kosina
  0 siblings, 0 replies; 23+ messages in thread
From: Jiri Kosina @ 2009-12-03 14:18 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, LKML

On Fri, 4 Dec 2009, Stephen Rothwell wrote:

> > > Merging trivial/for-next
> > > CONFLICT (content): Merge conflict in Documentation/video4linux/gspca.txt
> > 
> > have you been sending out e-mail about this conflict? I don't seem to have 
> > received any.
> 
> No, I didn't because it is very simple and was only in a documentation
> file.  I figured it would be cleared up easily if/when it comes up in
> being merged into Linus' tree (or maybe before if it is noticed).

Excellent, thanks.

-- 
Jiri Kosina
SUSE Labs, Novell Inc.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: Tree for December 3
  2009-12-03 13:37 ` Jiri Kosina
@ 2009-12-03 14:13   ` Stephen Rothwell
  2009-12-03 14:18     ` Jiri Kosina
  0 siblings, 1 reply; 23+ messages in thread
From: Stephen Rothwell @ 2009-12-03 14:13 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-next, LKML

[-- Attachment #1: Type: text/plain, Size: 621 bytes --]

Hi Jiri,

On Thu, 3 Dec 2009 14:37:06 +0100 (CET) Jiri Kosina <jkosina@suse.cz> wrote:
>
> > Merging trivial/for-next
> > CONFLICT (content): Merge conflict in Documentation/video4linux/gspca.txt
> 
> have you been sending out e-mail about this conflict? I don't seem to have 
> received any.

No, I didn't because it is very simple and was only in a documentation
file.  I figured it would be cleared up easily if/when it comes up in
being merged into Linus' tree (or maybe before if it is noticed).
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: Tree for December 3
  2009-12-03  7:02 linux-next: Tree for December 3 Stephen Rothwell
  2009-12-03  7:40 ` Michal Simek
@ 2009-12-03 13:37 ` Jiri Kosina
  2009-12-03 14:13   ` Stephen Rothwell
  1 sibling, 1 reply; 23+ messages in thread
From: Jiri Kosina @ 2009-12-03 13:37 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, LKML

On Thu, 3 Dec 2009, Stephen Rothwell wrote:

> Changes since 20091202:
> 
> New tree: kbuild-current
> 
> The powerpc tree lost its build failure.
> 
> The ext3 tree gained a build failure for which I reverted a commit.
> 
> The net tree lost a conflict.
> 
> The mtd tree gained a conflict against the mips tree.
> 
> The tip tree lost a conflict.
> 
> The workqueues tree lost its conflicts.
[ ... ]
> Below is a summary of the state of the merge.
[ ... ]
> Merging trivial/for-next
> CONFLICT (content): Merge conflict in Documentation/video4linux/gspca.txt

Hi Stephen,

have you been sending out e-mail about this conflict? I don't seem to have 
received any.

Thanks,

-- 
Jiri Kosina
SUSE Labs, Novell Inc.


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: Tree for December 3
  2009-12-03  8:30   ` Tejun Heo
@ 2009-12-03 11:37     ` Michal Simek
  0 siblings, 0 replies; 23+ messages in thread
From: Michal Simek @ 2009-12-03 11:37 UTC (permalink / raw)
  To: Tejun Heo; +Cc: Stephen Rothwell, linux-next, LKML

Tejun Heo wrote:
> Hello,
> 
> On 12/03/2009 04:40 PM, Michal Simek wrote:
>> todays tree is working on MMU microblaze correctly without any visible
>> problem but noMMU microblaze kernel still have that bug as I reported
>> some days ago.
> 
> Other than triggering WARN_ON(), it doesn't cause any other problems,
> right?  It's probably because SMP_CACHE_BYTES on that configuration is
> lower than 8.  What is the value of SMP_CACHE_BYTES on the
> configuration?  Also, doesn't the Linus's tree have the same problem?

aaa - I was too fast and compiled noMMU tree for 09-12-02 not todays.
You can check it at http://www.monstr.eu/wiki/doku.php?id=log:log

The problem seems to me is away.

Thanks,
Michal


> 
> The somewhat spurious WARN_ON() in percpu allocator should probably be
> just removed or bumped to check against PAGE_SIZE as SMP code does.
> The problem is that on UP even though the function takes @align
> parameter, it just ignores it.  :-(
> 
> Thanks.
> 


-- 
Michal Simek, Ing. (M.Eng)
PetaLogix - Linux Solutions for a Reconfigurable World
w: www.petalogix.com p: +61-7-30090663,+42-0-721842854 f: +61-7-30090663

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: Tree for December 3
  2009-12-03  7:40 ` Michal Simek
@ 2009-12-03  8:30   ` Tejun Heo
  2009-12-03 11:37     ` Michal Simek
  0 siblings, 1 reply; 23+ messages in thread
From: Tejun Heo @ 2009-12-03  8:30 UTC (permalink / raw)
  To: michal.simek; +Cc: Stephen Rothwell, linux-next, LKML

Hello,

On 12/03/2009 04:40 PM, Michal Simek wrote:
> todays tree is working on MMU microblaze correctly without any visible
> problem but noMMU microblaze kernel still have that bug as I reported
> some days ago.

Other than triggering WARN_ON(), it doesn't cause any other problems,
right?  It's probably because SMP_CACHE_BYTES on that configuration is
lower than 8.  What is the value of SMP_CACHE_BYTES on the
configuration?  Also, doesn't the Linus's tree have the same problem?

The somewhat spurious WARN_ON() in percpu allocator should probably be
just removed or bumped to check against PAGE_SIZE as SMP code does.
The problem is that on UP even though the function takes @align
parameter, it just ignores it.  :-(

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: Tree for December 3
  2009-12-03  7:02 linux-next: Tree for December 3 Stephen Rothwell
@ 2009-12-03  7:40 ` Michal Simek
  2009-12-03  8:30   ` Tejun Heo
  2009-12-03 13:37 ` Jiri Kosina
  1 sibling, 1 reply; 23+ messages in thread
From: Michal Simek @ 2009-12-03  7:40 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, LKML, Tejun Heo

Hi,

Stephen Rothwell wrote:
> Hi all,
> 
> My usual call for calm: please do not put stuff destined for 2.6.34 into
> linux-next trees until after 2.6.33-rc1.
> 
> Michael Neuling has written an interesting blog entry
> (http://neuling.org/mikey/index.cgi/tech/linux-next-size.html) about some
> stats he has gathered.
> 
> Changes since 20091202:
> 
> New tree: kbuild-current
> 
> The powerpc tree lost its build failure.
> 
> The ext3 tree gained a build failure for which I reverted a commit.
> 
> The net tree lost a conflict.
> 
> The mtd tree gained a conflict against the mips tree.
> 
> The tip tree lost a conflict.
> 
> The workqueues tree lost its conflicts.

todays tree is working on MMU microblaze correctly without any visible 
problem but noMMU microblaze kernel still have that bug as I reported 
some days ago.

Thanks,
Michal


Calibrating delay loop... 116.32 BogoMIPS (lpj=581632)
Mount-cache hash table entries: 512
------------[ cut here ]------------
WARNING: at include/linux/percpu.h:157 __create_workqueue_key+0x6c/0x194()
Modules linked in:

Stack:
   9f823f1c 902642ec 00000000 00000000 901d1ac4 90011a1c 901cc458 901d1ac4
   0000009d 90024308 000005b6 000005b7 9f801920 00000000 00000000 901d1adc
   90024300 00000000 902755a4 902755a4 00000000 00000000 901d1adc 90263174
Call Trace:

[<902642ec>] spawn_softlockup_task+0x0/0xb0
[<90011a1c>] warn_slowpath_null+0xc/0x20
[<90024308>] __create_workqueue_key+0x6c/0x194
[<90024300>] __create_workqueue_key+0x64/0x194
[<90263174>] init_workqueues+0x48/0xa0
[<9025c104>] kernel_init+0x0/0x164
[<9025c140>] kernel_init+0x3c/0x164
[<9025c168>] kernel_init+0x64/0x164
[<900019d8>] kernel_thread_helper+0xc/0x20
[<900019cc>] kernel_thread_helper+0x0/0x20

---[ end trace 139ce121c98e96c9 ]---
NET: Registered protocol family 16
bio: create slab <bio-0> at 0
Switching to clocksource microblaze_clocksource
NET: Registered protocol family 2
microblaze_timer_set_mode: oneshot



> 
> ----------------------------------------------------------------------------
> 
> I have created today's linux-next tree at
> git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
> (patches at http://www.kernel.org/pub/linux/kernel/v2.6/next/ ).  If you
> are tracking the linux-next tree using git, you should not use "git pull"
> to do so as that will try to merge the new linux-next release with the
> old one.  You should use "git fetch" as mentioned in the FAQ on the wiki
> (see below).
> 
> You can see which trees have been included by looking in the Next/Trees
> file in the source.  There are also quilt-import.log and merge.log files
> in the Next directory.  Between each merge, the tree was built with
> a ppc64_defconfig for powerpc and an allmodconfig for x86_64. After the
> final fixups (if any), it is also built with powerpc allnoconfig (32 and
> 64 bit), ppc44x_defconfig and allyesconfig (minus
> CONFIG_PROFILE_ALL_BRANCHES - this fails its final link) and i386, sparc
> and sparc64 defconfig. These builds also have
> CONFIG_ENABLE_WARN_DEPRECATED, CONFIG_ENABLE_MUST_CHECK and
> CONFIG_DEBUG_INFO disabled when necessary.
> 
> Below is a summary of the state of the merge.
> 
> We are up to 154 trees (counting Linus' and 21 trees of patches pending
> for Linus' tree), more are welcome (even if they are currently empty).
> Thanks to those who have contributed, and to those who haven't, please do.
> 
> Status of my local build tests will be at
> http://kisskb.ellerman.id.au/linux-next .  If maintainers want to give
> advice about cross compilers/configs that work, we are always open to add
> more builds.
> 
> Thanks to Jan Dittmer for adding the linux-next tree to his build tests
> at http://l4x.org/k/ , the guys at http://test.kernel.org/ and Randy
> Dunlap for doing many randconfig builds.
> 
> There is a wiki covering stuff to do with linux-next at
> http://linux.f-seidel.de/linux-next/pmwiki/ .  Thanks to Frank Seidel.
> 


-- 
Michal Simek, Ing. (M.Eng)
PetaLogix - Linux Solutions for a Reconfigurable World
w: www.petalogix.com p: +61-7-30090663,+42-0-721842854 f: +61-7-30090663

^ permalink raw reply	[flat|nested] 23+ messages in thread

* linux-next: Tree for December 3
@ 2009-12-03  7:02 Stephen Rothwell
  2009-12-03  7:40 ` Michal Simek
  2009-12-03 13:37 ` Jiri Kosina
  0 siblings, 2 replies; 23+ messages in thread
From: Stephen Rothwell @ 2009-12-03  7:02 UTC (permalink / raw)
  To: linux-next; +Cc: LKML

[-- Attachment #1: Type: text/plain, Size: 11118 bytes --]

Hi all,

My usual call for calm: please do not put stuff destined for 2.6.34 into
linux-next trees until after 2.6.33-rc1.

Michael Neuling has written an interesting blog entry
(http://neuling.org/mikey/index.cgi/tech/linux-next-size.html) about some
stats he has gathered.

Changes since 20091202:

New tree: kbuild-current

The powerpc tree lost its build failure.

The ext3 tree gained a build failure for which I reverted a commit.

The net tree lost a conflict.

The mtd tree gained a conflict against the mips tree.

The tip tree lost a conflict.

The workqueues tree lost its conflicts.

----------------------------------------------------------------------------

I have created today's linux-next tree at
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
(patches at http://www.kernel.org/pub/linux/kernel/v2.6/next/ ).  If you
are tracking the linux-next tree using git, you should not use "git pull"
to do so as that will try to merge the new linux-next release with the
old one.  You should use "git fetch" as mentioned in the FAQ on the wiki
(see below).

You can see which trees have been included by looking in the Next/Trees
file in the source.  There are also quilt-import.log and merge.log files
in the Next directory.  Between each merge, the tree was built with
a ppc64_defconfig for powerpc and an allmodconfig for x86_64. After the
final fixups (if any), it is also built with powerpc allnoconfig (32 and
64 bit), ppc44x_defconfig and allyesconfig (minus
CONFIG_PROFILE_ALL_BRANCHES - this fails its final link) and i386, sparc
and sparc64 defconfig. These builds also have
CONFIG_ENABLE_WARN_DEPRECATED, CONFIG_ENABLE_MUST_CHECK and
CONFIG_DEBUG_INFO disabled when necessary.

Below is a summary of the state of the merge.

We are up to 154 trees (counting Linus' and 21 trees of patches pending
for Linus' tree), more are welcome (even if they are currently empty).
Thanks to those who have contributed, and to those who haven't, please do.

Status of my local build tests will be at
http://kisskb.ellerman.id.au/linux-next .  If maintainers want to give
advice about cross compilers/configs that work, we are always open to add
more builds.

Thanks to Jan Dittmer for adding the linux-next tree to his build tests
at http://l4x.org/k/ , the guys at http://test.kernel.org/ and Randy
Dunlap for doing many randconfig builds.

There is a wiki covering stuff to do with linux-next at
http://linux.f-seidel.de/linux-next/pmwiki/ .  Thanks to Frank Seidel.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

$ git checkout master
$ git reset --hard stable
Merging origin/master
Merging fixes/fixes
Merging arm-current/master
Merging m68k-current/for-linus
Merging powerpc-merge/merge
Merging sparc-current/master
Merging scsi-rc-fixes/master
Merging net-current/master
Merging sound-current/for-linus
Merging pci-current/for-linus
Merging wireless-current/master
Merging kbuild-current/for-linus
Merging quilt/driver-core.current
Merging quilt/tty.current
Merging quilt/usb.current
Merging quilt/staging.current
Merging cpufreq-current/fixes
Merging input-current/for-linus
Merging md-current/for-linus
Merging audit-current/for-linus
Merging crypto-current/master
Merging ide-curent/master
Merging dwmw2/master
Merging arm/devel
Merging davinci/davinci-next
Merging msm/for-next
Merging omap/for-next
Merging pxa/for-next
Merging samsung/next-samsung
CONFLICT (content): Merge conflict in arch/arm/Kconfig
Merging avr32/avr32-arch
CONFLICT (content): Merge conflict in arch/avr32/mach-at32ap/include/mach/cpu.h
Merging blackfin/for-linus
Merging cris/for-next
Merging ia64/test
Merging m68k/for-next
Merging m68knommu/for-next
CONFLICT (content): Merge conflict in arch/m68k/include/asm/ptrace.h
Merging microblaze/next
CONFLICT (content): Merge conflict in drivers/serial/of_serial.c
Merging mips/mips-for-linux-next
CONFLICT (content): Merge conflict in arch/mips/Kconfig
CONFLICT (content): Merge conflict in arch/mips/Makefile
CONFLICT (content): Merge conflict in arch/mips/include/asm/ftrace.h
CONFLICT (add/add): Merge conflict in arch/mips/kernel/ftrace.c
CONFLICT (add/add): Merge conflict in arch/mips/kernel/mcount.S
CONFLICT (content): Merge conflict in scripts/recordmcount.pl
Merging parisc/next
Merging powerpc/next
Merging 4xx/next
Merging 52xx-and-virtex/next
Merging galak/next
Merging s390/features
Merging sh/master
Merging sparc/master
Merging xtensa/master
Merging ceph/for-next
Merging cifs/master
Merging configfs/linux-next
Merging ecryptfs/next
Merging ext3/for_next
CONFLICT (content): Merge conflict in fs/cifs/dir.c
Merging ext4/next
Merging fatfs/master
Merging fuse/for-next
Merging gfs2/master
Merging jfs/next
Merging logfs/master
Merging nfs/linux-next
Merging nfsd/nfsd-next
Merging nilfs2/for-next
Merging ocfs2/linux-next
Merging squashfs/master
Merging udf/for_next
Merging v9fs/for-next
CONFLICT (add/add): Merge conflict in fs/9p/cache.c
Merging ubifs/linux-next
Merging xfs/master
Merging reiserfs-bkl/reiserfs/kill-bkl
Merging vfs/for-next
[master 0aebf79] Revert "ext3: Support for vfsv1 quota format"
Merging pci/linux-next
Merging hid/for-next
Merging quilt/i2c
Merging bjdooks-i2c/next-i2c
Merging quilt/jdelvare-hwmon
Merging quilt/kernel-doc
Merging v4l-dvb/master
Merging kbuild/for-next
Merging kconfig/for-next
Merging ide/master
Merging libata/NEXT
Merging infiniband/for-next
Merging acpi/test
CONFLICT (content): Merge conflict in drivers/pci/hotplug/acpiphp_glue.c
Merging ieee1394/for-next
CONFLICT (content): Merge conflict in drivers/media/dvb/firewire/firedtv-1394.c
CONFLICT (content): Merge conflict in drivers/media/dvb/firewire/firedtv-avc.c
CONFLICT (add/add): Merge conflict in drivers/media/dvb/firewire/firedtv-fw.c
CONFLICT (content): Merge conflict in drivers/media/dvb/firewire/firedtv.h
Merging ubi/linux-next
Merging kvm/linux-next
Merging dlm/next
Merging scsi/master
Merging async_tx/next
Merging net/master
CONFLICT (delete/modify): net/wireless/wext.c deleted in net/master and modified in HEAD. Version HEAD of net/wireless/wext.c left in tree.
$ git rm -f net/wireless/wext.c
Applying: wext: merg fixup
Merging wireless/master
Applying: wireless: fix for mismerge
Merging mtd/master
CONFLICT (content): Merge conflict in drivers/mtd/devices/m25p80.c
CONFLICT (delete/modify): drivers/mtd/nand/excite_nandflash.c deleted in HEAD and modified in mtd/master. Version mtd/master of drivers/mtd/nand/excite_nandflash.c left in tree.
CONFLICT (content): Merge conflict in drivers/mtd/nand/pxa3xx_nand.c
$ git rm -f drivers/mtd/nand/excite_nandflash.c
Merging crypto/master
Merging sound/for-next
Merging cpufreq/next
CONFLICT (content): Merge conflict in include/acpi/processor.h
Merging quilt/rr
CONFLICT (content): Merge conflict in arch/arm/kernel/vmlinux.lds.S
Applying: modpost: autoconf.h has moved to include/generated
Merging mmc/next
Merging tmio-mmc/linux-next
Merging input/next
Merging lsm/for-next
Merging block/for-next
Merging quilt/device-mapper
Merging embedded/master
Merging firmware/master
Merging pcmcia/master
CONFLICT (content): Merge conflict in drivers/mtd/maps/pcmciamtd.c
CONFLICT (content): Merge conflict in drivers/net/pcmcia/fmvj18x_cs.c
CONFLICT (content): Merge conflict in drivers/net/pcmcia/nmclan_cs.c
CONFLICT (content): Merge conflict in drivers/net/wireless/ray_cs.c
CONFLICT (content): Merge conflict in drivers/pcmcia/Makefile
CONFLICT (content): Merge conflict in drivers/pcmcia/sa1100_h3600.c
Merging battery/master
Merging leds/for-mm
Merging backlight/for-mm
CONFLICT (content): Merge conflict in drivers/platform/x86/thinkpad_acpi.c
Merging kgdb/kgdb-next
Merging slab/for-next
Merging uclinux/for-next
Merging md/for-next
Merging mfd/for-next
Merging hdlc/hdlc-next
Merging drm/drm-next
Merging voltage/for-next
CONFLICT (content): Merge conflict in drivers/mfd/Kconfig
CONFLICT (content): Merge conflict in drivers/mfd/Makefile
Merging security-testing/next
CONFLICT (content): Merge conflict in Documentation/dontdiff
Merging lblnet/master
Merging agp/agp-next
Merging uwb/for-upstream
Merging watchdog/master
Merging bdev/master
Merging dwmw2-iommu/master
Merging cputime/cputime
Merging osd/linux-next
Merging jc_docs/docs-next
Merging nommu/master
Merging trivial/for-next
CONFLICT (content): Merge conflict in Documentation/video4linux/gspca.txt
Merging audit/for-next
Merging quilt/aoe
Merging suspend/linux-next
Merging bluetooth/master
Merging fsnotify/for-next
CONFLICT (content): Merge conflict in arch/x86/ia32/ia32entry.S
CONFLICT (content): Merge conflict in arch/x86/include/asm/unistd_32.h
CONFLICT (content): Merge conflict in arch/x86/include/asm/unistd_64.h
CONFLICT (content): Merge conflict in arch/x86/kernel/syscall_table_32.S
CONFLICT (content): Merge conflict in fs/afs/write.c
CONFLICT (content): Merge conflict in fs/cifs/dir.c
CONFLICT (content): Merge conflict in fs/ubifs/file.c
CONFLICT (content): Merge conflict in include/asm-generic/fcntl.h
CONFLICT (content): Merge conflict in net/socket.c
Merging irda/for-next
Merging hwlat/for-linus
CONFLICT (content): Merge conflict in drivers/misc/Makefile
Merging drbd/for-jens
Merging catalin/for-next
Merging alacrity/linux-next
CONFLICT (content): Merge conflict in include/linux/Kbuild
CONFLICT (content): Merge conflict in lib/Kconfig
Merging i7core_edac/linux_next
Applying: i7core_edac: do not export static functions
Merging devicetree/next-devicetree
Merging spi/next-spi
Merging limits/writable_limits
Merging omap_dss2/for-next
Merging tip/auto-latest
CONFLICT (content): Merge conflict in arch/x86/kernel/kgdb.c
CONFLICT (content): Merge conflict in kernel/irq/chip.c
CONFLICT (content): Merge conflict in kernel/printk.c
CONFLICT (content): Merge conflict in scripts/recordmcount.pl
Merging edac-amd/for-next
Merging oprofile/for-next
Merging percpu/for-next
CONFLICT (content): Merge conflict in arch/powerpc/platforms/pseries/hvCall.S
CONFLICT (content): Merge conflict in arch/x86/kvm/svm.c
CONFLICT (content): Merge conflict in kernel/softlockup.c
CONFLICT (content): Merge conflict in mm/slab.c
Applying: percpu: merge fixup for variable renaming
Merging workqueues/for-next
Merging sfi/sfi-test
Merging asm-generic/next
Merging hwpoison/hwpoison
Merging sysctl/master
CONFLICT (content): Merge conflict in net/ipv6/addrconf.c
CONFLICT (content): Merge conflict in net/sctp/sysctl.c
Merging quilt/driver-core
Merging quilt/tty
Merging quilt/usb
CONFLICT (content): Merge conflict in arch/arm/plat-mxc/Makefile
Merging quilt/staging
CONFLICT (content): Merge conflict in drivers/staging/Kconfig
CONFLICT (content): Merge conflict in drivers/staging/Makefile
CONFLICT (content): Merge conflict in drivers/staging/comedi/drivers/ni_labpc_cs.c
CONFLICT (content): Merge conflict in drivers/staging/comedi/drivers/ni_mio_cs.c
Merging scsi-post-merge/master

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* linux-next: Tree for December 3
@ 2008-12-03  7:36 Stephen Rothwell
  0 siblings, 0 replies; 23+ messages in thread
From: Stephen Rothwell @ 2008-12-03  7:36 UTC (permalink / raw)
  To: linux-next; +Cc: LKML

[-- Attachment #1: Type: text/plain, Size: 7731 bytes --]

Hi all,

Changes since 20081202:

Today's tree fails the powerpc allyesconfig build.

Dropped trees (temporarily):
	v4l-dvb (build problem)
	kbuild (build problem)
	semaphore-removal (due to unfixed conflicts against Linus' tree)
	lblnet (build problem)
	cpu_alloc (build problem)
	perfmon3 (concerns from the x86 team)

The driver-core tree lost a conflict.

The cifs tree gained a conflict against the net tree.

The security-testing tree gained a conflict against the xfs tree.

The rr tree lost its build failure.

The lblnet tree gained a build failure and was dropped.

----------------------------------------------------------------------------

I have created today's linux-next tree at
git://git.kernel.org/pub/scm/linux/kernel/git/sfr/linux-next.git
(patches at
http://www.kernel.org/pub/linux/kernel/people/sfr/linux-next/).  If you
are tracking the linux-next tree using git, you should not use "git pull"
to do so as that will try to merge the new linux-next release with the
old one.  You should use "git fetch" as mentioned in the FAQ on the wiki
(see below).

You can see which trees have been included by looking in the Next/Trees
file in the source.  There are also quilt-import.log and merge.log files
in the Next directory.  Between each merge, the tree was built with
a ppc64_defconfig for powerpc and an allmodconfig for x86_64. After the
final fixups (if any), it is also built with powerpc allnoconfig,
44x_defconfig and allyesconfig and i386, sparc and sparc64 defconfig.

Below is a summary of the state of the merge.

We are up to 127 trees (counting Linus' and 15 trees of patches pending for
Linus' tree), more are welcome (even if they are currently empty).
Thanks to those who have contributed, and to those who haven't, please do.

Status of my local build tests will be at
http://kisskb.ellerman.id.au/linux-next .  If maintainers want to give
advice about cross compilers/configs that work, we are always open to add
more builds.

Thanks to Jan Dittmer for adding the linux-next tree to his build tests
at http://l4x.org/k/ , the guys at http://test.kernel.org/ and Randy
Dunlap for doing many randconfig builds.

There is a wiki covering stuff to do with linux-next at
http://linux.f-seidel.de/linux-next/pmwiki/ .  Thanks to Frank Seidel.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

$ git checkout master
$ git reset --hard stable
Merging origin/master
Merging arm-current/master
Merging m68k-current/for-linus
Merging powerpc-merge/merge
Merging sparc-current/master
Merging scsi-rc-fixes/master
Merging net-current/master
Merging sound-current/for-linus
Merging pci-current/for-linus
Merging wireless-current/master
Merging kbuild-current/master
Merging quilt/driver-core.current
Merging quilt/usb.current
Merging cpufreq-current/fixes
Merging input-current/for-linus
Merging md-current/for-2.6.26
Merging dwmw2/master
Merging arm/devel
Merging avr32/avr32-arch
Merging blackfin/for-linus
Merging cris/for-next
Merging ia64/test
Merging m68k/for-next
Merging m68knommu/for-next
Merging mips/mips-for-linux-next
Merging parisc/master
Merging powerpc/next
Merging 4xx/next
CONFLICT (content): Merge conflict in arch/powerpc/configs/ppc44x_defconfig
Merging galak/next
Merging pxa/for-next
Merging s390/features
CONFLICT (content): Merge conflict in drivers/char/Makefile
CONFLICT (content): Merge conflict in drivers/s390/scsi/zfcp_erp.c
Merging sh/master
Merging sparc/master
Merging x86/auto-x86-next
Merging xtensa/master
Merging quilt/driver-core
Merging quilt/usb
Merging tip-core/auto-core-next
Merging cpus4096/auto-cpus4096-next
Merging ftrace/auto-ftrace-next
CONFLICT (content): Merge conflict in scripts/recordmcount.pl
Merging genirq/auto-genirq-next
Merging safe-poison-pointers/auto-safe-poison-pointers-next
Merging sched/auto-sched-next
Merging stackprotector/auto-stackprotector-next
Merging timers/auto-timers-next
Merging pci/linux-next
Merging quilt/device-mapper
Merging hid/for-next
Merging quilt/i2c
Merging quilt/jdelvare-hwmon
Merging quilt/kernel-doc
Merging v4l-dvb/master
$ git reset --hard HEAD^
Merging jfs/next
Merging kbuild/master
$ git reset --hard HEAD^
Merging quilt/ide
Merging libata/NEXT
Merging nfs/linux-next
Merging xfs/master
Merging infiniband/for-next
Merging acpi/test
Merging nfsd/nfsd-next
Merging ieee1394/for-next
Merging ubi/linux-next
Merging kvm/master
CONFLICT (content): Merge conflict in arch/x86/kernel/reboot.c
Merging dlm/next
Merging scsi/master
Merging ocfs2/linux-next
Merging ext4/next
Merging async_tx/next
Merging udf/for_next
Merging net/master
CONFLICT (content): Merge conflict in drivers/net/ixgbe/ixgbe_main.c
CONFLICT (content): Merge conflict in drivers/net/smc91x.c
Applying net: async_tx merge fix
Merging mtd/master
CONFLICT (content): Merge conflict in drivers/mtd/maps/physmap.c
Merging wireless/master
Merging crypto/master
Merging vfs/for-next
Merging sound/for-next
Merging cpufreq/next
Merging v9fs/for-next
Merging quilt/rr
CONFLICT (content): Merge conflict in arch/x86/kernel/setup.c
Merging cifs/master
CONFLICT (content): Merge conflict in fs/cifs/connect.c
Applying cifs: update for new IP4/6 address printing
Merging mmc/next
Merging gfs2/master
Merging input/next
Merging semaphore/semaphore
Merging semaphore-removal/semaphore-removal
CONFLICT (content): Merge conflict in arch/arm/mach-lh7a40x/clocks.c
CONFLICT (content): Merge conflict in net/9p/trans_virtio.c
$ git reset --hard HEAD^
Merging bkl-removal/bkl-removal
Merging ubifs/linux-next
Merging lsm/for-next
Merging block/for-next
Merging embedded/master
Merging firmware/master
CONFLICT (content): Merge conflict in drivers/net/tg3.c
CONFLICT (content): Merge conflict in firmware/Makefile
CONFLICT (content): Merge conflict in firmware/WHENCE
Merging pcmcia/master
Merging battery/master
Merging leds/for-mm
Merging backlight/for-mm
Merging kgdb/kgdb-next
Merging slab/for-next
Merging uclinux/for-next
Merging md/for-next
Merging kmemcheck/auto-kmemcheck-next
CONFLICT (content): Merge conflict in MAINTAINERS
CONFLICT (content): Merge conflict in arch/x86/mm/Makefile
CONFLICT (content): Merge conflict in mm/slab.c
CONFLICT (content): Merge conflict in mm/slub.c
Merging generic-ipi/auto-generic-ipi-next
Merging mfd/for-next
Merging hdlc/hdlc-next
Merging drm/drm-next
Merging voltage/for-next
Merging security-testing/next
CONFLICT (content): Merge conflict in fs/cifs/cifs_fs_sb.h
CONFLICT (content): Merge conflict in fs/nfsd/nfs4recover.c
CONFLICT (content): Merge conflict in fs/ocfs2/namei.c
CONFLICT (content): Merge conflict in fs/xfs/linux-2.6/xfs_cred.h
CONFLICT (content): Merge conflict in fs/xfs/linux-2.6/xfs_globals.h
CONFLICT (content): Merge conflict in fs/xfs/linux-2.6/xfs_ioctl.c
CONFLICT (content): Merge conflict in fs/xfs/xfs_vnodeops.h
Merging lblnet/master
$ git reset --hard HEAD^
Merging quilt/ttydev
CONFLICT (content): Merge conflict in fs/devpts/inode.c
Merging agp/agp-next
Merging oprofile/auto-oprofile-next
Merging fastboot/auto-fastboot-next
Merging sparseirq/auto-sparseirq-next
Merging iommu/auto-iommu-next
Merging uwb/for-upstream
Merging watchdog/master
Merging proc/proc
CONFLICT (content): Merge conflict in fs/proc/base.c
CONFLICT (content): Merge conflict in kernel/exit.c
Merging bdev/master
Merging dwmw2-iommu/master
Merging cputime/cputime
CONFLICT (content): Merge conflict in kernel/sched.c
Merging osd/linux-next
Merging fatfs/master
Merging fuse/for-next
Merging trivial/for-next
Merging quilt/staging
Merging scsi-post-merge/master

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2010-12-06 17:30 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-03  2:04 linux-next: Tree for December 3 Stephen Rothwell
2010-12-03 17:48 ` linux-next: Tree for December 3 (cifs) Randy Dunlap
2010-12-06  7:09   ` Ingo Molnar
2010-12-06  7:09     ` Ingo Molnar
     [not found]     ` <20101206070956.GA5570-X9Un+BFzKDI@public.gmane.org>
2010-12-06 12:35       ` Jeff Layton
2010-12-06 12:35         ` Jeff Layton
2010-12-06 15:40         ` Shirish Pargaonkar
     [not found]           ` <AANLkTimTFi6jji5wmnBTT25XYAXAhJYNY+YmqhW5McEC-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-06 15:50             ` Jeff Layton
2010-12-06 15:50               ` Jeff Layton
     [not found]               ` <20101206105021.2b6bfc96-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2010-12-06 16:13                 ` Shirish Pargaonkar
2010-12-06 16:13                   ` Shirish Pargaonkar
2010-12-06 16:22                 ` Shirish Pargaonkar
     [not found]                   ` <AANLkTinbR4+gtYt7-8ZFS7kdkWAs0CFxCD_mq9oy1Pa_@mail.gmail.com>
     [not found]                     ` <AANLkTinbR4+gtYt7-8ZFS7kdkWAs0CFxCD_mq9oy1Pa_-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-06 17:30                       ` Jeff Layton
2010-12-06 16:43                 ` Randy Dunlap
2010-12-06 16:43                   ` Randy Dunlap
  -- strict thread matches above, loose matches on Subject: below --
2009-12-03  7:02 linux-next: Tree for December 3 Stephen Rothwell
2009-12-03  7:40 ` Michal Simek
2009-12-03  8:30   ` Tejun Heo
2009-12-03 11:37     ` Michal Simek
2009-12-03 13:37 ` Jiri Kosina
2009-12-03 14:13   ` Stephen Rothwell
2009-12-03 14:18     ` Jiri Kosina
2008-12-03  7:36 Stephen Rothwell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.