Commit graph

1321 commits

Author SHA1 Message Date
Linus Torvalds 9ec3a646fe Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull fourth vfs update from Al Viro:
 "d_inode() annotations from David Howells (sat in for-next since before
  the beginning of merge window) + four assorted fixes"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  RCU pathwalk breakage when running into a symlink overmounting something
  fix I_DIO_WAKEUP definition
  direct-io: only inc/dec inode->i_dio_count for file systems
  fs/9p: fix readdir()
  VFS: assorted d_backing_inode() annotations
  VFS: fs/inode.c helpers: d_inode() annotations
  VFS: fs/cachefiles: d_backing_inode() annotations
  VFS: fs library helpers: d_inode() annotations
  VFS: assorted weird filesystems: d_inode() annotations
  VFS: normal filesystems (and lustre): d_inode() annotations
  VFS: security/: d_inode() annotations
  VFS: security/: d_backing_inode() annotations
  VFS: net/: d_inode() annotations
  VFS: net/unix: d_backing_inode() annotations
  VFS: kernel/: d_inode() annotations
  VFS: audit: d_backing_inode() annotations
  VFS: Fix up some ->d_inode accesses in the chelsio driver
  VFS: Cachefiles should perform fs modifications on the top layer only
  VFS: AF_UNIX sockets should call mknod on the top layer only
2015-04-26 17:22:07 -07:00
Linus Torvalds 4fc8adcfec Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull third hunk of vfs changes from Al Viro:
 "This contains the ->direct_IO() changes from Omar + saner
  generic_write_checks() + dealing with fcntl()/{read,write}() races
  (mirroring O_APPEND/O_DIRECT into iocb->ki_flags and instead of
  repeatedly looking at ->f_flags, which can be changed by fcntl(2),
  check ->ki_flags - which cannot) + infrastructure bits for dhowells'
  d_inode annotations + Christophs switch of /dev/loop to
  vfs_iter_write()"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (30 commits)
  block: loop: switch to VFS ITER_BVEC
  configfs: Fix inconsistent use of file_inode() vs file->f_path.dentry->d_inode
  VFS: Make pathwalk use d_is_reg() rather than S_ISREG()
  VFS: Fix up debugfs to use d_is_dir() in place of S_ISDIR()
  VFS: Combine inode checks with d_is_negative() and d_is_positive() in pathwalk
  NFS: Don't use d_inode as a variable name
  VFS: Impose ordering on accesses of d_inode and d_flags
  VFS: Add owner-filesystem positive/negative dentry checks
  nfs: generic_write_checks() shouldn't be done on swapout...
  ocfs2: use __generic_file_write_iter()
  mirror O_APPEND and O_DIRECT into iocb->ki_flags
  switch generic_write_checks() to iocb and iter
  ocfs2: move generic_write_checks() before the alignment checks
  ocfs2_file_write_iter: stop messing with ppos
  udf_file_write_iter: reorder and simplify
  fuse: ->direct_IO() doesn't need generic_write_checks()
  ext4_file_write_iter: move generic_write_checks() up
  xfs_file_aio_write_checks: switch to iocb/iov_iter
  generic_write_checks(): drop isblk argument
  blkdev_write_iter: expand generic_file_checks() call in there
  ...
2015-04-16 23:27:56 -04:00
Linus Torvalds eea3a00264 Merge branch 'akpm' (patches from Andrew)
Merge second patchbomb from Andrew Morton:

 - the rest of MM

 - various misc bits

 - add ability to run /sbin/reboot at reboot time

 - printk/vsprintf changes

 - fiddle with seq_printf() return value

