linux-next: manual merge of the akpm tree with the vfs tree

2020-05-15 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the akpm tree got conflicts in:

  arch/alpha/kernel/syscalls/syscall.tbl
  arch/arm/tools/syscall.tbl
  arch/arm64/include/asm/unistd.h
  arch/arm64/include/asm/unistd32.h
  arch/ia64/kernel/syscalls/syscall.tbl
  arch/m68k/kernel/syscalls/syscall.tbl
  arch/microblaze/kernel/syscalls/syscall.tbl
  arch/mips/kernel/syscalls/syscall_n32.tbl
  arch/mips/kernel/syscalls/syscall_n64.tbl
  arch/parisc/kernel/syscalls/syscall.tbl
  arch/powerpc/kernel/syscalls/syscall.tbl
  arch/s390/kernel/syscalls/syscall.tbl
  arch/sh/kernel/syscalls/syscall.tbl
  arch/sparc/kernel/syscalls/syscall.tbl
  arch/x86/entry/syscalls/syscall_32.tbl
  arch/x86/entry/syscalls/syscall_64.tbl
  arch/xtensa/kernel/syscalls/syscall.tbl
  include/uapi/asm-generic/unistd.h

between commit:

  c8ffd8bcdd28 ("vfs: add faccessat2 syscall")

