]> Git Repo - linux.git/log
linux.git
12 years agobacklight: atmel-pwm-bl: fix checkpatch warning
Jingoo Han [Tue, 18 Dec 2012 00:00:12 +0000 (16:00 -0800)]
backlight: atmel-pwm-bl: fix checkpatch warning

This patch fixes the checkpatch warning as below:

  WARNING: quoted string split across lines

Signed-off-by: Jingoo Han <[email protected]>
Cc: Richard Purdie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agobacklight: 88pm860x_bl: fix checkpatch warning
Jingoo Han [Tue, 18 Dec 2012 00:00:11 +0000 (16:00 -0800)]
backlight: 88pm860x_bl: fix checkpatch warning

This patch fixes the checkpatch warning as below:

  WARNING: quoted string split across lines

Signed-off-by: Jingoo Han <[email protected]>
Cc: Richard Purdie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agobacklight: da903x_bl: use dev_get_drvdata() instead of platform_get_drvdata()
Jingoo Han [Tue, 18 Dec 2012 00:00:10 +0000 (16:00 -0800)]
backlight: da903x_bl: use dev_get_drvdata() instead of platform_get_drvdata()

dev_get_drvdata() can be used instead of platform_get_drvdata()
to make the code smaller.

Signed-off-by: Jingoo Han <[email protected]>
Cc: Richard Purdie <[email protected]>
Cc: Mike Rapoport <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agoMAINTAINERS: adjust for UAPI: firewire
Stefan Richter [Tue, 18 Dec 2012 00:00:07 +0000 (16:00 -0800)]
MAINTAINERS: adjust for UAPI: firewire

Signed-off-by: Stefan Richter <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agoCorentin has moved
Corentin Chary [Tue, 18 Dec 2012 00:00:05 +0000 (16:00 -0800)]
Corentin has moved

Signed-off-by: Corentin Chary <[email protected]>
Cc: Matthew Garrett <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agoMAINTAINERS: remove include/linux/ext3*
Cesar Eduardo Barros [Tue, 18 Dec 2012 00:00:03 +0000 (16:00 -0800)]
MAINTAINERS: remove include/linux/ext3*