* akpm: (114 commits)
  parisc: remove use of seq_printf return value
  lru_cache: remove use of seq_printf return value
  tracing: remove use of seq_printf return value
  cgroup: remove use of seq_printf return value
  proc: remove use of seq_printf return value
  s390: remove use of seq_printf return value
  cris fasttimer: remove use of seq_printf return value
  cris: remove use of seq_printf return value
  openrisc: remove use of seq_printf return value
  ARM: plat-pxa: remove use of seq_printf return value
  nios2: cpuinfo: remove use of seq_printf return value
  microblaze: mb: remove use of seq_printf return value
  ipc: remove use of seq_printf return value
  rtc: remove use of seq_printf return value
  power: wakeup: remove use of seq_printf return value
  x86: mtrr: if: remove use of seq_printf return value
  linux/bitmap.h: improve BITMAP_{LAST,FIRST}_WORD_MASK
  MAINTAINERS: CREDITS: remove Stefano Brivio from B43
  .mailmap: add Ricardo Ribalda
  CREDITS: add Ricardo Ribalda Delgado
  ...
2015-04-15 16:39:15 -07:00
Iulia Manda 2813893f8b kernel: conditionally support non-root users, groups and capabilities
There are a lot of embedded systems that run most or all of their
functionality in init, running as root:root.  For these systems,
supporting multiple users is not necessary.

This patch adds a new symbol, CONFIG_MULTIUSER, that makes support for
non-root users, non-root groups, and capabilities optional.  It is enabled
under CONFIG_EXPERT menu.

When this symbol is not defined, UID and GID are zero in any possible case
and processes always have all capabilities.

The following syscalls are compiled out: setuid, setregid, setgid,
setreuid, setresuid, getresuid, setresgid, getresgid, setgroups,
getgroups, setfsuid, setfsgid, capget, capset.

Also, groups.c is compiled out completely.

In kernel/capability.c, capable function was moved in order to avoid
adding two ifdef blocks.

This change saves about 25 KB on a defconfig build.  The most minimal
kernels have total text sizes in the high hundreds of kB rather than
low MB.  (The 25k goes down a bit with allnoconfig, but not that much.

The kernel was booted in Qemu.  All the common functionalities work.
Adding users/groups is not possible, failing with -ENOSYS.

Bloat-o-meter output:
add/remove: 7/87 grow/shrink: 19/397 up/down: 1675/-26325 (-24650)

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Iulia Manda <iulia.manda21@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Tested-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-04-15 16:35:22 -07:00
Linus Torvalds fa927894bb Merge branch 'for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull second vfs update from Al Viro:
 "Now that net-next went in...  Here's the next big chunk - killing
  ->aio_read() and ->aio_write().

  There'll be one more pile today (direct_IO changes and
  generic_write_checks() cleanups/fixes), but I'd prefer to keep that
  one separate"

* 'for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (37 commits)
  ->aio_read and ->aio_write removed
  pcm: another weird API abuse
  infinibad: weird APIs switched to ->write_iter()
  kill do_sync_read/do_sync_write
  fuse: use iov_iter_get_pages() for non-splice path
  fuse: switch to ->read_iter/->write_iter
  switch drivers/char/mem.c to ->read_iter/->write_iter
  make new_sync_{read,write}() static
  coredump: accept any write method
  switch /dev/loop to vfs_iter_write()
  serial2002: switch to __vfs_read/__vfs_write
  ashmem: use __vfs_read()
  export __vfs_read()
  autofs: switch to __vfs_write()
  new helper: __vfs_write()
  switch hugetlbfs to ->read_iter()
  coda: switch to ->read_iter/->write_iter
  ncpfs: switch to ->read_iter/->write_iter
  net/9p: remove (now-)unused helpers
  p9_client_attach(): set fid->uid correctly
  ...