from the vfs tree and commit:

  b9b2aed54678 ("mm/madvise: introduce process_madvise() syscall: an external 
memory hinting API")

from the akpm tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc arch/alpha/kernel/syscalls/syscall.tbl
index 598779a35e49,de8334404d5c..
--- a/arch/alpha/kernel/syscalls/syscall.tbl
+++ b/arch/alpha/kernel/syscalls/syscall.tbl
@@@ -477,7 -477,7 +477,8 @@@
  # 545 reserved for clone3
  547   common  openat2 sys_openat2
  548   common  pidfd_getfd sys_pidfd_getfd
 -549   common  watch_mount sys_watch_mount
 -550   common  watch_sbsys_watch_sb
 -551   common  fsinfo  sys_fsinfo
 -552   common  process_madvise sys_process_madvise
 +549   common  faccessat2  sys_faccessat2
 +550   common  watch_mount sys_watch_mount
 +551   common  watch_sbsys_watch_sb
 +552   common  fsinfo  sys_fsinfo
++553   common  process_madvise sys_process_madvise
diff --cc arch/arm/tools/syscall.tbl
index 7dd5907463ef,c7a6d0a7f718..
--- a/arch/arm/tools/syscall.tbl
+++ b/arch/arm/tools/syscall.tbl
@@@ -451,7 -451,7 +451,8 @@@
  435   common  clone3  sys_clone3
  437   common  openat2 sys_openat2
  438   common  pidfd_getfd sys_pidfd_getfd
 -439   common  watch_mount sys_watch_mount
 -440   common  watch_sbsys_watch_sb
 -441   common  fsinfo  sys_fsinfo
 -442   common  process_madvise sys_process_madvise
 +439   common  faccessat2  sys_faccessat2
 +440   common  watch_mount sys_watch_mount
 +441   common  watch_sbsys_watch_sb
 +442   common  fsinfo  sys_fsinfo
++443   common  process_madvise sys_process_madvise
diff --cc arch/ia64/kernel/syscalls/syscall.tbl
index 457270289902,f256946d6396..
--- a/arch/ia64/kernel/syscalls/syscall.tbl
+++ b/arch/ia64/kernel/syscalls/syscall.tbl
@@@ -358,7 -358,7 +358,8 @@@
  # 435 reserved for clone3
  437   common  openat2 sys_openat2
  438   common  pidfd_getfd sys_pidfd_getfd
 -439   common  watch_mount sys_watch_mount
 -440   common  watch_sbsys_watch_sb
 -441   common  fsinfo  sys_fsinfo
 -442   common  process_madvise sys_process_madvise
 +439   common  faccessat2  sys_faccessat2
 +440   common  watch_mount sys_watch_mount
 +441   common  watch_sbsys_watch_sb
 +442   common  fsinfo  sys_fsinfo
++443   common  process_madvise sys_process_madvise
diff --cc arch/m68k/kernel/syscalls/syscall.tbl
index 86872b908471,01d17f551e44..
--- a/arch/m68k/kernel/syscalls/syscall.tbl
+++ b/arch/m68k/kernel/syscalls/syscall.tbl
@@@ -437,7 -437,7 +437,8 @@@
  435   common  clone3  __sys_clone3
  437   common  openat2 sys_openat2
  438   common  pidfd_getfd sys_pidfd_getfd
 -439   common  watch_mount sys_watch_mount
 -440   common  watch_sbsys_watch_sb
 -441   common  fsinfo  sys_fsinfo
 -442   common  process_madvise sys_process_madvise
 +439   common  faccessat2  sys_faccessat2
 +440   common  watch_mount sys_watch_mount
 +441   common  watch_sb  

linux-next: manual merge of the akpm tree with the vfs tree

2019-04-11 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the akpm tree got a conflict in:

  fs/block_dev.c

between commit:

  6d46d2934aea ("fs/block_dev.c: remove unused include")

from the vfs tree and patch:

  "fs/block_dev.c: Remove duplicate header"

from the akpm tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/block_dev.c
index 6b584817d461,bc80d165f0c0..
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@@ -29,7 -29,7 +29,6 @@@
  #include 
  #include 
  #include 
- #include 
 -#include 
  #include 
  #include 
  #include 


pgpi03fA89Olp.pgp
Description: OpenPGP digital signature


linux-next: manual merge of the akpm tree with the vfs tree

2018-05-17 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the akpm-current tree got a conflict in:

  mm/vmalloc.c

between commits:

  fddda2b7b521 ("proc: introduce proc_create_seq{,_data}")
  44414d82cfe0 ("proc: introduce proc_create_seq_private")

from the vfs tree and patch:

  "mm: use octal not symbolic permissions"

from the akpm tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc mm/vmalloc.c
index 89efac3a020e,abf54a3e71e6..
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@@ -2738,14 -2738,25 +2738,14 @@@ static const struct seq_operations vmal
.show = s_show,
  };
  
 -static int vmalloc_open(struct inode *inode, struct file *file)
 +static int __init proc_vmalloc_init(void)
  {
if (IS_ENABLED(CONFIG_NUMA))
-   proc_create_seq_private("vmallocinfo", S_IRUSR, NULL,
 -  return seq_open_private(file, _op,
 -  nr_node_ids * sizeof(unsigned int));
++  proc_create_seq_private("vmallocinfo", 0400, NULL,
 +  _op,
 +  nr_node_ids * sizeof(unsigned int), NULL);
else
-   proc_create_seq("vmallocinfo", S_IRUSR, NULL, _op);
 -  return seq_open(file, _op);
 -}
 -
 -static const struct file_operations proc_vmalloc_operations = {
 -  .open   = vmalloc_open,
 -  .read   = seq_read,
 -  .llseek = seq_lseek,
 -  .release= seq_release_private,
 -};
 -
 -static int __init proc_vmalloc_init(void)
 -{
 -  proc_create("vmallocinfo", 0400, NULL, _vmalloc_operations);
++  proc_create_seq("vmallocinfo", 0400, NULL, _op);
return 0;
  }
  module_init(proc_vmalloc_init);


pgpea3Lagh660.pgp
Description: OpenPGP digital signature


linux-next: manual merge of the akpm tree with the vfs tree

2018-05-17 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the akpm-current tree got a conflict in:

  mm/vmalloc.c

between commits:

  fddda2b7b521 ("proc: introduce proc_create_seq{,_data}")
  44414d82cfe0 ("proc: introduce proc_create_seq_private")

from the vfs tree and patch:

  "mm: use octal not symbolic permissions"

from the akpm tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc mm/vmalloc.c
index 89efac3a020e,abf54a3e71e6..
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@@ -2738,14 -2738,25 +2738,14 @@@ static const struct seq_operations vmal
.show = s_show,
  };
  
 -static int vmalloc_open(struct inode *inode, struct file *file)
 +static int __init proc_vmalloc_init(void)
  {
if (IS_ENABLED(CONFIG_NUMA))
-   proc_create_seq_private("vmallocinfo", S_IRUSR, NULL,
 -  return seq_open_private(file, _op,
 -  nr_node_ids * sizeof(unsigned int));
++  proc_create_seq_private("vmallocinfo", 0400, NULL,
 +  _op,
 +  nr_node_ids * sizeof(unsigned int), NULL);
else
-   proc_create_seq("vmallocinfo", S_IRUSR, NULL, _op);
 -  return seq_open(file, _op);
 -}
 -
 -static const struct file_operations proc_vmalloc_operations = {
 -  .open   = vmalloc_open,
 -  .read   = seq_read,
 -  .llseek = seq_lseek,
 -  .release= seq_release_private,
 -};
 -
 -static int __init proc_vmalloc_init(void)
 -{
 -  proc_create("vmallocinfo", 0400, NULL, _vmalloc_operations);
++  proc_create_seq("vmallocinfo", 0400, NULL, _op);
return 0;
  }
  module_init(proc_vmalloc_init);


pgpea3Lagh660.pgp
Description: OpenPGP digital signature


linux-next: manual merge of the akpm tree with the vfs tree

2018-01-01 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in:

  ipc/mqueue.c

between commits:

  3ec41d6c2257 ("tidy do_mq_open() up a bit")
  946086abeddf ("mqueue: switch to on-demand creation of internal mount")

from the vfs tree and patch:

  "ipc, mqueue: lazy call kern_mount_data in new namespaces"

from the akpm tree.

I fixed it up (I could not see how to fix this obviously, so I just
dropped the akpm tree patch) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell


linux-next: manual merge of the akpm tree with the vfs tree

2018-01-01 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in:

  ipc/mqueue.c

between commits:

  3ec41d6c2257 ("tidy do_mq_open() up a bit")
  946086abeddf ("mqueue: switch to on-demand creation of internal mount")

from the vfs tree and patch:

  "ipc, mqueue: lazy call kern_mount_data in new namespaces"

from the akpm tree.

I fixed it up (I could not see how to fix this obviously, so I just
dropped the akpm tree patch) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell


Re: linux-next: manual merge of the akpm tree with the vfs tree

2016-12-12 Thread Ian Kent
On Mon, 2016-12-12 at 16:52 +1100, Stephen Rothwell wrote:
> Hi all,
> 
> Al let me know that he had put a newer version of the autofs patches
> into his vfs tree, so I have dropped the following patches from the akpm
> tree today:
> 
>   vfs: change d_manage() to take a struct path
>   vfs: add path_is_mountpoint() helper
>   vfs: fix boolreturn.cocci warnings
>   vfs: add path_has_submounts()
>   autofs: change autofs4_expire_wait() to take struct path
>   autofs: change autofs4_wait() to take struct path
>   autofs: use path_is_mountpoint() to fix unreliable d_mountpoint() checks
>   autofs: use path_has_submounts() to fix unreliable have_submount() checks
>   vfs: remove unused have_submounts() function
>   vfs: merge path_is_mountpoint() and path_is_mountpoint_rcu()
>   autofs: make struct path const in autofs4_dir_open()
>   autofs: change struct path to const in autofs4_expire_wait() and
> autofs4_wait()
>   vfs: change struct path to const in d_manage()
>   vfs: constify path parameter of path_has_submounts()
>   autofs: don't hold spinlock over direct mount expire
>   vfs: make may_umount_tree() mount propagation aware
>   vfs-make-may_umount_tree-mount-propogation-aware-checkpatch-fixes
> 
> I hope that was the correct ones.

Hi Stephen,

Yes, Al merged a number of the patches, fixed a couple of problems, and rejected
one which I'm still working on.

The list looks right to me.
That's great, thanks,
Ian


Re: linux-next: manual merge of the akpm tree with the vfs tree

2016-12-12 Thread Ian Kent
On Mon, 2016-12-12 at 16:52 +1100, Stephen Rothwell wrote:
> Hi all,
> 
> Al let me know that he had put a newer version of the autofs patches
> into his vfs tree, so I have dropped the following patches from the akpm
> tree today:
> 
>   vfs: change d_manage() to take a struct path
>   vfs: add path_is_mountpoint() helper
>   vfs: fix boolreturn.cocci warnings
>   vfs: add path_has_submounts()
>   autofs: change autofs4_expire_wait() to take struct path
>   autofs: change autofs4_wait() to take struct path
>   autofs: use path_is_mountpoint() to fix unreliable d_mountpoint() checks
>   autofs: use path_has_submounts() to fix unreliable have_submount() checks
>   vfs: remove unused have_submounts() function
>   vfs: merge path_is_mountpoint() and path_is_mountpoint_rcu()
>   autofs: make struct path const in autofs4_dir_open()
>   autofs: change struct path to const in autofs4_expire_wait() and
> autofs4_wait()
>   vfs: change struct path to const in d_manage()
>   vfs: constify path parameter of path_has_submounts()
>   autofs: don't hold spinlock over direct mount expire
>   vfs: make may_umount_tree() mount propagation aware
>   vfs-make-may_umount_tree-mount-propogation-aware-checkpatch-fixes
> 
> I hope that was the correct ones.

Hi Stephen,

Yes, Al merged a number of the patches, fixed a couple of problems, and rejected
one which I'm still working on.

The list looks right to me.
That's great, thanks,
Ian


linux-next: manual merge of the akpm tree with the vfs tree

2016-12-11 Thread Stephen Rothwell
Hi all,

Al let me know that he had put a newer version of the autofs patches
into his vfs tree, so I have dropped the following patches from the akpm
tree today:

  vfs: change d_manage() to take a struct path
  vfs: add path_is_mountpoint() helper
  vfs: fix boolreturn.cocci warnings
  vfs: add path_has_submounts()
  autofs: change autofs4_expire_wait() to take struct path
  autofs: change autofs4_wait() to take struct path
  autofs: use path_is_mountpoint() to fix unreliable d_mountpoint() checks
  autofs: use path_has_submounts() to fix unreliable have_submount() checks
  vfs: remove unused have_submounts() function
  vfs: merge path_is_mountpoint() and path_is_mountpoint_rcu()
  autofs: make struct path const in autofs4_dir_open()
  autofs: change struct path to const in autofs4_expire_wait() and 
autofs4_wait()
  vfs: change struct path to const in d_manage()
  vfs: constify path parameter of path_has_submounts()
  autofs: don't hold spinlock over direct mount expire
  vfs: make may_umount_tree() mount propagation aware
  vfs-make-may_umount_tree-mount-propogation-aware-checkpatch-fixes

I hope that was the correct ones.
-- 
Cheers,
Stephen Rothwell


linux-next: manual merge of the akpm tree with the vfs tree

2016-12-11 Thread Stephen Rothwell
Hi all,

Al let me know that he had put a newer version of the autofs patches
into his vfs tree, so I have dropped the following patches from the akpm
tree today:

  vfs: change d_manage() to take a struct path
  vfs: add path_is_mountpoint() helper
  vfs: fix boolreturn.cocci warnings
  vfs: add path_has_submounts()
  autofs: change autofs4_expire_wait() to take struct path
  autofs: change autofs4_wait() to take struct path
  autofs: use path_is_mountpoint() to fix unreliable d_mountpoint() checks
  autofs: use path_has_submounts() to fix unreliable have_submount() checks
  vfs: remove unused have_submounts() function
  vfs: merge path_is_mountpoint() and path_is_mountpoint_rcu()
  autofs: make struct path const in autofs4_dir_open()
  autofs: change struct path to const in autofs4_expire_wait() and 
autofs4_wait()
  vfs: change struct path to const in d_manage()
  vfs: constify path parameter of path_has_submounts()
  autofs: don't hold spinlock over direct mount expire
  vfs: make may_umount_tree() mount propagation aware
  vfs-make-may_umount_tree-mount-propogation-aware-checkpatch-fixes

I hope that was the correct ones.
-- 
Cheers,
Stephen Rothwell


linux-next: manual merge of the akpm tree with the vfs tree

2014-08-08 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in
include/linux/fs.h between commit ed44724b79d8 ("acct: switch to
__kernel_write()") from the vfs tree and commit "fs.h: remove
unnecessary extern prototypes" from the akpm tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc include/linux/fs.h
index 94187721ad41,dccf4bcc21bb..
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@@ -2357,16 -2356,15 +2357,16 @@@ static inline void i_readcount_inc(stru
return;
  }
  #endif
- extern int do_pipe_flags(int *, int);
+ int do_pipe_flags(int *, int);
  
- extern int kernel_read(struct file *, loff_t, char *, unsigned long);
- extern ssize_t kernel_write(struct file *, const char *, size_t, loff_t);
- extern ssize_t __kernel_write(struct file *, const char *, size_t, loff_t *);
- extern struct file * open_exec(const char *);
+ int kernel_read(struct file *, loff_t, char *, unsigned long);
+ ssize_t kernel_write(struct file *, const char *, size_t, loff_t);
++ssize_t __kernel_write(struct file *, const char *, size_t, loff_t *);
+ struct file * open_exec(const char *);
   
  /* fs/dcache.c -- generic fs support functions */
- extern int is_subdir(struct dentry *, struct dentry *);
- extern int path_is_under(struct path *, struct path *);
+ int is_subdir(struct dentry *, struct dentry *);
+ int path_is_under(struct path *, struct path *);
  
  #include 
  


signature.asc
Description: PGP signature


linux-next: manual merge of the akpm tree with the vfs tree

2014-08-08 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in
include/linux/fs.h between commit ed44724b79d8 (acct: switch to
__kernel_write()) from the vfs tree and commit fs.h: remove
unnecessary extern prototypes from the akpm tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc include/linux/fs.h
index 94187721ad41,dccf4bcc21bb..
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@@ -2357,16 -2356,15 +2357,16 @@@ static inline void i_readcount_inc(stru
return;
  }
  #endif
- extern int do_pipe_flags(int *, int);
+ int do_pipe_flags(int *, int);
  
- extern int kernel_read(struct file *, loff_t, char *, unsigned long);
- extern ssize_t kernel_write(struct file *, const char *, size_t, loff_t);
- extern ssize_t __kernel_write(struct file *, const char *, size_t, loff_t *);
- extern struct file * open_exec(const char *);
+ int kernel_read(struct file *, loff_t, char *, unsigned long);
+ ssize_t kernel_write(struct file *, const char *, size_t, loff_t);
++ssize_t __kernel_write(struct file *, const char *, size_t, loff_t *);
+ struct file * open_exec(const char *);
   
  /* fs/dcache.c -- generic fs support functions */
- extern int is_subdir(struct dentry *, struct dentry *);
- extern int path_is_under(struct path *, struct path *);
+ int is_subdir(struct dentry *, struct dentry *);
+ int path_is_under(struct path *, struct path *);
  
  #include linux/err.h
  


signature.asc
Description: PGP signature


linux-next: manual merge of the akpm tree with the vfs tree

2013-09-09 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in fs/super.c
between commit d040790391f2 ("prune_super(): sb->s_op is never NULL")
from the vfs tree and commit "fs: convert inode and dentry shrinking to
be node aware" from the akpm tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc fs/super.c
index cd3c2cd,efeabe8..000
--- a/fs/super.c
+++ b/fs/super.c
@@@ -75,11 -75,11 +75,11 @@@ static unsigned long super_cache_scan(s
if (!grab_super_passive(sb))
return SHRINK_STOP;
  
 -  if (sb->s_op && sb->s_op->nr_cached_objects)
 +  if (sb->s_op->nr_cached_objects)
-   fs_objects = sb->s_op->nr_cached_objects(sb);
+   fs_objects = sb->s_op->nr_cached_objects(sb, sc->nid);
  
-   inodes = list_lru_count(>s_inode_lru);
-   dentries = list_lru_count(>s_dentry_lru);
+   inodes = list_lru_count_node(>s_inode_lru, sc->nid);
+   dentries = list_lru_count_node(>s_dentry_lru, sc->nid);
total_objects = dentries + inodes + fs_objects + 1;
  
/* proportion the scan between the caches */


pgpM9F0WVONSa.pgp
Description: PGP signature


linux-next: manual merge of the akpm tree with the vfs tree

2013-09-09 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in fs/super.c
between commit d040790391f2 (prune_super(): sb-s_op is never NULL)
from the vfs tree and commit fs: convert inode and dentry shrinking to
be node aware from the akpm tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc fs/super.c
index cd3c2cd,efeabe8..000
--- a/fs/super.c
+++ b/fs/super.c
@@@ -75,11 -75,11 +75,11 @@@ static unsigned long super_cache_scan(s
if (!grab_super_passive(sb))
return SHRINK_STOP;
  
 -  if (sb-s_op  sb-s_op-nr_cached_objects)
 +  if (sb-s_op-nr_cached_objects)
-   fs_objects = sb-s_op-nr_cached_objects(sb);
+   fs_objects = sb-s_op-nr_cached_objects(sb, sc-nid);
  
-   inodes = list_lru_count(sb-s_inode_lru);
-   dentries = list_lru_count(sb-s_dentry_lru);
+   inodes = list_lru_count_node(sb-s_inode_lru, sc-nid);
+   dentries = list_lru_count_node(sb-s_dentry_lru, sc-nid);
total_objects = dentries + inodes + fs_objects + 1;
  
/* proportion the scan between the caches */


pgpM9F0WVONSa.pgp
Description: PGP signature


linux-next: manual merge of the akpm tree with the vfs tree

2013-09-05 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in
include/linux/fs.h between commit 7b7a8665edd8 ("direct-io: Implement
generic deferred AIO completions") from the vfs tree and commit "dcache:
convert to use new lru list infrastructure" from the akpm tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc include/linux/fs.h
index ee1a9b2,b778968..000
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@@ -1421,8 -1413,12 +1413,15 @@@ struct super_block 
/* Being remounted read-only */
int s_readonly_remount;
  
 +  /* AIO completions deferred from interrupt context */
 +  struct workqueue_struct *s_dio_done_wq;
++
+   /*
+* Keep the lru lists last in the structure so they always sit on their
+* own individual cachelines.
+*/
+   struct list_lru s_dentry_lru cacheline_aligned_in_smp;
+   struct list_lru s_inode_lru cacheline_aligned_in_smp;
  };
  
  extern struct timespec current_fs_time(struct super_block *sb);


pgp8GL30gp2H_.pgp
Description: PGP signature


linux-next: manual merge of the akpm tree with the vfs tree

2013-09-05 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in
include/linux/fs.h between commit 7b7a8665edd8 (direct-io: Implement
generic deferred AIO completions) from the vfs tree and commit dcache:
convert to use new lru list infrastructure from the akpm tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc include/linux/fs.h
index ee1a9b2,b778968..000
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@@ -1421,8 -1413,12 +1413,15 @@@ struct super_block 
/* Being remounted read-only */
int s_readonly_remount;
  
 +  /* AIO completions deferred from interrupt context */
 +  struct workqueue_struct *s_dio_done_wq;
++
+   /*
+* Keep the lru lists last in the structure so they always sit on their
+* own individual cachelines.
+*/
+   struct list_lru s_dentry_lru cacheline_aligned_in_smp;
+   struct list_lru s_inode_lru cacheline_aligned_in_smp;
  };
  
  extern struct timespec current_fs_time(struct super_block *sb);


pgp8GL30gp2H_.pgp
Description: PGP signature


linux-next: manual merge of the akpm tree with the vfs tree

2013-04-29 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in ipc/util.c
between commit 823a5ed16606 ("ipc_schedule_free() can do vfree() now")
from the vfs tree and commit "ipc: make refcounter atomic" from the akpm
tree.

I fixed it up (I hope - see below) and can carry the fix as necessary (no
action is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc ipc/util.c
index 6515f95,5e60ebd..000
--- a/ipc/util.c
+++ b/ipc/util.c
@@@ -477,7 -478,8 +477,7 @@@ void ipc_free(void* ptr, int size
   */
  struct ipc_rcu_hdr
  {
-   int refcount;
+   atomic_t refcount;
 -  int is_vmalloc;
void *data[0];
  };
  
@@@ -497,30 -516,48 +497,28 @@@ struct ipc_rcu_grac
   *@size: size desired
   *
   *Allocate memory for the rcu header structure +  the object.
-  *Returns the pointer to the object.
-  *NULL is returned if the allocation fails. 
+  *Returns the pointer to the object or NULL upon failure.
   */
-  
- void* ipc_rcu_alloc(int size)
+ void *ipc_rcu_alloc(int size)
  {
 -  void* out;
 -
 -  /*
 -   * We prepend the allocation with the rcu struct, and
 -   * workqueue if necessary (for vmalloc).
 +  size_t len = size + HDRLEN;
 +  void *out;
 +  /* 
 +   * We prepend the allocation with the rcu struct
 */
 -  if (rcu_use_vmalloc(size)) {
 -  out = vmalloc(HDRLEN_VMALLOC + size);
 -  if (!out)
 -  goto done;
 -
 -  out += HDRLEN_VMALLOC;
 -  container_of(out, struct ipc_rcu_hdr, data)->is_vmalloc = 1;
 -  } else {
 -  out = kmalloc(HDRLEN_KMALLOC + size, GFP_KERNEL);
 -  if (!out)
 -  goto done;
 -
 -  out += HDRLEN_KMALLOC;
 -  container_of(out, struct ipc_rcu_hdr, data)->is_vmalloc = 0;
 +  out = (len > PAGE_SIZE) ? vmalloc(len) : kmalloc(len, GFP_KERNEL);
 +  if (out) {
 +  out += HDRLEN;
-   container_of(out, struct ipc_rcu_hdr, data)->refcount = 1;
++  atomic_set(_of(out, struct ipc_rcu_hdr, 
data)->refcount, 1);
}
return out;
  }
  
- void ipc_rcu_getref(void *ptr)
+ int ipc_rcu_getref(void *ptr)
  {
-   container_of(ptr, struct ipc_rcu_hdr, data)->refcount++;
+   return atomic_inc_not_zero(_of(ptr, struct ipc_rcu_hdr, 
data)->refcount);
  }
  
 -static void ipc_do_vfree(struct work_struct *work)
 -{
 -  vfree(container_of(work, struct ipc_rcu_sched, work));
 -}
 -
  /**
   * ipc_schedule_free - free ipc + rcu space
   * @head: RCU callback structure for queued work
@@@ -534,10 -580,10 +532,10 @@@ static void ipc_schedule_free(struct rc
  
  void ipc_rcu_putref(void *ptr)
  {
-   if (--container_of(ptr, struct ipc_rcu_hdr, data)->refcount > 0)
+   if (!atomic_dec_and_test(_of(ptr, struct ipc_rcu_hdr, 
data)->refcount))
return;
  
 -  if (container_of(ptr, struct ipc_rcu_hdr, data)->is_vmalloc) {
 +  if (is_vmalloc_addr(ptr)) {
call_rcu(_of(ptr, struct ipc_rcu_grace, data)->rcu,
ipc_schedule_free);
} else {


pgpS4zs9SJKnv.pgp
Description: PGP signature


linux-next: manual merge of the akpm tree with the vfs tree

2013-04-29 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in ipc/msgutil.c
between commit b3ecda5869da ("proc: Split the namespace stuff out into
linux/proc_ns.h") from the vfs tree and commit "ipc/msgutil.c: use
linux/uaccess.h" from the akpm tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc ipc/msgutil.c
index a53f38f,d43439e..000
--- a/ipc/msgutil.c
+++ b/ipc/msgutil.c
@@@ -16,8 -16,8 +16,8 @@@
  #include 
  #include 
  #include 
 -#include 
 +#include 
- #include 
+ #include 
  
  #include "util.h"
  


pgpyMR8XrOo9d.pgp
Description: PGP signature


linux-next: manual merge of the akpm tree with the vfs tree

2013-04-29 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in
fs/proc/internal.h between commit 4608da4a9433 ("proc: Move non-public
stuff from linux/proc_fs.h to fs/proc/internal.h") from the vfs tree and
commit "mm, vmalloc: move get_vmalloc_info() to vmalloc.c" from the akpm
tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc fs/proc/internal.h
index 04255b6,47eac85..000
--- a/fs/proc/internal.h
+++ b/fs/proc/internal.h
@@@ -191,56 -157,36 +191,35 @@@ static inline struct proc_dir_entry *pd
atomic_inc(>count);
return pde;
  }
 -void pde_put(struct proc_dir_entry *pde);
 -
 -int proc_fill_super(struct super_block *);
 -struct inode *proc_get_inode(struct super_block *, struct proc_dir_entry *);
 -int proc_remount(struct super_block *sb, int *flags, char *data);
 +extern void pde_put(struct proc_dir_entry *);
  
  /*
 - * These are generic /proc routines that use the internal
 - * "struct proc_dir_entry" tree to traverse the filesystem.
 - *
 - * The /proc root directory has extended versions to take care
 - * of the /proc/ subdirectories.
 + * inode.c
   */
 -int proc_readdir(struct file *, void *, filldir_t);
 -struct dentry *proc_lookup(struct inode *, struct dentry *, unsigned int);
 +struct pde_opener {
 +  struct file *file;
 +  struct list_head lh;
 +  int closing;
 +  struct completion *c;
 +};
  
 +extern const struct inode_operations proc_pid_link_inode_operations;
  
 +extern void proc_init_inodecache(void);
 +extern struct inode *proc_get_inode(struct super_block *, struct 
proc_dir_entry *);
 +extern int proc_fill_super(struct super_block *);
 +extern void proc_entry_rundown(struct proc_dir_entry *);
  
 -/* Lookups */
 -typedef struct dentry *instantiate_t(struct inode *, struct dentry *,
 -  struct task_struct *, const void *);
 -int proc_fill_cache(struct file *filp, void *dirent, filldir_t filldir,
 -  const char *name, int len,
 -  instantiate_t instantiate, struct task_struct *task, const void *ptr);
 -int pid_revalidate(struct dentry *dentry, unsigned int flags);
 -struct inode *proc_pid_make_inode(struct super_block * sb, struct task_struct 
*task);
 -extern const struct dentry_operations pid_dentry_operations;
 -int pid_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat 
*stat);
 -int proc_setattr(struct dentry *dentry, struct iattr *attr);
 +/*
-  * mmu.c
-  */
- struct vmalloc_info {
-   unsigned long   used;
-   unsigned long   largest_chunk;
- };
- 
- #ifdef CONFIG_MMU
- #define VMALLOC_TOTAL (VMALLOC_END - VMALLOC_START)
- extern void get_vmalloc_info(struct vmalloc_info *);
- 
- #else
- #define VMALLOC_TOTAL 0UL
- static inline void get_vmalloc_info(struct vmalloc_info *vmi)
- {
-   vmi->used = 0;
-   vmi->largest_chunk = 0;
- }
- #endif
- 
- /*
 + * proc_devtree.c
 + */
 +#ifdef CONFIG_PROC_DEVICETREE
 +extern void proc_device_tree_init(void);
 +#endif
  
 +/*
 + * proc_namespaces.c
 + */
  extern const struct inode_operations proc_ns_dir_inode_operations;
  extern const struct file_operations proc_ns_dir_operations;
  


pgpWbyqLeE9CN.pgp
Description: PGP signature


linux-next: manual merge of the akpm tree with the vfs tree

2013-04-29 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in
fs/proc/internal.h between commit 4608da4a9433 (proc: Move non-public
stuff from linux/proc_fs.h to fs/proc/internal.h) from the vfs tree and
commit mm, vmalloc: move get_vmalloc_info() to vmalloc.c from the akpm
tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc fs/proc/internal.h
index 04255b6,47eac85..000
--- a/fs/proc/internal.h
+++ b/fs/proc/internal.h
@@@ -191,56 -157,36 +191,35 @@@ static inline struct proc_dir_entry *pd
atomic_inc(pde-count);
return pde;
  }
 -void pde_put(struct proc_dir_entry *pde);
 -
 -int proc_fill_super(struct super_block *);
 -struct inode *proc_get_inode(struct super_block *, struct proc_dir_entry *);
 -int proc_remount(struct super_block *sb, int *flags, char *data);
 +extern void pde_put(struct proc_dir_entry *);
  
  /*
 - * These are generic /proc routines that use the internal
 - * struct proc_dir_entry tree to traverse the filesystem.
 - *
 - * The /proc root directory has extended versions to take care
 - * of the /proc/pid subdirectories.
 + * inode.c
   */
 -int proc_readdir(struct file *, void *, filldir_t);
 -struct dentry *proc_lookup(struct inode *, struct dentry *, unsigned int);
 +struct pde_opener {
 +  struct file *file;
 +  struct list_head lh;
 +  int closing;
 +  struct completion *c;
 +};
  
 +extern const struct inode_operations proc_pid_link_inode_operations;
  
 +extern void proc_init_inodecache(void);
 +extern struct inode *proc_get_inode(struct super_block *, struct 
proc_dir_entry *);
 +extern int proc_fill_super(struct super_block *);
 +extern void proc_entry_rundown(struct proc_dir_entry *);
  
 -/* Lookups */
 -typedef struct dentry *instantiate_t(struct inode *, struct dentry *,
 -  struct task_struct *, const void *);
 -int proc_fill_cache(struct file *filp, void *dirent, filldir_t filldir,
 -  const char *name, int len,
 -  instantiate_t instantiate, struct task_struct *task, const void *ptr);
 -int pid_revalidate(struct dentry *dentry, unsigned int flags);
 -struct inode *proc_pid_make_inode(struct super_block * sb, struct task_struct 
*task);
 -extern const struct dentry_operations pid_dentry_operations;
 -int pid_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat 
*stat);
 -int proc_setattr(struct dentry *dentry, struct iattr *attr);
 +/*
-  * mmu.c
-  */
- struct vmalloc_info {
-   unsigned long   used;
-   unsigned long   largest_chunk;
- };
- 
- #ifdef CONFIG_MMU
- #define VMALLOC_TOTAL (VMALLOC_END - VMALLOC_START)
- extern void get_vmalloc_info(struct vmalloc_info *);
- 
- #else
- #define VMALLOC_TOTAL 0UL
- static inline void get_vmalloc_info(struct vmalloc_info *vmi)
- {
-   vmi-used = 0;
-   vmi-largest_chunk = 0;
- }
- #endif
- 
- /*
 + * proc_devtree.c
 + */
 +#ifdef CONFIG_PROC_DEVICETREE
 +extern void proc_device_tree_init(void);
 +#endif
  
 +/*
 + * proc_namespaces.c
 + */
  extern const struct inode_operations proc_ns_dir_inode_operations;
  extern const struct file_operations proc_ns_dir_operations;
  


pgpWbyqLeE9CN.pgp
Description: PGP signature


linux-next: manual merge of the akpm tree with the vfs tree

2013-04-29 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in ipc/msgutil.c
between commit b3ecda5869da (proc: Split the namespace stuff out into
linux/proc_ns.h) from the vfs tree and commit ipc/msgutil.c: use
linux/uaccess.h from the akpm tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc ipc/msgutil.c
index a53f38f,d43439e..000
--- a/ipc/msgutil.c
+++ b/ipc/msgutil.c
@@@ -16,8 -16,8 +16,8 @@@
  #include linux/msg.h
  #include linux/ipc_namespace.h
  #include linux/utsname.h
 -#include linux/proc_fs.h
 +#include linux/proc_ns.h
- #include asm/uaccess.h
+ #include linux/uaccess.h
  
  #include util.h
  


pgpyMR8XrOo9d.pgp
Description: PGP signature


linux-next: manual merge of the akpm tree with the vfs tree

2013-04-29 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in ipc/util.c
between commit 823a5ed16606 (ipc_schedule_free() can do vfree() now)
from the vfs tree and commit ipc: make refcounter atomic from the akpm
tree.

I fixed it up (I hope - see below) and can carry the fix as necessary (no
action is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc ipc/util.c
index 6515f95,5e60ebd..000
--- a/ipc/util.c
+++ b/ipc/util.c
@@@ -477,7 -478,8 +477,7 @@@ void ipc_free(void* ptr, int size
   */
  struct ipc_rcu_hdr
  {
-   int refcount;
+   atomic_t refcount;
 -  int is_vmalloc;
void *data[0];
  };
  
@@@ -497,30 -516,48 +497,28 @@@ struct ipc_rcu_grac
   *@size: size desired
   *
   *Allocate memory for the rcu header structure +  the object.
-  *Returns the pointer to the object.
-  *NULL is returned if the allocation fails. 
+  *Returns the pointer to the object or NULL upon failure.
   */
-  
- void* ipc_rcu_alloc(int size)
+ void *ipc_rcu_alloc(int size)
  {
 -  void* out;
 -
 -  /*
 -   * We prepend the allocation with the rcu struct, and
 -   * workqueue if necessary (for vmalloc).
 +  size_t len = size + HDRLEN;
 +  void *out;
 +  /* 
 +   * We prepend the allocation with the rcu struct
 */
 -  if (rcu_use_vmalloc(size)) {
 -  out = vmalloc(HDRLEN_VMALLOC + size);
 -  if (!out)
 -  goto done;
 -
 -  out += HDRLEN_VMALLOC;
 -  container_of(out, struct ipc_rcu_hdr, data)-is_vmalloc = 1;
 -  } else {
 -  out = kmalloc(HDRLEN_KMALLOC + size, GFP_KERNEL);
 -  if (!out)
 -  goto done;
 -
 -  out += HDRLEN_KMALLOC;
 -  container_of(out, struct ipc_rcu_hdr, data)-is_vmalloc = 0;
 +  out = (len  PAGE_SIZE) ? vmalloc(len) : kmalloc(len, GFP_KERNEL);
 +  if (out) {
 +  out += HDRLEN;
-   container_of(out, struct ipc_rcu_hdr, data)-refcount = 1;
++  atomic_set(container_of(out, struct ipc_rcu_hdr, 
data)-refcount, 1);
}
return out;
  }
  
- void ipc_rcu_getref(void *ptr)
+ int ipc_rcu_getref(void *ptr)
  {
-   container_of(ptr, struct ipc_rcu_hdr, data)-refcount++;
+   return atomic_inc_not_zero(container_of(ptr, struct ipc_rcu_hdr, 
data)-refcount);
  }
  
 -static void ipc_do_vfree(struct work_struct *work)
 -{
 -  vfree(container_of(work, struct ipc_rcu_sched, work));
 -}
 -
  /**
   * ipc_schedule_free - free ipc + rcu space
   * @head: RCU callback structure for queued work
@@@ -534,10 -580,10 +532,10 @@@ static void ipc_schedule_free(struct rc
  
  void ipc_rcu_putref(void *ptr)
  {
-   if (--container_of(ptr, struct ipc_rcu_hdr, data)-refcount  0)
+   if (!atomic_dec_and_test(container_of(ptr, struct ipc_rcu_hdr, 
data)-refcount))
return;
  
 -  if (container_of(ptr, struct ipc_rcu_hdr, data)-is_vmalloc) {
 +  if (is_vmalloc_addr(ptr)) {
call_rcu(container_of(ptr, struct ipc_rcu_grace, data)-rcu,
ipc_schedule_free);
} else {


pgpS4zs9SJKnv.pgp
Description: PGP signature


Re: linux-next: manual merge of the akpm tree with the vfs tree

2013-04-04 Thread Stephen Rothwell
Hi Al,

On Thu, 4 Apr 2013 09:10:11 +0100 Al Viro  wrote:
>
> On Thu, Apr 04, 2013 at 12:02:53AM -0700, Andrew Morton wrote:
> 
> > > Well perhaps the vfs tree should start paying some attention to the
> > > rest of the world, particularly after -rc5.
> > 
> > I can't even find this "lift sb_start_write() out of ->write()".  Not on 
> > fsdevel,
> > not on lkml.  What the heck is it and why was it so important?
> 
> Deadlocks around splice; see the threads re overlayfs/unionmount/aufs and
> deadlocks in their copyup implementations.  See also XFS freeze-related
> deadlocks, etc.
> 
> The thing is, sb_start_write() is pretty high in locking hierarchy (outside
> ->i_mutex, etc.), but ->splice_write() and friends had it buried pretty
> deep.  With distinctly unpleasant results, including ->..._write() instances
> using generic ones (which took the lock) *and* doing some IO outside of those
> (ext4, for example; ocfs2 also looked fishy in that respect, IIRC).
> 
> The obvious solution is to lift taking that lock out of the methods, which
> had been done.  It had been discussed on fsdevel and sat in #experimental for
> several weeks; time for it to go into #for-next.

It would have been useful to put something like that in the commit message ...

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgpjJHBZAxhjc.pgp
Description: PGP signature


Re: linux-next: manual merge of the akpm tree with the vfs tree

2013-04-04 Thread Nathan Zimmer

On 04/04/2013 03:02 AM, Al Viro wrote:

On Wed, Apr 03, 2013 at 11:56:34PM -0700, Andrew Morton wrote:

On Thu, 4 Apr 2013 17:26:48 +1100 Stephen Rothwell  
wrote:


Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in
fs/proc/generic.c between several commits from the vfs tree and commit
"procfs: improve scaling in proc" from the akpm tree.

I just dropped the akpm tree patch (and the following
"procfs-improve-scaling-in-proc-v5") as the conflicts are a bit complex.

Well perhaps the vfs tree should start paying some attention to the
rest of the world, particularly after -rc5.

I'm sorry, but... not in this case.  There are seriously nasty races around
remove_proc_entry()/proc_reg_release() and the whole area needs a rewrite.
Tentative fix is in vfs.git#experimental; I hadn't pushed it into #for-next
yet, but Nathan's patches are definitely going to buggered by any realistic
solution.
In this case I will resubmit my first patch for moving the kfree in 
proc_reg_release.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: linux-next: manual merge of the akpm tree with the vfs tree

2013-04-04 Thread Jan Kara
On Thu 04-04-13 17:12:11, Stephen Rothwell wrote:
> Hi Andrew,
> 
> Today's linux-next merge of the akpm tree got conflicts in mm/filemap.c,
> fs/xfs/xfs_file.c, fs/splice.c, fs/ocfs2/file.c, fs/ntfs/file.c,
> fs/fuse/file.c, fs/cifs/file.c and fs/btrfs/file.c between commit
> 36bd5dc0c4e2 ("lift sb_start_write/sb_end_write out of ->aio_write()")
> from the vfs tree and commit "fs: return EAGAIN when O_NONBLOCK write
> should block on frozen fs" from the akpm tree.
> 
> The former was removing the code modified by the letter, so I just
> dropped the akpm tree patch and the following "ocfs2: add freeze
> protection to ocfs2_file_splice_write()".
  Yeah, Al has been changing the area significantly. Andrew, you can drop
the three relevant patches from -mm since they'll have to be redone. ocfs2
should be actually fixed by Al's changes, psacct freeze remains but fixing
it will become trivial...

Honza
-- 
Jan Kara 
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: linux-next: manual merge of the akpm tree with the vfs tree

2013-04-04 Thread Al Viro
On Thu, Apr 04, 2013 at 12:02:53AM -0700, Andrew Morton wrote:

> > Well perhaps the vfs tree should start paying some attention to the
> > rest of the world, particularly after -rc5.
> 
> I can't even find this "lift sb_start_write() out of ->write()".  Not on 
> fsdevel,
> not on lkml.  What the heck is it and why was it so important?

Deadlocks around splice; see the threads re overlayfs/unionmount/aufs and
deadlocks in their copyup implementations.  See also XFS freeze-related
deadlocks, etc.

The thing is, sb_start_write() is pretty high in locking hierarchy (outside
->i_mutex, etc.), but ->splice_write() and friends had it buried pretty
deep.  With distinctly unpleasant results, including ->..._write() instances
using generic ones (which took the lock) *and* doing some IO outside of those
(ext4, for example; ocfs2 also looked fishy in that respect, IIRC).

The obvious solution is to lift taking that lock out of the methods, which
had been done.  It had been discussed on fsdevel and sat in #experimental for
several weeks; time for it to go into #for-next.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: linux-next: manual merge of the akpm tree with the vfs tree

2013-04-04 Thread Al Viro
On Wed, Apr 03, 2013 at 11:56:34PM -0700, Andrew Morton wrote:
> On Thu, 4 Apr 2013 17:26:48 +1100 Stephen Rothwell  
> wrote:
> 
> > Hi Andrew,
> > 
> > Today's linux-next merge of the akpm tree got a conflict in
> > fs/proc/generic.c between several commits from the vfs tree and commit
> > "procfs: improve scaling in proc" from the akpm tree.
> > 
> > I just dropped the akpm tree patch (and the following
> > "procfs-improve-scaling-in-proc-v5") as the conflicts are a bit complex.
> 
> Well perhaps the vfs tree should start paying some attention to the
> rest of the world, particularly after -rc5.

I'm sorry, but... not in this case.  There are seriously nasty races around
remove_proc_entry()/proc_reg_release() and the whole area needs a rewrite.
Tentative fix is in vfs.git#experimental; I hadn't pushed it into #for-next
yet, but Nathan's patches are definitely going to buggered by any realistic
solution.  For now I'm going for the dumbest variant possible; ->pde_users
will eventually become atomic_t, but it'll be modified by
atomic_inc_unless_negative(), not atomic_inc() and ->proc_fops won't be
zeroed at all.  But before we do that, I want to get that sucker tested and
stabilized - the whole thing is sufficiently convoluted for those races to
stay unnoticed for a long time in the first place.

I am aware of those patches; it's just that they'll need to be redone - the
code being optimized is broken and needs to be fixed.  Longer term, I want
to lift the whole thing into VFS proper; it *can* be done with minimal
overhead and it'll get us a large part of revoke(2) if done right.  Basically,
what I want is a pair of new types - struct revoke and struct revokable.
* struct file gets a pointer to struct revoke; set in ->open() by
file_revokable(file, revokable) and never changed afterwards.  No locking
is needed to check it.
* struct revoke contains a pointer back to struct file (never changed)
+ pointer to struct revokable (RCU-protected, zeroed on revoke) + mutex/count
(serializes __fput() vs. revoke() deciding who's going to call ->release() and
who'll be waiting; see pdeo->mutex and pdep->count in #experimental) + cyclic
list anchored in struct revokable (list_del_init() after ->release() had been
done, under revoke->mutex and revokable->lock).
* struct revokable contains an anchor for aforementioned cyclic
list + spinlock + atomic_t in_use (a-la pde->pde_users) + pointer to
completion + one method (->kick(); see below).  Freed via RCU.
* start_using(file) is an inlined helper, returning true if
file->f_revoke is NULL; if it's not NULL, we do rcu_read_lock() and look
at file->f_revoke->revokable.  If it's NULL - rcu_read_unlock() and return
false (file had been revoked).  If it's not, atomic_inc_unless_negative()
of revokable->in_use.  Then rcu_read_unlock() and return - true if
->in_use used to be non-negative (file not revoked, revoke will wait) and
false if it was negative (file in process of being revoked).
* stop_using(file) - inlined helper, does nothing if file->f_revoke
is NULL, otherwise decrements revokable->in_use and if it's reached
BIAS (large negative), complete(revokable->completion).
* all normal method calls (everything except ->release()) are
turned into
if (likely(start_using(file)) {
res = method call
stop_using(file);
} else {
res = ;
}
Overhead for non-revokable files is trivial - we just check one field in
struct file and if it's in the same cacheline as ->f_op, we are not going
to see any real delays.
* new helper - release_revoke(); similar to close_pdeo() in
vfs.git#experimenatal.  __fput() checks ->f_revoke and, if that sucker's
non-NULL, does rcu_read_lock(), checks ->revokable, grabs ->lock on it
and does release_revoke().  If ->f_revoke is NULL, call ->release() as
we do now.  Note that unlike struct pde_opener, these guys would be
created with ->count equal to 1 - IOW, file->f_revoke would contribute to it.
* do_revoke(revokable) starts with setting ->completion and adding
BIAS to ->in_use; if it non-zero prior to that, call ->kick(revokable) and
wait for completion.  ->kick() should essentially wake up those who are
sleeping in ->read() or ->write() and make them return, be it with EAGAIN
or short read/write.  Empty for procfs, for something like TTY it should
imitate hangup.  That's where driver-specific logics in revoke(2) would
live.  Once do_revoke() has finished waiting, we know that nobody is in
method calls (except possibly ->release()) and nobody will manage to enter
them from now on.  We grab ->lock, pick the first struct revoke from the
list, do release_revoke() to it and keep doing that to these guys until
none is left.

procfs would have struct revokable embedded into proc_dir_entry, with
freeing of those guys RCUd.  It would have file_revokable() done in
proc_reg_open() (that would do allocation of struct revoke, adding it
to 

Re: linux-next: manual merge of the akpm tree with the vfs tree

2013-04-04 Thread Andrew Morton
On Wed, 3 Apr 2013 23:56:34 -0700 Andrew Morton  
wrote:

> On Thu, 4 Apr 2013 17:26:48 +1100 Stephen Rothwell  
> wrote:
> 
> > Hi Andrew,
> > 
> > Today's linux-next merge of the akpm tree got a conflict in
> > fs/proc/generic.c between several commits from the vfs tree and commit
> > "procfs: improve scaling in proc" from the akpm tree.
> > 
> > I just dropped the akpm tree patch (and the following
> > "procfs-improve-scaling-in-proc-v5") as the conflicts are a bit complex.
> 
> Well perhaps the vfs tree should start paying some attention to the
> rest of the world, particularly after -rc5.

I can't even find this "lift sb_start_write() out of ->write()".  Not on 
fsdevel,
not on lkml.  What the heck is it and why was it so important?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: linux-next: manual merge of the akpm tree with the vfs tree

2013-04-04 Thread Andrew Morton
On Thu, 4 Apr 2013 17:26:48 +1100 Stephen Rothwell  
wrote:

> Hi Andrew,
> 
> Today's linux-next merge of the akpm tree got a conflict in
> fs/proc/generic.c between several commits from the vfs tree and commit
> "procfs: improve scaling in proc" from the akpm tree.
> 
> I just dropped the akpm tree patch (and the following
> "procfs-improve-scaling-in-proc-v5") as the conflicts are a bit complex.

Well perhaps the vfs tree should start paying some attention to the
rest of the world, particularly after -rc5.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


linux-next: manual merge of the akpm tree with the vfs tree

2013-04-04 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in
fs/proc/generic.c between several commits from the vfs tree and commit
"procfs: improve scaling in proc" from the akpm tree.

I just dropped the akpm tree patch (and the following
"procfs-improve-scaling-in-proc-v5") as the conflicts are a bit complex.

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgpoF9JyhhHwU.pgp
Description: PGP signature


linux-next: manual merge of the akpm tree with the vfs tree

2013-04-04 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in fs/coredump.c
between commit d9fe6ea81efe ("lift sb_start_write() out of ->write()")
from the vfs tree and commit "coredump: sanitize the setting of
signal->group_exit_code" from the akpm tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc fs/coredump.c
index 69d5141,4201338..000
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@@ -636,11 -641,8 +639,10 @@@ void do_coredump(siginfo_t *siginfo
goto close_fail;
if (displaced)
put_files_struct(displaced);
+ 
 +  file_start_write(cprm.file);
-   retval = binfmt->core_dump();
-   if (retval)
-   current->signal->group_exit_code |= 0x80;
+   core_dumped = binfmt->core_dump();
 +  file_end_write(cprm.file);
  
if (ispipe && core_pipe_limit)
wait_for_dump_helpers(cprm.file);


pgp10puJtCA8I.pgp
Description: PGP signature


linux-next: manual merge of the akpm tree with the vfs tree

2013-04-04 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got conflicts in mm/filemap.c,
fs/xfs/xfs_file.c, fs/splice.c, fs/ocfs2/file.c, fs/ntfs/file.c,
fs/fuse/file.c, fs/cifs/file.c and fs/btrfs/file.c between commit
36bd5dc0c4e2 ("lift sb_start_write/sb_end_write out of ->aio_write()")
from the vfs tree and commit "fs: return EAGAIN when O_NONBLOCK write
should block on frozen fs" from the akpm tree.

The former was removing the code modified by the letter, so I just
dropped the akpm tree patch and the following "ocfs2: add freeze
protection to ocfs2_file_splice_write()".

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgpR3piEBJIFJ.pgp
Description: PGP signature


linux-next: manual merge of the akpm tree with the vfs tree

2013-04-04 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in
sound/core/info.c between commit d1ffe1db6641 ("snd_info_register: switch
to proc_create_data/proc_mkdir_mode") from the vfs tree and commit
"sound: convert snd_info_register() to use proc_create_data()" from the
akpm tree.

It looks like they are trying to do the same thing, so I dropped the akpm
tree version and can carry the fix as necessary (no action is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgpbRUBwfqfhm.pgp
Description: PGP signature


linux-next: manual merge of the akpm tree with the vfs tree

2013-04-04 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in
sound/core/info.c between commit d1ffe1db6641 (snd_info_register: switch
to proc_create_data/proc_mkdir_mode) from the vfs tree and commit
sound: convert snd_info_register() to use proc_create_data() from the
akpm tree.

It looks like they are trying to do the same thing, so I dropped the akpm
tree version and can carry the fix as necessary (no action is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgpbRUBwfqfhm.pgp
Description: PGP signature


linux-next: manual merge of the akpm tree with the vfs tree

2013-04-04 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got conflicts in mm/filemap.c,
fs/xfs/xfs_file.c, fs/splice.c, fs/ocfs2/file.c, fs/ntfs/file.c,
fs/fuse/file.c, fs/cifs/file.c and fs/btrfs/file.c between commit
36bd5dc0c4e2 (lift sb_start_write/sb_end_write out of -aio_write())
from the vfs tree and commit fs: return EAGAIN when O_NONBLOCK write
should block on frozen fs from the akpm tree.

The former was removing the code modified by the letter, so I just
dropped the akpm tree patch and the following ocfs2: add freeze
protection to ocfs2_file_splice_write().

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgpR3piEBJIFJ.pgp
Description: PGP signature


linux-next: manual merge of the akpm tree with the vfs tree

2013-04-04 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in fs/coredump.c
between commit d9fe6ea81efe (lift sb_start_write() out of -write())
from the vfs tree and commit coredump: sanitize the setting of
signal-group_exit_code from the akpm tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc fs/coredump.c
index 69d5141,4201338..000
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@@ -636,11 -641,8 +639,10 @@@ void do_coredump(siginfo_t *siginfo
goto close_fail;
if (displaced)
put_files_struct(displaced);
+ 
 +  file_start_write(cprm.file);
-   retval = binfmt-core_dump(cprm);
-   if (retval)
-   current-signal-group_exit_code |= 0x80;
+   core_dumped = binfmt-core_dump(cprm);
 +  file_end_write(cprm.file);
  
if (ispipe  core_pipe_limit)
wait_for_dump_helpers(cprm.file);


pgp10puJtCA8I.pgp
Description: PGP signature


linux-next: manual merge of the akpm tree with the vfs tree

2013-04-04 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in
fs/proc/generic.c between several commits from the vfs tree and commit
procfs: improve scaling in proc from the akpm tree.

I just dropped the akpm tree patch (and the following
procfs-improve-scaling-in-proc-v5) as the conflicts are a bit complex.

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgpoF9JyhhHwU.pgp
Description: PGP signature


Re: linux-next: manual merge of the akpm tree with the vfs tree

2013-04-04 Thread Andrew Morton
On Thu, 4 Apr 2013 17:26:48 +1100 Stephen Rothwell s...@canb.auug.org.au 
wrote:

 Hi Andrew,
 
 Today's linux-next merge of the akpm tree got a conflict in
 fs/proc/generic.c between several commits from the vfs tree and commit
 procfs: improve scaling in proc from the akpm tree.
 
 I just dropped the akpm tree patch (and the following
 procfs-improve-scaling-in-proc-v5) as the conflicts are a bit complex.

Well perhaps the vfs tree should start paying some attention to the
rest of the world, particularly after -rc5.

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: linux-next: manual merge of the akpm tree with the vfs tree

2013-04-04 Thread Andrew Morton
On Wed, 3 Apr 2013 23:56:34 -0700 Andrew Morton a...@linux-foundation.org 
wrote:

 On Thu, 4 Apr 2013 17:26:48 +1100 Stephen Rothwell s...@canb.auug.org.au 
 wrote:
 
  Hi Andrew,
  
  Today's linux-next merge of the akpm tree got a conflict in
  fs/proc/generic.c between several commits from the vfs tree and commit
  procfs: improve scaling in proc from the akpm tree.
  
  I just dropped the akpm tree patch (and the following
  procfs-improve-scaling-in-proc-v5) as the conflicts are a bit complex.
 
 Well perhaps the vfs tree should start paying some attention to the
 rest of the world, particularly after -rc5.

I can't even find this lift sb_start_write() out of -write().  Not on 
fsdevel,
not on lkml.  What the heck is it and why was it so important?
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: linux-next: manual merge of the akpm tree with the vfs tree

2013-04-04 Thread Al Viro
On Wed, Apr 03, 2013 at 11:56:34PM -0700, Andrew Morton wrote:
 On Thu, 4 Apr 2013 17:26:48 +1100 Stephen Rothwell s...@canb.auug.org.au 
 wrote:
 
  Hi Andrew,
  
  Today's linux-next merge of the akpm tree got a conflict in
  fs/proc/generic.c between several commits from the vfs tree and commit
  procfs: improve scaling in proc from the akpm tree.
  
  I just dropped the akpm tree patch (and the following
  procfs-improve-scaling-in-proc-v5) as the conflicts are a bit complex.
 
 Well perhaps the vfs tree should start paying some attention to the
 rest of the world, particularly after -rc5.

I'm sorry, but... not in this case.  There are seriously nasty races around
remove_proc_entry()/proc_reg_release() and the whole area needs a rewrite.
Tentative fix is in vfs.git#experimental; I hadn't pushed it into #for-next
yet, but Nathan's patches are definitely going to buggered by any realistic
solution.  For now I'm going for the dumbest variant possible; -pde_users
will eventually become atomic_t, but it'll be modified by
atomic_inc_unless_negative(), not atomic_inc() and -proc_fops won't be
zeroed at all.  But before we do that, I want to get that sucker tested and
stabilized - the whole thing is sufficiently convoluted for those races to
stay unnoticed for a long time in the first place.

I am aware of those patches; it's just that they'll need to be redone - the
code being optimized is broken and needs to be fixed.  Longer term, I want
to lift the whole thing into VFS proper; it *can* be done with minimal
overhead and it'll get us a large part of revoke(2) if done right.  Basically,
what I want is a pair of new types - struct revoke and struct revokable.
* struct file gets a pointer to struct revoke; set in -open() by
file_revokable(file, revokable) and never changed afterwards.  No locking
is needed to check it.
* struct revoke contains a pointer back to struct file (never changed)
+ pointer to struct revokable (RCU-protected, zeroed on revoke) + mutex/count
(serializes __fput() vs. revoke() deciding who's going to call -release() and
who'll be waiting; see pdeo-mutex and pdep-count in #experimental) + cyclic
list anchored in struct revokable (list_del_init() after -release() had been
done, under revoke-mutex and revokable-lock).
* struct revokable contains an anchor for aforementioned cyclic
list + spinlock + atomic_t in_use (a-la pde-pde_users) + pointer to
completion + one method (-kick(); see below).  Freed via RCU.
* start_using(file) is an inlined helper, returning true if
file-f_revoke is NULL; if it's not NULL, we do rcu_read_lock() and look
at file-f_revoke-revokable.  If it's NULL - rcu_read_unlock() and return
false (file had been revoked).  If it's not, atomic_inc_unless_negative()
of revokable-in_use.  Then rcu_read_unlock() and return - true if
-in_use used to be non-negative (file not revoked, revoke will wait) and
false if it was negative (file in process of being revoked).
* stop_using(file) - inlined helper, does nothing if file-f_revoke
is NULL, otherwise decrements revokable-in_use and if it's reached
BIAS (large negative), complete(revokable-completion).
* all normal method calls (everything except -release()) are
turned into
if (likely(start_using(file)) {
res = method call
stop_using(file);
} else {
res = appropriate for method;
}
Overhead for non-revokable files is trivial - we just check one field in
struct file and if it's in the same cacheline as -f_op, we are not going
to see any real delays.
* new helper - release_revoke(); similar to close_pdeo() in
vfs.git#experimenatal.  __fput() checks -f_revoke and, if that sucker's
non-NULL, does rcu_read_lock(), checks -revokable, grabs -lock on it
and does release_revoke().  If -f_revoke is NULL, call -release() as
we do now.  Note that unlike struct pde_opener, these guys would be
created with -count equal to 1 - IOW, file-f_revoke would contribute to it.
* do_revoke(revokable) starts with setting -completion and adding
BIAS to -in_use; if it non-zero prior to that, call -kick(revokable) and
wait for completion.  -kick() should essentially wake up those who are
sleeping in -read() or -write() and make them return, be it with EAGAIN
or short read/write.  Empty for procfs, for something like TTY it should
imitate hangup.  That's where driver-specific logics in revoke(2) would
live.  Once do_revoke() has finished waiting, we know that nobody is in
method calls (except possibly -release()) and nobody will manage to enter
them from now on.  We grab -lock, pick the first struct revoke from the
list, do release_revoke() to it and keep doing that to these guys until
none is left.

procfs would have struct revokable embedded into proc_dir_entry, with
freeing of those guys RCUd.  It would have file_revokable() done in
proc_reg_open() (that would do allocation of struct revoke, adding it
to the cyclic list, 

Re: linux-next: manual merge of the akpm tree with the vfs tree

2013-04-04 Thread Al Viro
On Thu, Apr 04, 2013 at 12:02:53AM -0700, Andrew Morton wrote:

  Well perhaps the vfs tree should start paying some attention to the
  rest of the world, particularly after -rc5.
 
 I can't even find this lift sb_start_write() out of -write().  Not on 
 fsdevel,
 not on lkml.  What the heck is it and why was it so important?

Deadlocks around splice; see the threads re overlayfs/unionmount/aufs and
deadlocks in their copyup implementations.  See also XFS freeze-related
deadlocks, etc.

The thing is, sb_start_write() is pretty high in locking hierarchy (outside
-i_mutex, etc.), but -splice_write() and friends had it buried pretty
deep.  With distinctly unpleasant results, including -..._write() instances
using generic ones (which took the lock) *and* doing some IO outside of those
(ext4, for example; ocfs2 also looked fishy in that respect, IIRC).

The obvious solution is to lift taking that lock out of the methods, which
had been done.  It had been discussed on fsdevel and sat in #experimental for
several weeks; time for it to go into #for-next.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: linux-next: manual merge of the akpm tree with the vfs tree

2013-04-04 Thread Jan Kara
On Thu 04-04-13 17:12:11, Stephen Rothwell wrote:
 Hi Andrew,
 
 Today's linux-next merge of the akpm tree got conflicts in mm/filemap.c,
 fs/xfs/xfs_file.c, fs/splice.c, fs/ocfs2/file.c, fs/ntfs/file.c,
 fs/fuse/file.c, fs/cifs/file.c and fs/btrfs/file.c between commit
 36bd5dc0c4e2 (lift sb_start_write/sb_end_write out of -aio_write())
 from the vfs tree and commit fs: return EAGAIN when O_NONBLOCK write
 should block on frozen fs from the akpm tree.
 
 The former was removing the code modified by the letter, so I just
 dropped the akpm tree patch and the following ocfs2: add freeze
 protection to ocfs2_file_splice_write().
  Yeah, Al has been changing the area significantly. Andrew, you can drop
the three relevant patches from -mm since they'll have to be redone. ocfs2
should be actually fixed by Al's changes, psacct freeze remains but fixing
it will become trivial...

Honza
-- 
Jan Kara j...@suse.cz
SUSE Labs, CR
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: linux-next: manual merge of the akpm tree with the vfs tree

2013-04-04 Thread Nathan Zimmer

On 04/04/2013 03:02 AM, Al Viro wrote:

On Wed, Apr 03, 2013 at 11:56:34PM -0700, Andrew Morton wrote:

On Thu, 4 Apr 2013 17:26:48 +1100 Stephen Rothwell s...@canb.auug.org.au 
wrote:


Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in
fs/proc/generic.c between several commits from the vfs tree and commit
procfs: improve scaling in proc from the akpm tree.

I just dropped the akpm tree patch (and the following
procfs-improve-scaling-in-proc-v5) as the conflicts are a bit complex.

Well perhaps the vfs tree should start paying some attention to the
rest of the world, particularly after -rc5.

I'm sorry, but... not in this case.  There are seriously nasty races around
remove_proc_entry()/proc_reg_release() and the whole area needs a rewrite.
Tentative fix is in vfs.git#experimental; I hadn't pushed it into #for-next
yet, but Nathan's patches are definitely going to buggered by any realistic
solution.
In this case I will resubmit my first patch for moving the kfree in 
proc_reg_release.


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: linux-next: manual merge of the akpm tree with the vfs tree

2013-04-04 Thread Stephen Rothwell
Hi Al,

On Thu, 4 Apr 2013 09:10:11 +0100 Al Viro v...@zeniv.linux.org.uk wrote:

 On Thu, Apr 04, 2013 at 12:02:53AM -0700, Andrew Morton wrote:
 
   Well perhaps the vfs tree should start paying some attention to the
   rest of the world, particularly after -rc5.
  
  I can't even find this lift sb_start_write() out of -write().  Not on 
  fsdevel,
  not on lkml.  What the heck is it and why was it so important?
 
 Deadlocks around splice; see the threads re overlayfs/unionmount/aufs and
 deadlocks in their copyup implementations.  See also XFS freeze-related
 deadlocks, etc.
 
 The thing is, sb_start_write() is pretty high in locking hierarchy (outside
 -i_mutex, etc.), but -splice_write() and friends had it buried pretty
 deep.  With distinctly unpleasant results, including -..._write() instances
 using generic ones (which took the lock) *and* doing some IO outside of those
 (ext4, for example; ocfs2 also looked fishy in that respect, IIRC).
 
 The obvious solution is to lift taking that lock out of the methods, which
 had been done.  It had been discussed on fsdevel and sat in #experimental for
 several weeks; time for it to go into #for-next.

It would have been useful to put something like that in the commit message ...

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgpjJHBZAxhjc.pgp
Description: PGP signature


linux-next: manual merge of the akpm tree with the vfs tree

2013-02-24 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in
fs/sysfs/bin.c between commit 496ad9aa8ef4 ("new helper: file_inode
(file)") from the vfs tree and commit "hlist: drop the node parameter
from iterators" from the akpm tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc fs/sysfs/bin.c
index 2ce9a5d,f186e27..000
--- a/fs/sysfs/bin.c
+++ b/fs/sysfs/bin.c
@@@ -468,8 -467,8 +467,8 @@@ void unmap_bin_file(struct sysfs_diren
  
mutex_lock(_bin_lock);
  
-   hlist_for_each_entry(bb, tmp, _sd->s_bin_attr.buffers, list) {
+   hlist_for_each_entry(bb, _sd->s_bin_attr.buffers, list) {
 -  struct inode *inode = bb->file->f_path.dentry->d_inode;
 +  struct inode *inode = file_inode(bb->file);
  
unmap_mapping_range(inode->i_mapping, 0, 0, 1);
}


pgp9lzxz_dIiS.pgp
Description: PGP signature


linux-next: manual merge of the akpm tree with the vfs tree

2013-02-24 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in
fs/sysfs/bin.c between commit 496ad9aa8ef4 (new helper: file_inode
(file)) from the vfs tree and commit hlist: drop the node parameter
from iterators from the akpm tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc fs/sysfs/bin.c
index 2ce9a5d,f186e27..000
--- a/fs/sysfs/bin.c
+++ b/fs/sysfs/bin.c
@@@ -468,8 -467,8 +467,8 @@@ void unmap_bin_file(struct sysfs_diren
  
mutex_lock(sysfs_bin_lock);
  
-   hlist_for_each_entry(bb, tmp, attr_sd-s_bin_attr.buffers, list) {
+   hlist_for_each_entry(bb, attr_sd-s_bin_attr.buffers, list) {
 -  struct inode *inode = bb-file-f_path.dentry-d_inode;
 +  struct inode *inode = file_inode(bb-file);
  
unmap_mapping_range(inode-i_mapping, 0, 0, 1);
}


pgp9lzxz_dIiS.pgp
Description: PGP signature


linux-next: manual merge of the akpm tree with the vfs tree

2012-09-24 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in
fs/proc/base.c between commit c8506285ded8 ("procfs: Move /proc/pid/fd
[info] handling code to fd.[ch]") from the vfs tree and commit "coredump:
use SUID_DUMPABLE_ENABLED rather than hardcoded 1" from the akpm tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --git a/fs/proc/internal.h b/fs/proc/internal.h
index 67925a7..863b8c7 100644
--- a/fs/proc/internal.h
+++ b/fs/proc/internal.h
@@ -103,7 +103,7 @@ static inline int task_dumpable(struct task_struct *task)
if (mm)
dumpable = get_dumpable(mm);
task_unlock(task);
-   if(dumpable == 1)
+   if(dumpable == SUID_DUMPABLE_ENABLED)
return 1;
return 0;
 }


pgpVo12XwH6G8.pgp
Description: PGP signature


linux-next: manual merge of the akpm tree with the vfs tree

2012-09-24 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in
arch/ia64/kernel/perfmon.c between commit f9bd4f3ed24d ("make get_file()
return its argument") from the vfs tree and commit "mm: kill vma flag
VM_RESERVED and mm->reserved_vm counter" from the akpm tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc arch/ia64/kernel/perfmon.c
index f388b4e,2eae90e..000
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@@ -2306,8 -2306,8 +2306,8 @@@ pfm_smpl_buffer_alloc(struct task_struc
 * partially initialize the vma for the sampling buffer
 */
vma->vm_mm   = mm;
 -  vma->vm_file = filp;
 +  vma->vm_file = get_file(filp);
-   vma->vm_flags= VM_READ| VM_MAYREAD |VM_RESERVED;
+   vma->vm_flags= VM_READ | VM_MAYREAD | VM_DONTEXPAND | 
VM_DONTDUMP;
vma->vm_page_prot= PAGE_READONLY; /* XXX may need to change */
  
/*


pgpzyYzXU7rMk.pgp
Description: PGP signature


linux-next: manual merge of the akpm tree with the vfs tree

2012-09-24 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in mm/nommu.c
between commit f9bd4f3ed24d ("make get_file() return its argument") from
the vfs tree and commit "mm: kill vma flag VM_EXECUTABLE and
mm->num_exe_file_vmas" from the akpm tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc mm/nommu.c
index 98318dc,5583325..000
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@@ -1282,12 -1279,10 +1279,8 @@@ unsigned long do_mmap_pgoff(struct fil
vma->vm_pgoff = pgoff;
  
if (file) {
 -  region->vm_file = file;
 -  get_file(file);
 -  vma->vm_file = file;
 -  get_file(file);
 +  region->vm_file = get_file(file);
 +  vma->vm_file = get_file(file);
-   if (vm_flags & VM_EXECUTABLE) {
-   added_exe_file_vma(current->mm);
-   vma->vm_mm = current->mm;
-   }
}
  
down_write(_region_sem);


pgpUAdJEc6eq6.pgp
Description: PGP signature


linux-next: manual merge of the akpm tree with the vfs tree

2012-09-24 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in mm/nommu.c
between commit f9bd4f3ed24d (make get_file() return its argument) from
the vfs tree and commit mm: kill vma flag VM_EXECUTABLE and
mm-num_exe_file_vmas from the akpm tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc mm/nommu.c
index 98318dc,5583325..000
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@@ -1282,12 -1279,10 +1279,8 @@@ unsigned long do_mmap_pgoff(struct fil
vma-vm_pgoff = pgoff;
  
if (file) {
 -  region-vm_file = file;
 -  get_file(file);
 -  vma-vm_file = file;
 -  get_file(file);
 +  region-vm_file = get_file(file);
 +  vma-vm_file = get_file(file);
-   if (vm_flags  VM_EXECUTABLE) {
-   added_exe_file_vma(current-mm);
-   vma-vm_mm = current-mm;
-   }
}
  
down_write(nommu_region_sem);


pgpUAdJEc6eq6.pgp
Description: PGP signature


linux-next: manual merge of the akpm tree with the vfs tree

2012-09-24 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in
arch/ia64/kernel/perfmon.c between commit f9bd4f3ed24d (make get_file()
return its argument) from the vfs tree and commit mm: kill vma flag
VM_RESERVED and mm-reserved_vm counter from the akpm tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc arch/ia64/kernel/perfmon.c
index f388b4e,2eae90e..000
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@@ -2306,8 -2306,8 +2306,8 @@@ pfm_smpl_buffer_alloc(struct task_struc
 * partially initialize the vma for the sampling buffer
 */
vma-vm_mm   = mm;
 -  vma-vm_file = filp;
 +  vma-vm_file = get_file(filp);
-   vma-vm_flags= VM_READ| VM_MAYREAD |VM_RESERVED;
+   vma-vm_flags= VM_READ | VM_MAYREAD | VM_DONTEXPAND | 
VM_DONTDUMP;
vma-vm_page_prot= PAGE_READONLY; /* XXX may need to change */
  
/*


pgpzyYzXU7rMk.pgp
Description: PGP signature


linux-next: manual merge of the akpm tree with the vfs tree

2012-09-24 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in
fs/proc/base.c between commit c8506285ded8 (procfs: Move /proc/pid/fd
[info] handling code to fd.[ch]) from the vfs tree and commit coredump:
use SUID_DUMPABLE_ENABLED rather than hardcoded 1 from the akpm tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --git a/fs/proc/internal.h b/fs/proc/internal.h
index 67925a7..863b8c7 100644
--- a/fs/proc/internal.h
+++ b/fs/proc/internal.h
@@ -103,7 +103,7 @@ static inline int task_dumpable(struct task_struct *task)
if (mm)
dumpable = get_dumpable(mm);
task_unlock(task);
-   if(dumpable == 1)
+   if(dumpable == SUID_DUMPABLE_ENABLED)
return 1;
return 0;
 }


pgpVo12XwH6G8.pgp
Description: PGP signature


linux-next: manual merge of the akpm tree with the vfs tree

2012-07-21 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in
fs/cachefiles/rdwr.c between commit e89cdeffe531 ("switch dentry_open()
to struct path, make it grab references itself") from the vfs,  tree and
commit "fs: cachefiles: add support for large files in filesystem
caching" from the akpm tree.

I fixed it up (and rolled in the following build fix - see below) and can
carry the fix as necessary.
-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc fs/cachefiles/rdwr.c
index c0353df,d136686..000
--- a/fs/cachefiles/rdwr.c
+++ b/fs/cachefiles/rdwr.c
@@@ -917,9 -916,10 +917,9 @@@ int cachefiles_write_page(struct fscach
  
/* write the page to the backing filesystem and let it store it in its
 * own time */
 -  dget(object->backer);
 -  mntget(cache->mnt);
 -  file = dentry_open(object->backer, cache->mnt, O_RDWR,
 - (O_RDWR | O_LARGEFILE), cache->cache_cred);
 +  path.mnt = cache->mnt;
 +  path.dentry = object->backer;
-   file = dentry_open(, O_RDWR, cache->cache_cred);
++  file = dentry_open(, O_RDWR | O_LARGEFILE, cache->cache_cred);
if (IS_ERR(file)) {
ret = PTR_ERR(file);
} else {


pgpP0wP2PGpRg.pgp
Description: PGP signature


linux-next: manual merge of the akpm tree with the vfs tree

2012-07-21 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in
fs/cachefiles/rdwr.c between commit e89cdeffe531 (switch dentry_open()
to struct path, make it grab references itself) from the vfs,  tree and
commit fs: cachefiles: add support for large files in filesystem
caching from the akpm tree.

I fixed it up (and rolled in the following build fix - see below) and can
carry the fix as necessary.
-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc fs/cachefiles/rdwr.c
index c0353df,d136686..000
--- a/fs/cachefiles/rdwr.c
+++ b/fs/cachefiles/rdwr.c
@@@ -917,9 -916,10 +917,9 @@@ int cachefiles_write_page(struct fscach
  
/* write the page to the backing filesystem and let it store it in its
 * own time */
 -  dget(object-backer);
 -  mntget(cache-mnt);
 -  file = dentry_open(object-backer, cache-mnt, O_RDWR,
 - (O_RDWR | O_LARGEFILE), cache-cache_cred);
 +  path.mnt = cache-mnt;
 +  path.dentry = object-backer;
-   file = dentry_open(path, O_RDWR, cache-cache_cred);
++  file = dentry_open(path, O_RDWR | O_LARGEFILE, cache-cache_cred);
if (IS_ERR(file)) {
ret = PTR_ERR(file);
} else {


pgpP0wP2PGpRg.pgp
Description: PGP signature