Moved to fs/ext3/ext3.h by commit 4613ad180d19 ("ext3: move headers to
fs/ext3/").

Signed-off-by: Cesar Eduardo Barros <[email protected]>
Cc: Jan Kara <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agoMAINTAINERS: CHINESE MAINTAINERS mailing list is subscribers only
Joe Perches [Tue, 18 Dec 2012 00:00:00 +0000 (16:00 -0800)]
MAINTAINERS: CHINESE MAINTAINERS mailing list is subscribers only

Mark it so.

Signed-off-by: Joe Perches <[email protected]>
Cc: Harry Wei <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agolib/vsprintf.c: fix handling of %zd when using ssize_t
Jason Gunthorpe [Mon, 17 Dec 2012 23:59:58 +0000 (15:59 -0800)]
lib/vsprintf.c: fix handling of %zd when using ssize_t

Documentation/printk-formats.txt says to use %zd for a ssize_t argument
and some drivers do.  Unfortunately this prints a positive number for
negative values eg:

  tpm_tis 70030000.tpm_tis: tpm_transmit: tpm_send: error 4294967234

Add a case to va_args a ssize_t type if the interpretation should be
signed.

Tested on PPC32.

Signed-off-by: Jason Gunthorpe <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agoprintk: boot_delay should only affect output
Andrew Cooks [Mon, 17 Dec 2012 23:59:56 +0000 (15:59 -0800)]
printk: boot_delay should only affect output

The boot_delay parameter affects all printk(), even if the log level
prevents visible output from the call.  It results in delays greater than
the user intended without purpose.

This patch changes the behaviour of boot_delay to only delay output.

Signed-off-by: Andrew Cooks <[email protected]>
Acked-by: Randy Dunlap <[email protected]>
Cc: Joe Perches <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agodmatest: check for dma mapping error
Andy Shevchenko [Mon, 17 Dec 2012 23:59:53 +0000 (15:59 -0800)]
dmatest: check for dma mapping error

The kernel emits a warning if CONFIG_DMA_API_DEBUG=y:

  WARNING: at lib/dma-debug.c:933 check_unmap+0x5d6/0x6ac()
  dw_dmac dw_dmac.0: DMA-API: device driver failed to check map error[device address=0x0000000035698305] [size=14365 bytes] [mapped as single]

Fix this by adding the required checking of the dma_map_single() return
value.

Signed-off-by: Andy Shevchenko <[email protected]>
Reviewed-by: Viresh Kumar <[email protected]>
Cc: Vinod Koul <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agodmatest: implement two helpers to unmap dma memory
Andy Shevchenko [Mon, 17 Dec 2012 23:59:52 +0000 (15:59 -0800)]
dmatest: implement two helpers to unmap dma memory

The unmap_src() and unmap_dst() will be used later as well.

Signed-off-by: Andy Shevchenko <[email protected]>
Reviewed-by: Viresh Kumar <[email protected]>
Cc: Vinod Koul <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agowatchdog: store the watchdog sample period as a variable
Chuansheng Liu [Mon, 17 Dec 2012 23:59:50 +0000 (15:59 -0800)]
watchdog: store the watchdog sample period as a variable

Currently getting the sample period is always thru a complex
calculation: get_softlockup_thresh() * ((u64)NSEC_PER_SEC / 5).

We can store the sample period as a variable, and set it as __read_mostly
type.

Signed-off-by: liu chuansheng <[email protected]>
Cc: Don Zickus <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agousb: musb: use io{read,write}*_rep accessors
Matthew Leach [Mon, 17 Dec 2012 23:59:48 +0000 (15:59 -0800)]
usb: musb: use io{read,write}*_rep accessors

The {read,write}s{b,w,l} operations are not defined by all architectures
and are being removed from the asm-generic/io.h interface.

This patch replaces the usage of these string functions in the musb
accessors with io{read,write}{8,16,32}_rep calls instead.

Signed-off-by: Matthew Leach <[email protected]>
Signed-off-by: Will Deacon <[email protected]>
Cc: Felipe Balbi <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Ben Herrenschmidt <[email protected]>
Cc: Greg KH <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agomusb: tusb6010: use io{read,write}*_rep accessors
Matthew Leach [Mon, 17 Dec 2012 23:59:45 +0000 (15:59 -0800)]
musb: tusb6010: use io{read,write}*_rep accessors

The {read,write}s{b,w,l} operations are not defined by all architectures
and are being removed from the asm-generic/io.h interface.

This patch replaces the usage of these string functions in the tusb6010
accessors with io{read,write}{8,16,32}_rep calls instead.

Signed-off-by: Matthew Leach <[email protected]>
Signed-off-by: Will Deacon <[email protected]>
Cc: Felipe Balbi <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Ben Herrenschmidt <[email protected]>
Cc: Greg KH <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agoasm-generic: io: don't perform swab during {in,out} string functions
Will Deacon [Mon, 17 Dec 2012 23:59:42 +0000 (15:59 -0800)]
asm-generic: io: don't perform swab during {in,out} string functions

The {in,out}s{b,w,l} functions are designed to operate on a stream of
bytes and therefore should not perform any byte-swapping, regardless of
the CPU byte order.

This patch fixes the generic IO header so that {in,out}s{b,w,l} call the
__raw_{read,write} functions directly rather than going via the
endian-correcting accessors.

Signed-off-by: Will Deacon <[email protected]>
Cc: Mike Frysinger <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Acked-by: Ben Herrenschmidt <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years ago.gitignore: remove stale entry for generated version.h
Jonathan Austin [Mon, 17 Dec 2012 23:59:41 +0000 (15:59 -0800)]
.gitignore: remove stale entry for generated version.h

Since userspace headers were moved to generated/uapi it possible to have a
stale copy of linux/version.h at that file's old location.  This causes
confusion after building an older kernel version, then checking out and
building a new one; the old (stale) version header will still get picked
up until it is manually removed.  This upsets the C library.

Since the uapi changes, include/linux/version.h is no longer generated and
should not be ignored, so this patch removes it from .gitignore.

Signed-off-by: Jonathan Austin <[email protected]>
Reported-by: Kevin Petit <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agofs/notify/inode_mark.c: make fsnotify_find_inode_mark_locked() static
Tushar Behera [Mon, 17 Dec 2012 23:59:40 +0000 (15:59 -0800)]
fs/notify/inode_mark.c: make fsnotify_find_inode_mark_locked() static

Fixes following sparse warning:

  fs/notify/inode_mark.c:127:22: warning: symbol 'fsnotify_find_inode_mark_locked' was not declared. Should it be static?

Signed-off-by: Tushar Behera <[email protected]>
Cc: Eric Paris <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agolseek: the "whence" argument is called "whence"
Andrew Morton [Mon, 17 Dec 2012 23:59:39 +0000 (15:59 -0800)]
lseek: the "whence" argument is called "whence"

But the kernel decided to call it "origin" instead.  Fix most of the
sites.

Acked-by: Hugh Dickins <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agodrivers: remove reference to feature-removal-schedule.txt
Tao Ma [Mon, 17 Dec 2012 23:59:38 +0000 (15:59 -0800)]
drivers: remove reference to feature-removal-schedule.txt

In commit 9c0ece069b32 ("Get rid of Documentation/feature-removal.txt"),
Linus removed feature-removal-schedule.txt from Documentation, but there
is still some reference to this file.  So remove them.

Signed-off-by: Tao Ma <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agosound: remove reference to feature-removal-schedule.txt
Tao Ma [Mon, 17 Dec 2012 23:59:37 +0000 (15:59 -0800)]
sound: remove reference to feature-removal-schedule.txt

In commit 9c0ece069b32 ("Get rid of Documentation/feature-removal.txt"),
Linus removed feature-removal-schedule.txt from Documentation, but there
is still some reference to this file.  So remove them.

Signed-off-by: Tao Ma <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agokernel: remove reference to feature-removal-schedule.txt
Tao Ma [Mon, 17 Dec 2012 23:59:36 +0000 (15:59 -0800)]
kernel: remove reference to feature-removal-schedule.txt

In commit 9c0ece069b32 ("Get rid of Documentation/feature-removal.txt"),
Linus removed feature-removal-schedule.txt from Documentation, but there
is still some reference to this file.  So remove them.

Signed-off-by: Tao Ma <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agoDocumentation: remove reference to feature-removal-schedule.txt
Tao Ma [Mon, 17 Dec 2012 23:59:33 +0000 (15:59 -0800)]
Documentation: remove reference to feature-removal-schedule.txt

In commit 9c0ece069b32 ("Get rid of Documentation/feature-removal.txt"),
Linus removed feature-removal-schedule.txt from Documentation, but there
is still some reference to this file.  So remove them.

Signed-off-by: Tao Ma <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agoinclude/linux/init.h: use the stringify operator for the __define_initcall macro
Matthew Leach [Mon, 17 Dec 2012 23:59:32 +0000 (15:59 -0800)]
include/linux/init.h: use the stringify operator for the __define_initcall macro

Currently the __define_initcall() macro takes three arguments, fn, id and
level.  The level argument is exactly the same as the id argument but
wrapped in quotes.  To overcome this need to specify three arguments to
the __define_initcall macro, where one argument is the stringification of
another, we can just use the stringification macro instead.

Signed-off-by: Matthew Leach <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Rusty Russell <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agoDocumentation/kernel-parameters.txt: update mem= option's spec according to its imple...
Wen Congyang [Mon, 17 Dec 2012 23:59:29 +0000 (15:59 -0800)]
Documentation/kernel-parameters.txt: update mem= option's spec according to its implementation

Current mem= implementation seems buggy because the specification and
implementation don't match.  The current mem= has been working for many
years and it's not buggy - it works as expected.  So we should update the
specification.

Signed-off-by: Wen Congyang <[email protected]>
Cc: Rob Landley <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agofrv: properly use the declarations provided by <asm/sections.h>
Geert Uytterhoeven [Mon, 17 Dec 2012 23:59:27 +0000 (15:59 -0800)]
frv: properly use the declarations provided by <asm/sections.h>

  - Remove the superfluous address-of ('&') operators,
  - Remove the unneeded casts, use %p to format pointers instead.

Signed-off-by: Geert Uytterhoeven <[email protected]>
Cc: David Howells <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agofrv: fix use of extinct _sbss and _ebss in debug code
Geert Uytterhoeven [Mon, 17 Dec 2012 23:59:26 +0000 (15:59 -0800)]
frv: fix use of extinct _sbss and _ebss in debug code

Nowadays it should probably use __bss_start and __bss_stop

Signed-off-by: Geert Uytterhoeven <[email protected]>
Cc: David Howells <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agomm/memory.c: suppress warning
Andrew Morton [Mon, 17 Dec 2012 23:59:24 +0000 (15:59 -0800)]
mm/memory.c: suppress warning

gcc-4.4.4 screws this up.

  mm/memory.c: In function 'do_pmd_numa_page':
  mm/memory.c:3594: warning: no return statement in function returning non-void

Cc: Mel Gorman <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agocreate non-empty arch/x86/include/uapi/asm/ files
Andrew Morton [Mon, 17 Dec 2012 23:59:22 +0000 (15:59 -0800)]
create non-empty arch/x86/include/uapi/asm/ files

patch(1) doesn't create zero-length files, so my kernel didn't compile.

Put something in these files so patch(1) actually creates them.

Cc: David Howells <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Michael Kerrisk <[email protected]>
Cc: Paul E. McKenney <[email protected]>
Cc: Dave Jones <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm...
Linus Torvalds [Mon, 17 Dec 2012 23:44:47 +0000 (15:44 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace

Pull user namespace changes from Eric Biederman:
 "While small this set of changes is very significant with respect to
  containers in general and user namespaces in particular.  The user
  space interface is now complete.

  This set of changes adds support for unprivileged users to create user
  namespaces and as a user namespace root to create other namespaces.
  The tyranny of supporting suid root preventing unprivileged users from
  using cool new kernel features is broken.

  This set of changes completes the work on setns, adding support for
  the pid, user, mount namespaces.

  This set of changes includes a bunch of basic pid namespace
  cleanups/simplifications.  Of particular significance is the rework of
  the pid namespace cleanup so it no longer requires sending out
  tendrils into all kinds of unexpected cleanup paths for operation.  At
  least one case of broken error handling is fixed by this cleanup.

  The files under /proc/<pid>/ns/ have been converted from regular files
  to magic symlinks which prevents incorrect caching by the VFS,
  ensuring the files always refer to the namespace the process is
  currently using and ensuring that the ptrace_mayaccess permission
  checks are always applied.

  The files under /proc/<pid>/ns/ have been given stable inode numbers
  so it is now possible to see if different processes share the same
  namespaces.

  Through the David Miller's net tree are changes to relax many of the
  permission checks in the networking stack to allowing the user
  namespace root to usefully use the networking stack.  Similar changes
  for the mount namespace and the pid namespace are coming through my
  tree.

  Two small changes to add user namespace support were commited here adn
  in David Miller's -net tree so that I could complete the work on the
  /proc/<pid>/ns/ files in this tree.

  Work remains to make it safe to build user namespaces and 9p, afs,
  ceph, cifs, coda, gfs2, ncpfs, nfs, nfsd, ocfs2, and xfs so the
  Kconfig guard remains in place preventing that user namespaces from
  being built when any of those filesystems are enabled.

  Future design work remains to allow root users outside of the initial
  user namespace to mount more than just /proc and /sys."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: (38 commits)
  proc: Usable inode numbers for the namespace file descriptors.
  proc: Fix the namespace inode permission checks.
  proc: Generalize proc inode allocation
  userns: Allow unprivilged mounts of proc and sysfs
  userns: For /proc/self/{uid,gid}_map derive the lower userns from the struct file
  procfs: Print task uids and gids in the userns that opened the proc file
  userns: Implement unshare of the user namespace
  userns: Implent proc namespace operations
  userns: Kill task_user_ns
  userns: Make create_new_namespaces take a user_ns parameter
  userns: Allow unprivileged use of setns.
  userns: Allow unprivileged users to create new namespaces
  userns: Allow setting a userns mapping to your current uid.
  userns: Allow chown and setgid preservation
  userns: Allow unprivileged users to create user namespaces.
  userns: Ignore suid and sgid on binaries if the uid or gid can not be mapped
  userns: fix return value on mntns_install() failure
  vfs: Allow unprivileged manipulation of the mount namespace.
  vfs: Only support slave subtrees across different user namespaces
  vfs: Add a user namespace reference from struct mnt_namespace
  ...

12 years agoMerge remote-tracking branch 'agust/next' into next
Benjamin Herrenschmidt [Mon, 17 Dec 2012 23:22:27 +0000 (10:22 +1100)]
Merge remote-tracking branch 'agust/next' into next

Brings some 52xx updates. Also manually merged tools/perf/perf.h.

Signed-off-by: Benjamin Herrenschmidt <[email protected]>
12 years agomd/raid5: add blktrace calls
NeilBrown [Wed, 31 Oct 2012 00:59:09 +0000 (11:59 +1100)]
md/raid5: add blktrace calls

This makes it easier to trace what raid5 is doing.

Signed-off-by: NeilBrown <[email protected]>
12 years agoMerge branch 'for-3.8/drivers' of git://git.kernel.dk/linux-block
Linus Torvalds [Mon, 17 Dec 2012 21:39:11 +0000 (13:39 -0800)]
Merge branch 'for-3.8/drivers' of git://git.kernel.dk/linux-block

Pull block driver update from Jens Axboe:
 "Now that the core bits are in, here are the driver bits for 3.8.  The
  branch contains:

   - A huge pile of drbd bits that were dumped from the 3.7 merge
     window.  Following that, it was both made perfectly clear that
     there is going to be no more over-the-wall pulls and how the
     situation on individual pulls can be improved.

   - A few cleanups from Akinobu Mita for drbd and cciss.

   - Queue improvement for loop from Lukas.  This grew into adding a
     generic interface for waiting/checking an even with a specific
     lock, allowing this to be pulled out of md and now loop and drbd is
     also using it.

   - A few fixes for xen back/front block driver from Roger Pau Monne.

   - Partition improvements from Stephen Warren, allowing partiion UUID
     to be used as an identifier."

* 'for-3.8/drivers' of git://git.kernel.dk/linux-block: (609 commits)
  drbd: update Kconfig to match current dependencies
  drbd: Fix drbdsetup wait-connect, wait-sync etc... commands
  drbd: close race between drbd_set_role and drbd_connect
  drbd: respect no-md-barriers setting also when changed online via disk-options
  drbd: Remove obsolete check
  drbd: fixup after wait_even_lock_irq() addition to generic code
  loop: Limit the number of requests in the bio list
  wait: add wait_event_lock_irq() interface
  xen-blkfront: free allocated page
  xen-blkback: move free persistent grants code
  block: partition: msdos: provide UUIDs for partitions
  init: reduce PARTUUID min length to 1 from 36
  block: store partition_meta_info.uuid as a string
  cciss: use check_signature()
  cciss: cleanup bitops usage
  drbd: use copy_highpage
  drbd: if the replication link breaks during handshake, keep retrying
  drbd: check return of kmalloc in receive_uuids
  drbd: Broadcast sync progress no more often than once per second
  drbd: don't try to clear bits once the disk has failed
  ...

12 years agoBtrfs: fix a bug of per-file nocow
Liu Bo [Tue, 11 Sep 2012 14:33:50 +0000 (08:33 -0600)]
Btrfs: fix a bug of per-file nocow

Users report a bug, the reproducer is:
$ mkfs.btrfs /dev/loop0
$ mount /dev/loop0 /mnt/btrfs/
$ mkdir /mnt/btrfs/dir
$ chattr +C /mnt/btrfs/dir/
$ dd if=/dev/zero of=/mnt/btrfs/dir/foo bs=4K count=10;
$ lsattr /mnt/btrfs/dir/foo
---------------C- /mnt/btrfs/dir/foo
$ filefrag /mnt/btrfs/dir/foo
/mnt/btrfs/dir/foo: 1 extent found    ---> an extent
$ dd if=/dev/zero of=/mnt/btrfs/dir/foo bs=4K count=1 seek=5 conv=notrunc,nocreat; sync
$ filefrag /mnt/btrfs/dir/foo
/mnt/btrfs/dir/foo: 3 extents found   ---> with nocow, btrfs breaks the extent into three parts

The new created file should not only inherit the NODATACOW flag, but also
honor NODATASUM flag, because we must do COW on a file extent with checksum.

Signed-off-by: Liu Bo <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: fix hash overflow handling
Chris Mason [Mon, 17 Dec 2012 19:26:57 +0000 (14:26 -0500)]
Btrfs: fix hash overflow handling

The handling for directory crc hash overflows was fairly obscure,
split_leaf returns EOVERFLOW when we try to extend the item and that is
supposed to bubble up to userland.  For a while it did so, but along the
way we added better handling of errors and forced the FS readonly if we
hit IO errors during the directory insertion.

Along the way, we started testing only for EEXIST and the EOVERFLOW case
was dropped.  The end result is that we may force the FS readonly if we
catch a directory hash bucket overflow.

This fixes a few problem spots.  First I add tests for EOVERFLOW in the
places where we can safely just return the error up the chain.

btrfs_rename is harder though, because it tries to insert the new
directory item only after it has already unlinked anything the rename
was going to overwrite.  Rather than adding very complex logic, I added
a helper to test for the hash overflow case early while it is still safe
to bail out.

Snapshot and subvolume creation had a similar problem, so they are using
the new helper now too.

Signed-off-by: Chris Mason <[email protected]>
Reported-by: Pascal Junod <[email protected]>
12 years agoRevert "bdi: add a user-tunable cpu_list for the bdi flusher threads"
Linus Torvalds [Mon, 17 Dec 2012 19:29:09 +0000 (11:29 -0800)]
Revert "bdi: add a user-tunable cpu_list for the bdi flusher threads"

This reverts commit 8fa72d234da9b6b473bbb1f74d533663e4996e6b.

People disagree about how this should be done, so let's revert this for
now so that nobody starts using the new tuning interface.  Tejun is
thinking about a more generic interface for thread pool affinity.

Requested-by: Tejun Heo <[email protected]>
Acked-by: Jeff Moyer <[email protected]>
Acked-by: Jens Axboe <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agoSUNRPC: continue run over clients list on PipeFS event instead of break
Stanislav Kinsbursky [Mon, 17 Dec 2012 17:18:52 +0000 (20:18 +0300)]
SUNRPC: continue run over clients list on PipeFS event instead of break

There are SUNRPC clients, which program doesn't have pipe_dir_name. These
clients can be skipped on PipeFS events, because nothing have to be created or
destroyed. But instead of breaking in case of such a client was found, search
for suitable client over clients list have to be continued. Otherwise some
clients could not be covered by PipeFS event handler.

Signed-off-by: Stanislav Kinsbursky <[email protected]>
Cc: [email protected] [>= v3.4]
Signed-off-by: Trond Myklebust <[email protected]>
12 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
Linus Torvalds [Mon, 17 Dec 2012 16:27:59 +0000 (08:27 -0800)]
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs

Pull ext3, udf, quota fixes from Jan Kara:
 "Some ext3 & quota cleanups and couple of udf fixes"

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
  quota: Use the pre-processor to compile out quotactl_cmd_write when !CONFIG_BLOCK
  ext3: drop if around WARN_ON
  ext3: get rid of the duplicate code on ext3_fill_super
  udf: remove un-needed variable from inode_getblk
  udf: don't increment lenExtents while writing to a hole
  udf: fix memory leak while allocating blocks during write

12 years agoMerge branch 'for-3.8/core' of git://git.kernel.dk/linux-block
Linus Torvalds [Mon, 17 Dec 2012 16:27:23 +0000 (08:27 -0800)]
Merge branch 'for-3.8/core' of git://git.kernel.dk/linux-block

Pull block layer core updates from Jens Axboe:
 "Here are the core block IO bits for 3.8.  The branch contains:

   - The final version of the surprise device removal fixups from Bart.

   - Don't hide EFI partitions under advanced partition types.  It's
     fairly wide spread these days.  This is especially dangerous for
     systems that have both msdos and efi partition tables, where you
     want to keep them in sync.

   - Cleanup of using -1 instead of the proper NUMA_NO_NODE

   - Export control of bdi flusher thread CPU mask and default to using
     the home node (if known) from Jeff.

   - Export unplug tracepoint for MD.

   - Core improvements from Shaohua.  Reinstate the recursive merge, as
     the original bug has been fixed.  Add plugging for discard and also
     fix a problem handling non pow-of-2 discard limits.

  There's a trivial merge in block/blk-exec.c due to a fix that went
  into 3.7-rc at a later point than -rc4 where this is based."

* 'for-3.8/core' of git://git.kernel.dk/linux-block:
  block: export block_unplug tracepoint
  block: add plug for blkdev_issue_discard
  block: discard granularity might not be power of 2
  deadline: Allow 0ms deadline latency, increase the read speed
  partitions: enable EFI/GPT support by default
  bsg: Remove unused function bsg_goose_queue()
  block: Make blk_cleanup_queue() wait until request_fn finished
  block: Avoid scheduling delayed work on a dead queue
  block: Avoid that request_fn is invoked on a dead queue
  block: Let blk_drain_queue() caller obtain the queue lock
  block: Rename queue dead flag
  bdi: add a user-tunable cpu_list for the bdi flusher threads
  block: use NUMA_NO_NODE instead of -1
  block: recursive merge requests
  block CFQ: avoid moving request to different queue

12 years agoMerge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Mon, 17 Dec 2012 16:26:17 +0000 (08:26 -0800)]
Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux

Pull DRM updates from Dave Airlie:
 "This is the one and only next pull for 3.8, we had a regression we
  found last week, so I was waiting for that to resolve itself, and I
  ended up with some Intel fixes on top as well.

  Highlights:
   - new driver: nvidia tegra 20/30/hdmi support
   - radeon: add support for previously unused DMA engines, more HDMI
     regs, eviction speeds ups and fixes
   - i915: HSW support enable, agp removal on GEN6, seqno wrapping
   - exynos: IPP subsystem support (image post proc), HDMI
   - nouveau: display class reworking, nv20->40 z compression
   - ttm: start of locking fixes, rcu usage for lookups,
   - core: documentation updates, docbook integration, monotonic clock
     usage, move from connector to object properties"

* 'drm-next' of git://people.freedesktop.org/~airlied/linux: (590 commits)
  drm/exynos: add gsc ipp driver
  drm/exynos: add rotator ipp driver
  drm/exynos: add fimc ipp driver
  drm/exynos: add iommu support for ipp
  drm/exynos: add ipp subsystem
  drm/exynos: support device tree for fimd
  radeon: fix regression with eviction since evict caching changes
  drm/radeon: add more pedantic checks in the CP DMA checker
  drm/radeon: bump version for CS ioctl support for async DMA
  drm/radeon: enable the async DMA rings in the CS ioctl
  drm/radeon: add VM CS parser support for async DMA on cayman/TN/SI
  drm/radeon/kms: add evergreen/cayman CS parser for async DMA (v2)
  drm/radeon/kms: add 6xx/7xx CS parser for async DMA (v2)
  drm/radeon: fix htile buffer size computation for command stream checker
  drm/radeon: fix fence locking in the pageflip callback
  drm/radeon: make indirect register access concurrency-safe
  drm/radeon: add W|RREG32_IDX for MM_INDEX|DATA based mmio accesss
  drm/exynos: support extended screen coordinate of fimd
  drm/exynos: fix x, y coordinates for right bottom pixel
  drm/exynos: fix fb offset calculation for plane
  ...

12 years agosched: numa: Fix build error if CONFIG_NUMA_BALANCING && !CONFIG_TRANSPARENT_HUGEPAGE
Mel Gorman [Mon, 17 Dec 2012 14:05:53 +0000 (14:05 +0000)]
sched: numa: Fix build error if CONFIG_NUMA_BALANCING && !CONFIG_TRANSPARENT_HUGEPAGE

Michal Hocko reported that the following build error occurs if
CONFIG_NUMA_BALANCING is set without THP support

  kernel/sched/fair.c: In function â€˜task_numa_work’:
  kernel/sched/fair.c:932:55: error: call to â€˜__build_bug_failed’ declared with attribute error: BUILD_BUG failed

The problem is that HPAGE_PMD_SHIFT triggers a BUILD_BUG() on
!CONFIG_TRANSPARENT_HUGEPAGE. This patch addresses the problem.

Reported-by: Michal Hocko <[email protected]>
Signed-off-by: Mel Gorman <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agoUAPI: (Scripted) Disintegrate arch/alpha/include/asm
David Howells [Mon, 17 Dec 2012 13:47:09 +0000 (13:47 +0000)]
UAPI: (Scripted) Disintegrate arch/alpha/include/asm

Signed-off-by: David Howells <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Acked-by: Thomas Gleixner <[email protected]>
Acked-by: Michael Kerrisk <[email protected]>
Acked-by: Paul E. McKenney <[email protected]>
Acked-by: Dave Jones <[email protected]>
Acked-by: Michael Cree <[email protected]>
Acked-by: Matt Turner <[email protected]>
12 years agos390/ccwdev: Include asm/schid.h.
Cornelia Huck [Thu, 13 Dec 2012 12:38:51 +0000 (13:38 +0100)]
s390/ccwdev: Include asm/schid.h.

Get the definition of struct subchannel_id.

Signed-off-by: Cornelia Huck <[email protected]>
Signed-off-by: Martin Schwidefsky <[email protected]>
12 years agomm: fix kernel BUG at huge_memory.c:1474!
Hugh Dickins [Mon, 17 Dec 2012 02:56:58 +0000 (18:56 -0800)]
mm: fix kernel BUG at huge_memory.c:1474!

Andrea's autonuma-benchmark numa01 hits kernel BUG at huge_memory.c:1474!
in change_huge_pmd called from change_protection from change_prot_numa
from task_numa_work.

That BUG, introduced in the huge zero page commit cad7f613c4d0 ("thp:
change_huge_pmd(): make sure we don't try to make a page writable")
was trying to verify that newprot never adds write permission to an
anonymous huge page; but Automatic NUMA Balancing's 4b10e7d562c9 ("mm:
mempolicy: Implement change_prot_numa() in terms of change_protection()")
adds a new prot_numa path into change_huge_pmd(), which makes no use of
the newprot provided, and may retain the write bit in the pmd.

Just move the BUG_ON(pmd_write(entry)) up into the !prot_numa block.

Signed-off-by: Hugh Dickins <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 years agoMerge tag 'mfd-3.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
Linus Torvalds [Mon, 17 Dec 2012 02:55:20 +0000 (18:55 -0800)]
Merge tag 'mfd-3.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6

Pull MFS update from Samuel Ortiz:
 "This is the MFD patch set for the 3.8 merge window.

  We have several new drivers, most of the time coming with their sub
  devices drivers:

   - Austria Microsystem's AS3711
   - Nano River's viperboard
   - TI's TPS80031, AM335x TS/ADC,
   - Realtek's MMC/memstick card reader
   - Nokia's retu

  We also got some notable cleanups and improvements:

   - tps6586x got converted to IRQ domains.
   - tps65910 and tps65090 moved to the regmap IRQ API.
   - STMPE is now Device Tree aware.
   - A general twl6040 and twl-core cleanup, with moves to the regmap
     I/O and IRQ APIs and a conversion to the recently added PWM
     framework.
   - sta2x11 gained regmap support.

  Then the rest is mostly tiny cleanups and fixes, among which we have
  Mark's wm5xxx and wm8xxx patchset."

Far amount of annoying but largely trivial conflicts.  Many due to
__devinit/exit removal, others due to one or two of the new drivers also
having come in through another tree.

* tag 'mfd-3.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (119 commits)
  mfd: tps6507x: Convert to devm_kzalloc
  mfd: stmpe: Update DT support for stmpe driver
  mfd: wm5102: Add readback of DSP status 3 register
  mfd: arizona: Log if we fail to create the primary IRQ domain
  mfd: tps80031: MFD_TPS80031 needs to select REGMAP_IRQ
  mfd: tps80031: Add terminating entry for tps80031_id_table
  mfd: sta2x11: Fix potential NULL pointer dereference in __sta2x11_mfd_mask()
  mfd: wm5102: Add tuning for revision B
  mfd: arizona: Defer patch initialistation until after first device boot
  mfd: tps65910: Fix wrong ack_base register
  mfd: tps65910: Remove unused data
  mfd: stmpe: Get rid of irq_invert_polarity
  mfd: ab8500-core: Fix invalid free of devm_ allocated data
  mfd: wm5102: Mark DSP memory regions as volatile
  mfd: wm5102: Correct default for LDO1_CONTROL_2
  mfd: arizona: Register haptics devices
  mfd: wm8994: Make current device behaviour the default
  mfd: tps65090: MFD_TPS65090 needs to select REGMAP_IRQ
  mfd: Fix stmpe.c build when OF is not enabled
  mfd: jz4740-adc: Use devm_kzalloc
  ...

12 years agoBtrfs: don't take inode delalloc mutex if we're a free space inode
Josef Bacik [Fri, 14 Dec 2012 18:48:14 +0000 (13:48 -0500)]
Btrfs: don't take inode delalloc mutex if we're a free space inode

This confuses and angers lockdep even though it's ok.  We don't really need
the lock for free space inodes since only the transaction committer will be
reserving space.  Thanks,

Signed-off-by: Josef Bacik <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: fix autodefrag and umount lockup
Josef Bacik [Fri, 14 Dec 2012 18:46:43 +0000 (13:46 -0500)]
Btrfs: fix autodefrag and umount lockup

This happens because writeback_inodes_sb_nr_if_idle does down_read.  This
doesn't work for us and it has not been fixed upstream yet, so do it
ourselves and use that instead so we can stop having this stupid long
standing lockup.  Thanks,

Signed-off-by: Josef Bacik <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: fix permissions of empty files not affected by umask
Filipe Brandenburger [Fri, 30 Nov 2012 03:40:08 +0000 (03:40 +0000)]
Btrfs: fix permissions of empty files not affected by umask

When a new file is created with btrfs_create(), the inode will initially be
created with permissions 0666 and later on in btrfs_init_acl() it will be
adapted to mask out the umask bits. The problem is that this change won't make
it into the btrfs_inode unless there's another change to the inode (e.g. writing
content changing the size or touching the file changing the mtime.)

This fix adds a call to btrfs_update_inode() to btrfs_create() to make sure that
the change will not get lost if the in-memory inode is flushed before other
changes are made to the file.

Signed-off-by: Filipe Brandenburger <[email protected]>
Reviewed-by: Liu Bo <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: put raid properties into global table
Liu Bo [Wed, 21 Nov 2012 14:18:10 +0000 (14:18 +0000)]
Btrfs: put raid properties into global table

Raid properties can be shared among raid calculation code, we can put
them into a global table to keep it simple.

Signed-off-by: Liu Bo <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: fix BUG() in scrub when first superblock reading gives EIO
Stefan Behrens [Wed, 14 Nov 2012 18:57:29 +0000 (18:57 +0000)]
Btrfs: fix BUG() in scrub when first superblock reading gives EIO

This fixes a very special case that can be reproduced by just
disconnecting a disk at runtime, and without unmounting the
filesystem first, start scrub on the filesystem with the
disconnected disk. All read and write EIOs are handled
correctly, only the first superblock is an exception and gives
a BUG() in a subfunction. The BUG() is correct, it would crash
later otherwise. The subfunction must not be called for
superblocks and this is what the fix changes.

Reported-by: Joeri Vanthienen <[email protected]>
Signed-off-by: Stefan Behrens <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: do not call file_update_time in aio_write
Josef Bacik [Fri, 9 Nov 2012 15:53:21 +0000 (10:53 -0500)]
Btrfs: do not call file_update_time in aio_write

This starts a transaction and dirties the inode everytime we call it, which
is super expensive if you have a write heavy workload.  We will be updating
the inode when the IO completes and we reserve the space for the inode
update when we reserve space for the write, so there is no chance of loss of
information or enospc issues.  Thanks,

Signed-off-by: Josef Bacik <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: only unlock and relock if we have to
Josef Bacik [Wed, 7 Nov 2012 18:44:13 +0000 (13:44 -0500)]
Btrfs: only unlock and relock if we have to

I noticed while doing fsync tests that we were always dropping the path and
re-searching when we first cow the log root even though we've already gotten
the write lock on the root.  That's because we don't take into account that
there might not be a parent node, so fix the check to make sure there is
actually a parent node before we undo all of this work for nothing.  Thanks,

Signed-off-by: Josef Bacik <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: use tokens where we can in the tree log
Josef Bacik [Tue, 23 Oct 2012 20:03:44 +0000 (16:03 -0400)]
Btrfs: use tokens where we can in the tree log

If we are syncing over and over the overhead of doing all those maps in
fill_inode_item and log_changed_extents really starts to hurt, so use map
tokens so we can avoid all the extra mapping.  Since the token maps from our
offset to the end of the page make sure to set the first thing in the item
first so we really only do one map.  Thanks,

Signed-off-by: Josef Bacik <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: optimize leaf_space_used
Josef Bacik [Mon, 15 Oct 2012 17:43:18 +0000 (13:43 -0400)]
Btrfs: optimize leaf_space_used

This gets called at least 4 times for every level while adding an object,
and it involves 3 kmapping calls, which on my box take about 5us a piece.
So instead use a token, which brings us down to 1 kmap call and makes this
function take 1/3 of the time per call.  Thanks,

Signed-off-by: Josef Bacik <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: don't memset new tokens
Josef Bacik [Mon, 15 Oct 2012 17:39:33 +0000 (13:39 -0400)]
Btrfs: don't memset new tokens

Our token logic depends on token->kaddr being set, and if it is not it sets
everything properly as needed.  So instead of memsetting just set
token->kaddr to NULL.  Thanks,

Signed-off-by: Josef Bacik <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: only clear dirty on the buffer if it is marked as dirty
Josef Bacik [Mon, 15 Oct 2012 17:33:54 +0000 (13:33 -0400)]
Btrfs: only clear dirty on the buffer if it is marked as dirty

No reason to set the path blocking or loop through all of the pages if the
extent buffer isn't actually marked dirty.  Thanks,

Signed-off-by: Josef Bacik <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: move checks in set_page_dirty under DEBUG
Josef Bacik [Mon, 15 Oct 2012 17:30:43 +0000 (13:30 -0400)]
Btrfs: move checks in set_page_dirty under DEBUG

This is a high traffic function, let's try and do as little as possible
during normal operations shall we?

Signed-off-by: Josef Bacik <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: log changed inodes based on the extent map tree
Josef Bacik [Thu, 11 Oct 2012 20:54:30 +0000 (16:54 -0400)]
Btrfs: log changed inodes based on the extent map tree

We don't really need to copy extents from the source tree since we have all
of the information already available to us in the extent_map tree.  So
instead just write the extents straight to the log tree and don't bother to
copy the extent items from the source tree.

Signed-off-by: Josef Bacik <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: add path->really_keep_locks
Josef Bacik [Wed, 12 Dec 2012 22:00:01 +0000 (17:00 -0500)]
Btrfs: add path->really_keep_locks

You'd think path->keep_locks would keep all the locks wouldn't you?  You'd
be wrong.  It only keeps them if the slot is pointing to the last item in
the node.  This is for use with btrfs_next_leaf, which needs this sort of
thing.  But the horrible horrible things I'm going to do to the tree log
means I really need everything held from root to leaf so I can add and
delete items in the same search.  Thanks,

Signed-off-by: Josef Bacik <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: do not mark ems as prealloc if we are writing to them
Josef Bacik [Mon, 3 Dec 2012 15:58:15 +0000 (10:58 -0500)]
Btrfs: do not mark ems as prealloc if we are writing to them

We are going to use EM's to log extents in the future, so we need to not
mark them as prealloc if they aren't actually prealloc extents.  Instead
mark them with FILLING so we know to ammend mod_start/mod_len and that way
we don't confuse the extent logging code.  Thanks,

Signed-off-by: Josef Bacik <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: keep track of the extents original block length
Josef Bacik [Mon, 3 Dec 2012 15:31:19 +0000 (10:31 -0500)]
Btrfs: keep track of the extents original block length

If we've written to a prealloc extent we need to know the original block len
for the extent.  We can't figure this out currently since ->block_len is
just set to the extent length.  So introduce ->orig_block_len so that we
know how many bytes were in the original extent for proper extent logging
that future patches will need.  Thanks,

Signed-off-by: Josef Bacik <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: inline csums if we're fsyncing
Josef Bacik [Fri, 16 Nov 2012 18:56:32 +0000 (13:56 -0500)]
Btrfs: inline csums if we're fsyncing

The tree logging stuff needs the csums to be on the ordered extents in order
to log them properly, so mark that we're sync and inline the csum creation
so we don't have to wait on the csumming to be done when logging extents
that are still in flight.  Thanks,

Signed-off-by: Josef Bacik <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: don't bother copying if we're only logging the inode
Josef Bacik [Thu, 11 Oct 2012 20:17:34 +0000 (16:17 -0400)]
Btrfs: don't bother copying if we're only logging the inode

We don't copy inode items anwyay, we just copy them straight into the log
from the in memory inode.  So if we know we're only logging the inode, don't
bother dropping anything, just try to insert it and either if it succeeds or
we get EEXIST we can update the inode item in the log and carry on.  Thanks,

Signed-off-by: Josef Bacik <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: only log the inode item if we can get away with it
Josef Bacik [Thu, 11 Oct 2012 19:53:56 +0000 (15:53 -0400)]
Btrfs: only log the inode item if we can get away with it

Currently we copy all the file information into the log, inode item, the
refs, xattrs etc.  Except most of this doesn't change from fsync to fsync,
just the inode item changes.  So set a flag if an xattr changes or a link is
added, and otherwise only log the inode item.  Thanks,

Signed-off-by: Josef Bacik <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: rename root_times_lock to root_item_lock
Anand Jain [Fri, 7 Dec 2012 09:28:54 +0000 (09:28 +0000)]
Btrfs: rename root_times_lock to root_item_lock

Originally root_times_lock was introduced as part of send/receive
code however newly developed patch to label the subvol reused
the same lock, so renaming it for a meaningful name.

Signed-off-by: Anand Jain <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agobtrfs: Notify udev when removing device
Lukas Czerner [Thu, 6 Dec 2012 19:25:48 +0000 (19:25 +0000)]
btrfs: Notify udev when removing device

Currently udev does not know about the device being removed from the
file system. This may result in the situation where we're unable to
mount the file system by UUID or by LABEL because the by-uuid and
by-label links may still point to the device which is no longer part of
the btrfs file system and hence does not have any btrfs super block.

It can be easily reproduced by the following:

mkfs.btrfs -L bugfs /dev/loop[0-6]
mount /dev/loop0 /mnt/test
btrfs device delete /dev/loop0 /mnt/test
umount /mnt/test

mount LABEL=bugfs /mnt/test <---- this fails

then see:

ls -l /dev/disk/by-label/bugfs

which will still point to the /dev/loop0

We did not noticed this before because libblkid would send the udev
event for us when it notice that the link does not fit the reality,
however it does not do that anymore and completely relies on udev
information.

Fix this by sending the KOBJ_CHANGE event to the bdev kobject after
successful device removal.

Note that this does not affect device addition, because we will open the
device prior the addition from userspace and udev will notice that and
reread the device afterwards.

Signed-off-by: Lukas Czerner <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: fix wrong return value of btrfs_truncate_page()
Miao Xie [Wed, 5 Dec 2012 10:56:13 +0000 (10:56 +0000)]
Btrfs: fix wrong return value of btrfs_truncate_page()

ret variant may be set to 0 if we read page successfully, but it might be
released before we lock it again. On this case, if we fail to allocate a
new page, we will return 0, it is wrong, fix it.

Signed-off-by: Miao Xie <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: punch hole past the end of the file
Miao Xie [Wed, 5 Dec 2012 10:54:52 +0000 (10:54 +0000)]
Btrfs: punch hole past the end of the file

Since we can pre-allocate the space past EOF, we should be able to reclaim
that space if we need. This patch implements it by removing the EOF check.

Though the manual of fallocate command says we can use truncate command to
reclaim the pre-allocated space which past EOF, but because truncate command
changes the file size, we must run several commands to reclaim the space if we
don't want to change the file size, so it is not a good choice.

Signed-off-by: Miao Xie <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: fix the page that is beyond EOF
Miao Xie [Wed, 5 Dec 2012 10:54:12 +0000 (10:54 +0000)]
Btrfs: fix the page that is beyond EOF

Steps to reproduce:
 # mkfs.btrfs <disk>
 # mount <disk> <mnt>
 # dd if=/dev/zero of=<mnt>/<file> bs=512 seek=5 count=8
 # fallocate -p -o 2048 -l 16384 <mnt>/<file>
 # dd if=/dev/zero of=<mnt>/<file> bs=4096 seek=3 count=8 conv=notrunc,nocreat
 # umount <mnt>
 # dmesg
 WARNING: at fs/btrfs/inode.c:7140 btrfs_destroy_inode+0x2eb/0x330

The reason is that we inputed a range which is beyond the end of the file. And
because the end of this range was not page-aligned, we had to truncate the last
page in this range, this operation is similar to a buffered file write. In other
words, we reserved enough space and clear the data which was in the hole range
on that page. But when we expanded that test file, write the data into the same
page, we forgot that we have reserved enough space for the buffered write of
that page because in most cases there is no page that is beyond the end of
the file. As a result, we reserved the space twice.

In fact, we needn't truncate the page if it is beyond the end of the file, just
release the allocated space in that range. Fix the above problem by this way.

Signed-off-by: Miao Xie <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: fix off-by-one error of the same page check in btrfs_punch_hole()
Miao Xie [Wed, 5 Dec 2012 10:53:45 +0000 (10:53 +0000)]
Btrfs: fix off-by-one error of the same page check in btrfs_punch_hole()

(start + len) is the start of the adjacent extent, not the end of the current
extent, so we should not use it to check the hole is on the same page or not.

Signed-off-by: Miao Xie <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: fix missing reserved space release in error path of delalloc reservation
Miao Xie [Wed, 5 Dec 2012 10:53:25 +0000 (10:53 +0000)]
Btrfs: fix missing reserved space release in error path of delalloc reservation

We forget to release the reserved space in the error path of delalloc
reservatiom, fix it.

Signed-off-by: Miao Xie <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: don't auto defrag a file when doing directIO
Miao Xie [Wed, 5 Dec 2012 10:52:48 +0000 (10:52 +0000)]
Btrfs: don't auto defrag a file when doing directIO

If we runt the direct IO, we should not run auto defrag, because it may
introduce buffered IO vs direcIO problem, and make direct IO slow down.

Signed-off-by: Miao Xie <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: parse parent 0 into correct value in tracepoint
Liu Bo [Fri, 30 Nov 2012 11:24:22 +0000 (11:24 +0000)]
Btrfs: parse parent 0 into correct value in tracepoint

Value 0 is not a tree id, so besides an upper limit, a lower limit is
necessary as well while parsing root types of tracepoint.

Signed-off-by: Liu Bo <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: use ctl->unit for free space calculation instead of block_group->sectorsize
Wang Sheng-Hui [Fri, 30 Nov 2012 06:30:14 +0000 (06:30 +0000)]
Btrfs: use ctl->unit for free space calculation instead of block_group->sectorsize

We should use ctl->unit for free space calculation instead of block_group->sectorsize
even though for free space use_bitmap or free space cluster we only have sectorsize assigned to ctl->unit currently. Also, we can keep it consisten in code style.

Signed-off-by: Wang Sheng-Hui <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: refactor error handling to drop inode in btrfs_create()
Filipe Brandenburger [Fri, 30 Nov 2012 03:40:09 +0000 (03:40 +0000)]
Btrfs: refactor error handling to drop inode in btrfs_create()

Refactor it by checking whether the inode has been created and needs to be
dropped (drop_inode_on_err) and also if the err variable is set. That way the
variable doesn't need to be set on each and every error handling block.

Signed-off-by: Filipe Brandenburger <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: fix permissions of empty files not affected by umask
Filipe Brandenburger [Fri, 30 Nov 2012 03:40:08 +0000 (03:40 +0000)]
Btrfs: fix permissions of empty files not affected by umask

When a new file is created with btrfs_create(), the inode will initially be
created with permissions 0666 and later on in btrfs_init_acl() it will be
adapted to mask out the umask bits. The problem is that this change won't make
it into the btrfs_inode unless there's another change to the inode (e.g. writing
content changing the size or touching the file changing the mtime.)

This fix adds a call to btrfs_update_inode() to btrfs_create() to make sure that
the change will not get lost if the in-memory inode is flushed before other
changes are made to the file.

Signed-off-by: Filipe Brandenburger <[email protected]>
Reviewed-by: Liu Bo <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: add fiemap's flag check
Tsutomu Itoh [Thu, 29 Nov 2012 05:08:26 +0000 (05:08 +0000)]
Btrfs: add fiemap's flag check

When the flag not supported is specified, it is necessary to return the error
to the caller.
So, we add the validity check of the fiemap's flag.

Signed-off-by: Tsutomu Itoh <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: don't add a NULL extended attribute
Liu Bo [Wed, 28 Nov 2012 10:43:12 +0000 (10:43 +0000)]
Btrfs: don't add a NULL extended attribute

Passing a null extended attribute value means to remove the attribute,
but we don't have to add a new NULL extended attribute.

Signed-off-by: Liu Bo <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: skip adding an acl attribute if we don't have to
Liu Bo [Wed, 28 Nov 2012 10:43:11 +0000 (10:43 +0000)]
Btrfs: skip adding an acl attribute if we don't have to

If the acl can be exactly represented in the traditional file
mode permission bits, we don't set another acl attribute.

Signed-off-by: Liu Bo <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: fix off-by-one error of the reserved size of btrfs_allocate()
Miao Xie [Wed, 28 Nov 2012 10:28:54 +0000 (10:28 +0000)]
Btrfs: fix off-by-one error of the reserved size of btrfs_allocate()

alloc_end is not the real end of the current extent, it is the start of the
next adjoining extent. So we needn't +1 when calculating the size the space
that is about to be reserved.

Signed-off-by: Miao Xie <[email protected]>
Reviewed-by: Liu Bo <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: use existing align macros in btrfs_allocate()
Miao Xie [Wed, 28 Nov 2012 10:28:07 +0000 (10:28 +0000)]
Btrfs: use existing align macros in btrfs_allocate()

The kernel developers have implemented some often-used align macros, we should
use them instead of the complex code.

Signed-off-by: Miao Xie <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: fix a scrub regression in case of write errors
Stefan Behrens [Tue, 27 Nov 2012 17:39:51 +0000 (17:39 +0000)]
Btrfs: fix a scrub regression in case of write errors

This regression was introduced by the device-replace patches.
Scrub immediately stops checking those disks that have write errors.
This is nothing that happens in the real world, but it is wrong
since scrub is the tool to detect and repair defects. Fix it.

Signed-off-by: Stefan Behrens <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: fix a build warning for an unused label
Stefan Behrens [Tue, 27 Nov 2012 17:39:50 +0000 (17:39 +0000)]
Btrfs: fix a build warning for an unused label

This issue was detected by the "0-DAY kernel build testing".

fs/btrfs/volumes.c: In function 'btrfs_rm_device':
fs/btrfs/volumes.c:1505:1: warning: label 'error_close' defined but not used [-Wunused-label]

Signed-off-by: Stefan Behrens <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: fix race in check-integrity caused by usage of bitfield
Stefan Behrens [Tue, 27 Nov 2012 16:10:21 +0000 (16:10 +0000)]
Btrfs: fix race in check-integrity caused by usage of bitfield

The structure member mirror_num is modified concurrently to the
structure member is_iodone. This doesn't require any locking by
design, unless everything is stored in the same 32 bits of a
bit field. This was the case and xfstest 284 was able to
trigger false warnings from the checker code. This patch
seperates the bits and fixes the race.

Signed-off-by: Stefan Behrens <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: fix freeze vs auto defrag
Miao Xie [Mon, 26 Nov 2012 09:27:29 +0000 (09:27 +0000)]
Btrfs: fix freeze vs auto defrag

If we freeze the fs, the auto defragment should not run. Fix it.

Signed-off-by: Miao Xie <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: restructure btrfs_run_defrag_inodes()
Miao Xie [Mon, 26 Nov 2012 09:26:20 +0000 (09:26 +0000)]
Btrfs: restructure btrfs_run_defrag_inodes()

This patch restructure btrfs_run_defrag_inodes() and make the code of the auto
defragment more readable.

Signed-off-by: Miao Xie <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: fix unprotected defragable inode insertion
Miao Xie [Mon, 26 Nov 2012 09:25:38 +0000 (09:25 +0000)]
Btrfs: fix unprotected defragable inode insertion

We forget to get the defrag lock when we re-add the defragable inode,
Fix it.

Signed-off-by: Miao Xie <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: use slabs for auto defrag allocation
Miao Xie [Mon, 26 Nov 2012 09:24:43 +0000 (09:24 +0000)]
Btrfs: use slabs for auto defrag allocation

The auto defrag allocation is in the fast path of the IO, so use slabs
to improve the speed of the allocation.

And besides that, it can do check for leaked objects when the module is removed.

Signed-off-by: Miao Xie <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: get write access for qgroup operations
Miao Xie [Mon, 26 Nov 2012 08:50:11 +0000 (08:50 +0000)]
Btrfs: get write access for qgroup operations

We need get write access for qgroup operations, or we will modify the R/O fs.

Signed-off-by: Miao Xie <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: get write access for scrub
Miao Xie [Mon, 26 Nov 2012 08:48:01 +0000 (08:48 +0000)]
Btrfs: get write access for scrub

We need get write access for scrub, or we will modify the R/O fs.

Signed-off-by: Miao Xie <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: get write access when removing a device
Miao Xie [Mon, 26 Nov 2012 08:44:50 +0000 (08:44 +0000)]
Btrfs: get write access when removing a device

Steps to reproduce:
 # mkfs.btrfs -d single -m single <disk0> <disk1>
 # mount -o ro <disk0> <mnt0>
 # mount -o ro <disk0> <mnt1>
 # mount -o remount,rw <mnt0>
 # umount <mnt0>
 # btrfs device delete <disk1> <mnt1>

We can remove a device from a R/O filesystem. The reason is that we just check
the R/O flag of the super block object. It is not enough, because the kernel
may set the R/O flag only for the mount point. We need invoke

mnt_want_write_file()

to do a full check.

Signed-off-by: Miao Xie <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: get write access when doing resize fs
Miao Xie [Mon, 26 Nov 2012 08:43:45 +0000 (08:43 +0000)]
Btrfs: get write access when doing resize fs

Steps to reproduce:
 # mkfs.btrfs <partition>
 # mount -o ro <partition> <mnt0>
 # mount -o ro <partition> <mnt1>
 # mount -o remount,rw <mnt0>
 # umount <mnt0>
 # btrfs fi resize 10g <mnt1>

We re-sized a R/O filesystem. The reason is that we just check the R/O flag
of the super block object. It is not enough, because the kernel may set the
R/O flag only for the mount point. We need invoke mnt_want_write_file() to
do a full check.

Signed-off-by: Miao Xie <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: get write access when setting the default subvolume
Miao Xie [Mon, 26 Nov 2012 08:43:07 +0000 (08:43 +0000)]
Btrfs: get write access when setting the default subvolume

When wen want to set the default subvolume, we must get write access, or
we will change the R/O file system.

Signed-off-by: Miao Xie <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: fix wrong return value of btrfs_wait_for_commit()
Miao Xie [Mon, 26 Nov 2012 08:42:07 +0000 (08:42 +0000)]
Btrfs: fix wrong return value of btrfs_wait_for_commit()

If the id of the existed transaction is more than the one we specified, it
means the specified transaction was commited, so we should return 0, not
EINVAL.

Signed-off-by: Miao Xie <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: don't start a new transaction when starting sync
Miao Xie [Mon, 26 Nov 2012 08:41:29 +0000 (08:41 +0000)]
Btrfs: don't start a new transaction when starting sync

If there is no running transaction in the fs, we needn't start a new one when
we want to start sync.

Signed-off-by: Miao Xie <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: pass root object into btrfs_ioctl_{start, wait}_sync()
Miao Xie [Mon, 26 Nov 2012 08:40:43 +0000 (08:40 +0000)]
Btrfs: pass root object into btrfs_ioctl_{start, wait}_sync()

Since we have gotten the root in the caller, just pass it into
btrfs_ioctl_{start, wait}_sync() directly.

Signed-off-by: Miao Xie <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: fix an while-loop of listxattr
Liu Bo [Mon, 26 Nov 2012 02:58:36 +0000 (02:58 +0000)]
Btrfs: fix an while-loop of listxattr

If we found an invalid xattr dir item, we'd better try the next one instead.

Signed-off-by: Liu Bo <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: do not warn_on io_ctl->cur in io_ctl_map_page
Wang Sheng-Hui [Fri, 23 Nov 2012 03:03:14 +0000 (03:03 +0000)]
Btrfs: do not warn_on io_ctl->cur in io_ctl_map_page

io_ctl_map_page is called by many functions in free-space-cache.
In most scenarios, the ->cur is not null, e.g. io_ctl_add_entry.
I think we'd better remove the warn_on here.

Signed-off-by: Wang Sheng-Hui <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoBtrfs: add support for device replace ioctls
Stefan Behrens [Tue, 6 Nov 2012 14:08:53 +0000 (15:08 +0100)]
Btrfs: add support for device replace ioctls

This is the commit that allows to start the device replace
procedure.

An ioctl() interface is added that supports starting and
canceling the device replace procedure, and to retrieve
the status and progress.

Signed-off-by: Stefan Behrens <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
12 years agoMerge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu
Linus Torvalds [Mon, 17 Dec 2012 01:42:21 +0000 (17:42 -0800)]
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu

Pull m68knommu updates from Greg Ungerer:
 "This one has a major restructuring of the non-mmu 68000 support.

  It merges all the related SoC types that use the original 68000 cpu
  core internally so they can share the same core code.  It also allows
  for supporting the original stand alone 68000 cpu in its own right.

  There is also a generalization of the clock support of the ColdFire
  parts, some merging of common ColdFire code, and a couple of bug fixes
  as well."

* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu:
  m68knommu: modify clock code so it can be used by all ColdFire CPU types
  m68knommu: add clock definitions for 54xx ColdFire CPU types
  m68knommu: add clock definitions for 5407 ColdFire CPU types
  m68knommu: add clock definitions for 5307 ColdFire CPU types
  m68knommu: add clock definitions for 528x ColdFire CPU types
  m68knommu: add clock definitions for 527x ColdFire CPU types
  m68knommu: add clock definitions for 5272 ColdFire CPU types
  m68knommu: add clock definitions for 525x ColdFire CPU types
  m68knommu: add clock definitions for 5249 ColdFire CPU types
  m68knommu: add clock definitions for 523x ColdFire CPU types
  m68knommu: add clock definitions for 5206 ColdFire CPU types
  m68knommu: add clock creation support macro for other ColdFire CPUs
  m68k: fix unused variable warning in mempcy.c
  m68knommu: make non-MMU page_to_virt() return a void *
  m68knommu: merge ColdFire 5249 and 525x definitions
  m68knommu: disable MC68000 cpu target when MMU is selected
  m68knommu: allow for configuration of true 68000 based systems
  m68knommu: platform code merge for 68000 core cpus

12 years agoMerge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvar...
Linus Torvalds [Mon, 17 Dec 2012 01:41:26 +0000 (17:41 -0800)]
Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging

Pull i2c update from Jean Delvare:
 "This is my last pull request for the i2c subsystem.  It includes all
  the patches I collected between kernel v3.7-rc1 and me passing i2c
  maintenance duties over to Wolfram.

  Future patches to the many i2c bus drivers I still maintain will go
  through Wolfram's tree."

* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  i2c: Mention functionality flags in SMBus protocol documentation
  i2c-piix4: Convert dev_printk(KERN_<LEVEL> to dev_<level>(
  i2c-i801: Enable interrupts for all post-ICH5 chips
  i2c-i801: Add device tree support
  MAINTAINERS: Fix drivers/i2c/busses/i2c-stub.c

This page took 0.118708 seconds and 4 git commands to generate.