2015-04-15 13:22:56 -07:00
David Howells 2b0143b5c9 VFS: normal filesystems (and lustre): d_inode() annotations
that's the bulk of filesystem drivers dealing with inodes of their own

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-15 15:06:57 -04:00
Konstantin Khlebnikov b9ea25152e page_writeback: clean up mess around cancel_dirty_page()
This patch replaces cancel_dirty_page() with a helper function
account_page_cleaned() which only updates counters.  It's called from
truncate_complete_page() and from try_to_free_buffers() (hack for ext3).
Page is locked in both cases, page-lock protects against concurrent
dirtiers: see commit 2d6d7f9828 ("mm: protect set_page_dirty() from
ongoing truncation").

Delete_from_page_cache() shouldn't be called for dirty pages, they must
be handled by caller (either written or truncated).  This patch treats
final dirty accounting fixup at the end of __delete_from_page_cache() as
a debug check and adds WARN_ON_ONCE() around it.  If something removes
dirty pages without proper handling that might be a bug and unwritten
data might be lost.

Hugetlbfs has no dirty pages accounting, ClearPageDirty() is enough
here.

cancel_dirty_page() in nfs_wb_page_cancel() is redundant.  This is
helper for nfs_invalidate_page() and it's called only in case complete
invalidation.

The mess was started in v2.6.20 after commits 46d2277c79 ("Clean up
and make try_to_free_buffers() not race with dirty pages") and
3e67c0987d ("truncate: clear page dirtiness before running
try_to_free_buffers()") first was reverted right in v2.6.20 in commit
ecdfc9787f ("Resurrect 'try_to_free_buffers()' VM hackery"), second in
v2.6.25 commit a2b345642f ("Fix dirty page accounting leak with ext3
data=journal").

Custom fixes were introduced between these points.  NFS in v2.6.23, commit
1b3b4a1a2d ("NFS: Fix a write request leak in nfs_invalidate_page()").
Kludge in __delete_from_page_cache() in v2.6.24, commit 3a6927906f ("Do
dirty page accounting when removing a page from the page cache").  Since
v2.6.25 all of them are redundant.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Cc: Tejun Heo <tj@kernel.org>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-04-14 16:49:01 -07:00
Omar Sandoval 22c6186ece direct_IO: remove rw from a_ops->direct_IO()
Now that no one is using rw, remove it completely.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11 22:29:45 -04:00
Omar Sandoval 6f67376318 direct_IO: use iov_iter_rw() instead of rw everywhere
The rw parameter to direct_IO is redundant with iov_iter->type, and
treated slightly differently just about everywhere it's used: some users
do rw & WRITE, and others do rw == WRITE where they should be doing a
bitwise check. Simplify this with the new iov_iter_rw() helper, which
always returns either READ or WRITE.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11 22:29:45 -04:00
Al Viro 5d5d568975 make new_sync_{read,write}() static
All places outside of core VFS that checked ->read and ->write for being NULL or
called the methods directly are gone now, so NULL {read,write} with non-NULL
{read,write}_iter will do the right thing in all cases.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11 22:29:40 -04:00
Al Viro 23602adfee lustre: kill unused members of struct vvp_thread_info
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11 22:27:54 -04:00
Amaury.Bouchra.Pilet@ENS.fr f9541f8239 staging: lustre: orthography & coding style
Orthography and coding style corrections.

Signed-off-by: Amaury Bouchra Pilet <Amaury.Bouchra.Pilet@ENS.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-05 18:43:35 +02:00
Julia Lawall a18ac314eb staging: lustre: lnet: lnet: fix error return code
Return a negative error code on failure.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
identifier ret; expression e1,e2;
@@
(
if (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-05 18:43:29 +02:00
Tal Shorer b183c11217 staging: lustre: fix sparse warning
Sparse reports:

drivers/staging/lustre/lustre/obdclass/obd_mount.c:1284:6: warning:
 symbol 'lustre_kill_super' was not declared. Should it be static?

Fix this warning by making lustre_kill_super static.
It is not used outside this file.

Signed-off-by: Tal Shorer <tal.shorer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-05 18:43:28 +02:00
Greg Kroah-Hartman 7928848997 Merge lustre patches based on 4.0-rc5 into staging-testing
This is done to handle some lustre patches that were made against the
wrong kernel branch, which was my fault, as I gave a lecture where I
messed things up for the students, it wasn't their fault.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 12:56:21 +02:00
Guillaume Matheron 7a3888a3ad Staging: lustre: o2iblnd.c: Finished cleaning code style
I fixed lines over 80 characters and unnecessary returns

Signed-off-by: Guillaume Matheron <guillaume.matheron@ens.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 12:43:59 +02:00
Guillaume Matheron 6fe7f9624d Staging: lustre: o2iblnd_cb.c: Removed the rest of unnecessary spaces before parenthesis
I removed all the 'unneeded space' warnings given by checkpatch.pl

Signed-off-by: Guillaume Matheron <guillaume.matheron@ens.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 12:43:59 +02:00
Guillaume Matheron febe73bdab Staging: lustre: o2iblnd.c: Started fixing coding style
I focused on function declarations (placed return type on the same line
as function name), and spaces between function name and parenthesis

Signed-off-by: Guillaume Matheron <guillaume.matheron@ens.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 12:43:24 +02:00
Georges-Axel Jaloyan 9fb186cf69 Staging: Lustre: rw26.c: include according to checkpatch.pl
Signed-off-by: Georges-Axel Jaloyan <georges-axel.jaloyan@ens.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 12:42:23 +02:00
Cyrille Ruggero acc59a8b93 Staging: lustre: dir.c: adding a blank after a declaration.
Adding a blank in this file after a declaration as reported by checkpatch.pl.

Signed-off-by: Cyrille Ruggero <cyrille.ruggero@ens.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 12:41:32 +02:00
Luca Wehrstedt 21c25a9ff8 Staging: lustre: lov_io.c: remove useless unary pluses
Replace two occurrences of "+1" with simply "1".

Signed-off-by: Luca Wehrstedt <luca.wehrstedt@ens.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 12:35:28 +02:00
Gwendoline Chouasne-Guillon 0b0033a15f Staging: lustre: o2iblnd_modparam.c: remove unneeded space
before the arguments of a function

Remove unneeded space before the arguments of a function

Signed_off_by: Gwendoline Chouasne-guillon <chouasne@ens.fr>

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 12:31:34 +02:00
Guillaume Matheron af967b29c8 Staging: lustre: o2iblnd_cb.c: Removed a bunch of spaces before parenthesis
Fixed warnings as reported by checkpatch.pl
Also fixed padding before function arguments when needed

Signed-off-by: Guillaume Matheron <guillaume.matheron@ens.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 12:31:34 +02:00
Rafaël Bocquet e416a89321 Staging: lustre: config.c: fix a "do not add new typedefs" warning reported by checkpatch.pl
Signed-off-by: Rafaël Bocquet <rafael.bocquet@ens.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 12:23:00 +02:00
Rafaël Bocquet 3a338e2014 Staging: lustre: config.c: fix lines exceeding 80 characters reported by checkpatch.pl
Signed-off-by: Rafaël Bocquet <rafael.bocquet@ens.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 12:23:00 +02:00
Martin Vassor 07eb422db4 Staging: lustre: lib-md.c format line too long
Format comment such that it is under 80 chars

Signed-off-by: Martin Vassor <martin.vassor@epfl.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 11:22:07 +02:00
Aya Mahfouz 659dc3417e staging: lustre: include: remove unused macros
OBD_CHECK_DEV and OBD_CHECK_DEV_ACTIVE have been replaced by static
inline functions. They are removed since they are not used anymore.

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 11:18:14 +02:00
Aya Mahfouz f36b6553e0 staging: lustre: include: replace OBD_CHECK_DEV_ACTIVE by obd_check_dev_active
Static inline functions are preferred over macros. The inline function
obd_check_dev_active is introduced to replace OBD_CHECK_DEV_ACTIVE.
All functions that call obd_check_dev_active store the return values
and return them if they represent an error code.

Some of the changes were carried out manually while others were done
using coccinelle.

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 11:18:14 +02:00
Aya Mahfouz 4ca1b8fbe6 staging: lustre: include: replace OBD_CHECK_DEV by obd_check_dev
Static inline functions are preferred over macros. Hence, the function
obd_check_dev was introduced. obd_check_dev replaces the macro
OBD_CHECK_DEV. All functions that call obd_check_dev store the return
values and return them if they represent an error code.

Some of the changes were carried out manually while others were done
using coccinelle.

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 11:18:13 +02:00
Théotime Grohens a18dd4702c Staging: lustre: lnet: selftest: lconctl.c: fixed indentation of the switch
Signed-off-by: Théotime Grohens <theotime.grohens@ens.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 11:15:44 +02:00
Greg Kroah-Hartman c209069e9b Staging: lustre: module.c: remove unneeded return statement
Remove an unneeded return statement in this file as reported by
checkpatch.pl.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 11:12:17 +02:00
Dan Carpenter 005b23d6b6 staging: lustre: prevent underflows in lnet_parse_reply()
I don't know if "hdr->payload_length;" can really be negative, but if so
then we shouldn't allow it.  Do the comparison as an unsigned.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 11:07:33 +02:00
Dan Carpenter faec8ab42b Staging: lustre: integer overflow in ioctl
hdr->ioc_len is a user controlled u32 so the addition can overflow,
especially on 32 bit systems.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 11:07:33 +02:00
Achille Aknin b311ebac5b Staging: lustre: brw_test.c: remove unneeded return statement
Remove an unneeded return statement in this file

Signed-off-by: Achille Aknin <achille.aknin@ens.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 11:07:31 +02:00
Auguste Olivry e9ab674e23 staging: lustre: ping_test.c : remove space after function names
remove space between function names and open parentheses as reported by
checkpatch.pl.

Signed-off-by: Auguste Olivry <auguste.olivry@ens.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-02 17:11:18 +02:00
Luca Wehrstedt 822aa3e22f Staging: lustre: lov_io.c: remove useless unary pluses
Replace two occurrences of "+1" with simply "1".

Signed-off-by: Luca Wehrstedt <luca.wehrstedt@ens.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-02 16:58:04 +02:00
Darshana Padmadas 4b80af40eb Staging: lustre: Mark internal functions static in llog_cat.c
This patch marks functions llog_cat_set_first_idx and cat_cancel_cb
static as these are used only within this file. Also since cat_cancel_cb
is made static do not export it.

This eliminates the following sparse warning:
warning: symbol * was not declared. Should it be static?

Signed-off-by: Darshana Padmadas <darshanapadmadas@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-01 17:35:46 +02:00
Darshana Padmadas 0bf31f075c Staging: lustre: Mark internal functions as static
This patch makes functions mgc_logname2resid, mgc_set_info_async
and mgc_init static as these are only used internally.

This also eliminates sparse warnings of the type:
warning: symbol * was not declared. Should it be static?

Signed-off-by: Darshana Padmadas <darshanapadmadas@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-01 17:35:46 +02:00
Darshana Padmadas 171aee168e Staging: lustre: Include header file that declares lprocfs_mdc_init_vars
This patch includes the header file mdc_internal.h that declares the
function lprocfs_mdc_init_vars.

This also eliminates the sparse warning:
warning: symbol 'lprocfs_mdc_init_vars' was not declared. Should it be static?

Signed-off-by: Darshana Padmadas <darshanapadmadas@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-01 17:33:56 +02:00
Darshana Padmadas b5edcf2f86 Staging: lustre: Include header for functions prototypes
This patch includes the header lustre/include/lclient.h that declares
the functions lov_lsm_put and lov_read_and_clear_async_rc defined in
lov_object.c.

This eliminates warnings reported by sparse:
warning: symbol was not declared. Should it be static?

Signed-off-by: Darshana Padmadas <darshanapadmadas@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-01 17:33:56 +02:00
Darshana Padmadas 80e177380b Staging: lustre: Add header that declares function lprocfs_lmv_init_vars
This patch includes the header file lmv_internal.h that declares
the function lprocfs_lmv_init_vars defined in lproc_lmv.c.

This eliminates the sparse warning:
warning: symbol 'lprocfs_lmv_init_vars' was not declared. Should it be static?

Signed-off-by: Darshana Padmadas <darshanapadmadas@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-01 17:33:56 +02:00
Darshana Padmadas 132eacb7fb Staging: lustre: Make obd_proc_version_seq_show static
The function obd_proc_version_seq_show is only used in this
file, so make it static.

This eliminates the following sparse warning:
warning: symbol 'obd_proc_version_seq_show' was not declared. Should it be static?

Signed-off-by: Darshana Padmadas <darshanapadmadas@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-01 17:33:56 +02:00
Darshana Padmadas 967db076bd Staging: lustre: Add function prototypes in console.h
Sparse reported the following warnings:
warning: symbol 'lstcon_console_init' was not declared. Should it be static?
warning: symbol 'lstcon_console_fini' was not declared. Should it be static?
warning: symbol 'lstcon_ioctl_entry' was not declared. Should it be static?

However since these functions are used in other files,
they cannot be made static, so add protoypes for the same in console.h.

Signed-off-by: Darshana Padmadas <darshanapadmadas@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-01 17:30:52 +02:00
Lai Siyao d6abc59ec8 staging/lustre/xattr: xattr data may be gone with lock held
Xattr cached data may be gone, but lock still held, in this case,
refetch xattr from server, otherwise client will return error.

Signed-off-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-on: http://review.whamcloud.com/12952
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3544
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 11:11:44 +01:00
Niu Yawei 3ce08cd7a2 staging/lustre: update timestamps after buiding rpc
The mtime/atime/ctime in the write RPC has to be updated after
the RPC is built (where xid is generated), otherwise, it could
race with the setattr and updating wrong timestamps on OST side.

Seems this regression was introduced when landing clio code.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-on: http://review.whamcloud.com/13261
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5951
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 11:11:44 +01:00
Li Dongyang a915ffda19 staging/lustre/llite: glimpse the inode before doing fiemap
For a new inode, the i_size is 0 until a stat, which will yield
an empty fiemap result.
Fix the issue by glimpsing the size before doing fiemap.

Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-on: http://review.whamcloud.com/13439
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6091
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 11:11:44 +01:00
Andriy Skulysh 502cb58e21 staging/lustre/ptlrpc: fix import state during replay
Client doesn't restore import state correctly
on reconnect during replay. It resends lock replay
when final ping was queued by server.
Server fails with "target_queue_recovery_request())
ASSERTION( req->rq_export->exp_lock_replay_needed ) failed"

Add imp_replay_state to store last replay state.
imp_state is restored from imp_replay_state
during reconnect.

Signed-off-by: Andriy Skulysh <Andriy_Skulysh@xyratex.com>
Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Xyratex-bug-id: MRP-2022
Reviewed-on: http://review.whamcloud.com/12163
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5651
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 11:11:15 +01:00
Yang Sheng 397632e467 staging/lustre/lov: don't crash accessing LOV object with FID{0, 0}
Some object maybe has a corrupted LOV EA or a hole in
LOV EA. We should not crash client in such case.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Signed-off-by: Yang Sheng <yang.sheng@intel.com>
Reviewed-on: http://review.whamcloud.com/12740
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4958
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 11:10:25 +01:00
Bobi Jam 4345abb2c3 staging/lustre/mgc: detach MGC dev on error
lustre_start_mgc() creates MGC device, if error happens later on
ll_fill_super(), this device is still attached, and later mount
fails by keep complaining that the MGC device's already in the
client node.

It turns out that the device was referenced by mgc config llog data
which is arranged in the mgc lock requeue thread re-trying to get its
mgc lock, and in normal case, this llog reference only released in
mgc_blocking_ast() when the system is umount.

This patch make mgc_precleanup() to wake up requeue thread to handle
the config llog data.

This patch also makes mgc_setup() wait for mgc_requeue_thread() start
before moving on.

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Reviewed-on: http://review.whamcloud.com/11765
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4943
Reviewed-by: Ryan Haasken <haasken@cray.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 11:10:24 +01:00
Hongchao Zhang 1c8aa54aaf staging/lustre/mgc: check the import stat for lprocfs
in lprocfs_mgc_rd_ir_state, the import state should be checked
the validity before doing further work.

Signed-off-by: Hongchao Zhang <hongchao.zhang@intel.com>
Reviewed-on: http://review.whamcloud.com/12896
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5650
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 11:10:24 +01:00