Re: [Cluster-devel] [PATCH 0/9] fs: add some missing ctime updates

2023-06-09 Thread Greg Kroah-Hartman
On Fri, Jun 09, 2023 at 08:50:14AM -0400, Jeff Layton wrote:
> While working on a patch series to change how we handle the ctime, I
> found a number of places that update the mtime without a corresponding
> ctime update. POSIX requires that when the mtime is updated that the
> ctime also be updated.
> 
> Note that these are largely untested other than for compilation, so
> please review carefully. These are a preliminary set for the upcoming
> rework of how we handle the ctime.
> 
> None of these seem to be very crucial, but it would be nice if
> various maintainers could pick these up for v6.5. Please let me know if
> you do.
> 
> Jeff Layton (9):
>   ibmvmc: update ctime in conjunction with mtime on write
>   usb: update the ctime as well when updating mtime after an ioctl
>   autofs: set ctime as well when mtime changes on a dir
>   bfs: update ctime in addition to mtime when adding entries
>   efivarfs: update ctime when mtime changes on a write
>   exfat: ensure that ctime is updated whenever the mtime is
>   gfs2: update ctime when quota is updated
>   apparmor: update ctime whenever the mtime changes on an inode
>   cifs: update the ctime on a partial page write
> 
>  drivers/misc/ibmvmc.c |  2 +-
>  drivers/usb/core/devio.c  | 16 
>  fs/autofs/root.c  |  6 +++---
>  fs/bfs/dir.c  |  2 +-
>  fs/efivarfs/file.c|  2 +-
>  fs/exfat/namei.c  |  8 
>  fs/gfs2/quota.c   |  2 +-
>  fs/smb/client/file.c  |  2 +-
>  security/apparmor/apparmorfs.c|  7 +--
>  security/apparmor/policy_unpack.c | 11 +++
>  10 files changed, 32 insertions(+), 26 deletions(-)
> 
> -- 
> 2.40.1
> 

All of these need commit log messages, didn't checkpatch warn you about
that?

thanks,

greg k-h



Re: [Cluster-devel] [PATCH 2/9] usb: update the ctime as well when updating mtime after an ioctl

2023-06-09 Thread Greg Kroah-Hartman
On Fri, Jun 09, 2023 at 08:50:16AM -0400, Jeff Layton wrote:
> Signed-off-by: Jeff Layton 

Sorry, but I can't take commits without any changelog text at all (nor
would you want me to...)

thanks,

greg k-h



Re: [Cluster-devel] [PATCH v2 4.19/5.4/5.10 1/1] gfs2: Always check inode size of inline inodes

2023-04-03 Thread Greg Kroah-Hartman
On Fri, Mar 24, 2023 at 11:26:15PM +0300, Fedor Pchelkin wrote:
> From: Andreas Gruenbacher 
> 
> commit 70376c7ff31221f1d21db5611d8209e677781d3a upstream.
> 
> Check if the inode size of stuffed (inline) inodes is within the allowed
> range when reading inodes from disk (gfs2_dinode_in()).  This prevents
> us from on-disk corruption.
> 
> The two checks in stuffed_readpage() and gfs2_unstuffer_page() that just
> truncate inline data to the maximum allowed size don't actually make
> sense, and they can be removed now as well.
> 
> Reported-by: syzbot+7bb81dfa9cda07d9c...@syzkaller.appspotmail.com
> Signed-off-by: Andreas Gruenbacher 
> [pchel...@ispras.ru: adjust the inode variable inside gfs2_dinode_in with
> the format used before upstream commit 7db35ad8 ("gfs2: Cosmetic
> gfs2_dinode_{in,out} cleanup")]
> Signed-off-by: Fedor Pchelkin 
> ---
> v2: add missed From: tag

Now queued up, thanks.

greg k-h



[Cluster-devel] [PATCH v2 16/16] kobject: kset_uevent_ops: make uevent() callback take a const *

2023-01-11 Thread Greg Kroah-Hartman
The uevent() callback in struct kset_uevent_ops does not modify the
kobject passed into it, so make the pointer const to enforce this
restriction.  When doing so, fix up all existing uevent() callbacks to
have the correct signature to preserve the build.

Cc: "Rafael J. Wysocki" 
Cc: Christine Caulfield 
Cc: David Teigland 
Cc: Bob Peterson 
Cc: Andreas Gruenbacher 
Cc: cluster-devel@redhat.com
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/base/core.c | 4 ++--
 fs/dlm/lockspace.c  | 4 ++--
 fs/gfs2/sys.c   | 6 +++---
 include/linux/kobject.h | 2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index 72ec54a8a4e1..b0cee0f30d8d 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -2387,9 +2387,9 @@ static const char *dev_uevent_name(const struct kobject 
*kobj)
return NULL;
 }
 
-static int dev_uevent(struct kobject *kobj, struct kobj_uevent_env *env)
+static int dev_uevent(const struct kobject *kobj, struct kobj_uevent_env *env)
 {
-   struct device *dev = kobj_to_dev(kobj);
+   const struct device *dev = kobj_to_dev(kobj);
int retval = 0;
 
/* add device node properties if present */
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c
index d0b4e2181a5f..9b6cfc4c30e3 100644
--- a/fs/dlm/lockspace.c
+++ b/fs/dlm/lockspace.c
@@ -215,9 +215,9 @@ static int do_uevent(struct dlm_ls *ls, int in)
return ls->ls_uevent_result;
 }
 
-static int dlm_uevent(struct kobject *kobj, struct kobj_uevent_env *env)
+static int dlm_uevent(const struct kobject *kobj, struct kobj_uevent_env *env)
 {
-   struct dlm_ls *ls = container_of(kobj, struct dlm_ls, ls_kobj);
+   const struct dlm_ls *ls = container_of(kobj, struct dlm_ls, ls_kobj);
 
add_uevent_var(env, "LOCKSPACE=%s", ls->ls_name);
return 0;
diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c
index d87ea98cf535..d8dfabb0bc12 100644
--- a/fs/gfs2/sys.c
+++ b/fs/gfs2/sys.c
@@ -767,10 +767,10 @@ void gfs2_sys_fs_del(struct gfs2_sbd *sdp)
wait_for_completion(>sd_kobj_unregister);
 }
 
-static int gfs2_uevent(struct kobject *kobj, struct kobj_uevent_env *env)
+static int gfs2_uevent(const struct kobject *kobj, struct kobj_uevent_env *env)
 {
-   struct gfs2_sbd *sdp = container_of(kobj, struct gfs2_sbd, sd_kobj);
-   struct super_block *s = sdp->sd_vfs;
+   const struct gfs2_sbd *sdp = container_of(kobj, struct gfs2_sbd, 
sd_kobj);
+   const struct super_block *s = sdp->sd_vfs;
 
add_uevent_var(env, "LOCKTABLE=%s", sdp->sd_table_name);
add_uevent_var(env, "LOCKPROTO=%s", sdp->sd_proto_name);
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 58a5b75612e3..bdab370a24f4 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -137,7 +137,7 @@ struct kobj_uevent_env {
 struct kset_uevent_ops {
int (* const filter)(const struct kobject *kobj);
const char *(* const name)(const struct kobject *kobj);
-   int (* const uevent)(struct kobject *kobj, struct kobj_uevent_env *env);
+   int (* const uevent)(const struct kobject *kobj, struct kobj_uevent_env 
*env);
 };
 
 struct kobj_attribute {
-- 
2.39.0



Re: [Cluster-devel] [REPORT] kernel BUG at fs/ext4/inode.c:2620 - page_buffers()

2022-02-17 Thread Greg Kroah-Hartman
On Thu, Feb 17, 2022 at 11:08:38PM -0500, Theodore Ts'o wrote:
> On Thu, Feb 17, 2022 at 05:06:45PM -0800, John Hubbard wrote:
> > Yes. And looking at the pair of backtraces below, this looks very much
> > like another aspect of the "get_user_pages problem" [1], originally
> > described in Jan Kara's 2018 email [2].
> 
> Hmm... I just posted my analysis, which tracks with yours; but I had
> forgotten about Jan's 2018 e-mail on the matter.
> 
> > I'm getting close to posting an RFC for the direct IO conversion to
> > FOLL_PIN, but even after that, various parts of the kernel (reclaim,
> > filesystems/block layer) still need to be changed so as to use
> > page_maybe_dma_pinned() to help avoid this problem. There's a bit
> > more than that, actually.
> 
> The challenge is that fixing this "the right away" is probably not
> something we can backport into an LTS kernel, whether it's 5.15 or
> 5.10... or 4.19.

Don't worry about stable backports to start with.  Do it the "right way"
first and then we can consider if it needs to be backported or not.

thanks,

greg k-h



Re: [Cluster-devel] [PATCH] Add flags option to get xattr method paired to __vfs_getxattr

2019-08-15 Thread Greg Kroah-Hartman
On Fri, Aug 16, 2019 at 05:20:36AM +1000, James Morris wrote:
> On Tue, 13 Aug 2019, Greg Kroah-Hartman wrote:
> 
> > On Mon, Aug 12, 2019 at 12:32:49PM -0700, Mark Salyzyn wrote:
> > > --- a/include/linux/xattr.h
> > > +++ b/include/linux/xattr.h
> > > @@ -30,10 +30,10 @@ struct xattr_handler {
> > >   const char *prefix;
> > >   int flags;  /* fs private flags */
> > >   bool (*list)(struct dentry *dentry);
> > > - int (*get)(const struct xattr_handler *, struct dentry *dentry,
> > > + int (*get)(const struct xattr_handler *handler, struct dentry *dentry,
> > >  struct inode *inode, const char *name, void *buffer,
> > > -size_t size);
> > > - int (*set)(const struct xattr_handler *, struct dentry *dentry,
> > > +size_t size, int flags);
> > > + int (*set)(const struct xattr_handler *handler, struct dentry *dentry,
> > >  struct inode *inode, const char *name, const void *buffer,
> > >  size_t size, int flags);
> > 
> > Wow, 7 arguments.  Isn't there some nice rule of thumb that says once
> > you get more then 5, a function becomes impossible to understand?
> > 
> > Surely this could be a structure passed in here somehow, that way when
> > you add the 8th argument in the future, you don't have to change
> > everything yet again?  :)
> > 
> > I don't have anything concrete to offer as a replacement fix for this,
> > but to me this just feels really wrong...
> 
> How about something like:
> 
> struct xattr_gs_args {
>   struct dentry *dentry;
>   struct inode *inode;

As he said in a later message, dentry and inode is redundant, only 1 is
needed (dentry I think?)

>   const char *name;
>   const void *buffer;
>   size_t size;
>   int flags;
> };
> 
> int (*get)(const struct xattr_handler *handler, struct xattr_gs_args *args);
> int (*set)(const struct xattr_handler *handler, struct xattr_gs_args *args);

But yes, that would be much much better.

thanks,

greg k-h



Re: [Cluster-devel] [PATCH] Add flags option to get xattr method paired to __vfs_getxattr

2019-08-13 Thread Greg Kroah-Hartman
On Mon, Aug 12, 2019 at 12:32:49PM -0700, Mark Salyzyn wrote:
> --- a/include/linux/xattr.h
> +++ b/include/linux/xattr.h
> @@ -30,10 +30,10 @@ struct xattr_handler {
>   const char *prefix;
>   int flags;  /* fs private flags */
>   bool (*list)(struct dentry *dentry);
> - int (*get)(const struct xattr_handler *, struct dentry *dentry,
> + int (*get)(const struct xattr_handler *handler, struct dentry *dentry,
>  struct inode *inode, const char *name, void *buffer,
> -size_t size);
> - int (*set)(const struct xattr_handler *, struct dentry *dentry,
> +size_t size, int flags);
> + int (*set)(const struct xattr_handler *handler, struct dentry *dentry,
>  struct inode *inode, const char *name, const void *buffer,
>  size_t size, int flags);

Wow, 7 arguments.  Isn't there some nice rule of thumb that says once
you get more then 5, a function becomes impossible to understand?

Surely this could be a structure passed in here somehow, that way when
you add the 8th argument in the future, you don't have to change
everything yet again?  :)

I don't have anything concrete to offer as a replacement fix for this,
but to me this just feels really wrong...

thanks,

greg k-h



[Cluster-devel] [PATCH] dlm: no need to check return value of debugfs_create functions

2019-06-12 Thread Greg Kroah-Hartman
When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Cc: Christine Caulfield 
Cc: David Teigland 
Cc: cluster-devel@redhat.com
Signed-off-by: Greg Kroah-Hartman 
---
 fs/dlm/debug_fs.c | 21 ++---
 fs/dlm/dlm_internal.h |  8 
 fs/dlm/main.c |  5 +
 3 files changed, 7 insertions(+), 27 deletions(-)

diff --git a/fs/dlm/debug_fs.c b/fs/dlm/debug_fs.c
index 0e941d42e3e9..d6bbccb0ed15 100644
--- a/fs/dlm/debug_fs.c
+++ b/fs/dlm/debug_fs.c
@@ -737,7 +737,7 @@ void dlm_delete_debug_file(struct dlm_ls *ls)
debugfs_remove(ls->ls_debug_toss_dentry);
 }
 
-int dlm_create_debug_file(struct dlm_ls *ls)
+void dlm_create_debug_file(struct dlm_ls *ls)
 {
char name[DLM_LOCKSPACE_LEN + 8];
 
@@ -748,8 +748,6 @@ int dlm_create_debug_file(struct dlm_ls *ls)
  dlm_root,
  ls,
  _fops);
-   if (!ls->ls_debug_rsb_dentry)
-   goto fail;
 
/* format 2 */
 
@@ -761,8 +759,6 @@ int dlm_create_debug_file(struct dlm_ls *ls)
dlm_root,
ls,
_fops);
-   if (!ls->ls_debug_locks_dentry)
-   goto fail;
 
/* format 3 */
 
@@ -774,8 +770,6 @@ int dlm_create_debug_file(struct dlm_ls *ls)
  dlm_root,
  ls,
  _fops);
-   if (!ls->ls_debug_all_dentry)
-   goto fail;
 
/* format 4 */
 
@@ -787,8 +781,6 @@ int dlm_create_debug_file(struct dlm_ls *ls)
   dlm_root,
   ls,
   _fops);
-   if (!ls->ls_debug_toss_dentry)
-   goto fail;
 
memset(name, 0, sizeof(name));
snprintf(name, DLM_LOCKSPACE_LEN + 8, "%s_waiters", ls->ls_name);
@@ -798,21 +790,12 @@ int dlm_create_debug_file(struct dlm_ls *ls)
  dlm_root,
  ls,
  _fops);
-   if (!ls->ls_debug_waiters_dentry)
-   goto fail;
-
-   return 0;
-
- fail:
-   dlm_delete_debug_file(ls);
-   return -ENOMEM;
 }
 
-int __init dlm_register_debugfs(void)
+void __init dlm_register_debugfs(void)
 {
mutex_init(_buf_lock);
dlm_root = debugfs_create_dir("dlm", NULL);
-   return dlm_root ? 0 : -ENOMEM;
 }
 
 void dlm_unregister_debugfs(void)
diff --git a/fs/dlm/dlm_internal.h b/fs/dlm/dlm_internal.h
index da1173a0b274..416d9de35679 100644
--- a/fs/dlm/dlm_internal.h
+++ b/fs/dlm/dlm_internal.h
@@ -719,14 +719,14 @@ int dlm_plock_init(void);
 void dlm_plock_exit(void);
 
 #ifdef CONFIG_DLM_DEBUG
-int dlm_register_debugfs(void);
+void dlm_register_debugfs(void);
 void dlm_unregister_debugfs(void);
-int dlm_create_debug_file(struct dlm_ls *ls);
+void dlm_create_debug_file(struct dlm_ls *ls);
 void dlm_delete_debug_file(struct dlm_ls *ls);
 #else
-static inline int dlm_register_debugfs(void) { return 0; }
+static inline void dlm_register_debugfs(void) { }
 static inline void dlm_unregister_debugfs(void) { }
-static inline int dlm_create_debug_file(struct dlm_ls *ls) { return 0; }
+static inline void dlm_create_debug_file(struct dlm_ls *ls) { }
 static inline void dlm_delete_debug_file(struct dlm_ls *ls) { }
 #endif
 
diff --git a/fs/dlm/main.c b/fs/dlm/main.c
index 39579927ed84..afc66a1346d3 100644
--- a/fs/dlm/main.c
+++ b/fs/dlm/main.c
@@ -35,9 +35,7 @@ static int __init init_dlm(void)
if (error)
goto out_lockspace;
 
-   error = dlm_register_debugfs();
-   if (error)
-   goto out_config;
+   dlm_register_debugfs();
 
error = dlm_user_init();
if (error)
@@ -61,7 +59,6 @@ static int __init init_dlm(void)
dlm_user_exit();
  out_debug:
dlm_unregister_debugfs();
- out_config:
dlm_config_exit();
  out_lockspace:
dlm_lockspace_exit();
-- 
2.22.0



Re: [PATCH] gfs2: Fix error path kobject memory leak

2019-05-13 Thread Greg Kroah-Hartman
On Mon, May 13, 2019 at 01:32:13PM +1000, Tobin C. Harding wrote:
> If a call to kobject_init_and_add() fails we must call kobject_put()
> otherwise we leak memory.
> 
> Function always calls kobject_init_and_add() which always calls
> kobject_init().
> 
> It is safe to leave object destruction up to the kobject release
> function and never free it manually.
> 
> Remove call to kfree() and always call kobject_put() in the error path.
> 
> Signed-off-by: Tobin C. Harding 
> ---
> 
> Is it ok to send patches during the merge window?
> 
> Applies on top of Linus' mainline tag: v5.1
> 
> Happy to rebase if there are conflicts.
> 
> thanks,
> Tobin.
> 
>  fs/gfs2/sys.c | 7 +--
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c
> index 1787d295834e..98586b139386 100644
> --- a/fs/gfs2/sys.c
> +++ b/fs/gfs2/sys.c
> @@ -661,8 +661,6 @@ int gfs2_sys_fs_add(struct gfs2_sbd *sdp)
>   if (error)
>   goto fail_reg;
>  
> - sysfs_frees_sdp = 1; /* Freeing sdp is now done by sysfs calling
> - function gfs2_sbd_release. */

You should also delete this variable at the top of the function, as it
is now only set once there and never used.

With that:

Reviewed-by: Greg Kroah-Hartman 


[Cluster-devel] [PATCH] gfs: no need to check return value of debugfs_create functions

2019-01-22 Thread Greg Kroah-Hartman
When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

There is no need to save the dentries for the debugfs files, so drop
those variables to save a bit of space and make the code simpler.

Cc: Bob Peterson 
Cc: Andreas Gruenbacher 
Cc: cluster-devel@redhat.com
Signed-off-by: Greg Kroah-Hartman 
---
 fs/gfs2/glock.c  | 70 ++--
 fs/gfs2/glock.h  |  4 +--
 fs/gfs2/incore.h |  3 ---
 fs/gfs2/main.c   |  6 +
 4 files changed, 17 insertions(+), 66 deletions(-)

diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index b92740edc416..f66773c71bcd 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -2131,71 +2131,29 @@ static const struct file_operations gfs2_sbstats_fops = 
{
.release = seq_release,
 };
 
-int gfs2_create_debugfs_file(struct gfs2_sbd *sdp)
-{
-   struct dentry *dent;
-
-   dent = debugfs_create_dir(sdp->sd_table_name, gfs2_root);
-   if (IS_ERR_OR_NULL(dent))
-   goto fail;
-   sdp->debugfs_dir = dent;
-
-   dent = debugfs_create_file("glocks",
-  S_IFREG | S_IRUGO,
-  sdp->debugfs_dir, sdp,
-  _glocks_fops);
-   if (IS_ERR_OR_NULL(dent))
-   goto fail;
-   sdp->debugfs_dentry_glocks = dent;
-
-   dent = debugfs_create_file("glstats",
-  S_IFREG | S_IRUGO,
-  sdp->debugfs_dir, sdp,
-  _glstats_fops);
-   if (IS_ERR_OR_NULL(dent))
-   goto fail;
-   sdp->debugfs_dentry_glstats = dent;
-
-   dent = debugfs_create_file("sbstats",
-  S_IFREG | S_IRUGO,
-  sdp->debugfs_dir, sdp,
-  _sbstats_fops);
-   if (IS_ERR_OR_NULL(dent))
-   goto fail;
-   sdp->debugfs_dentry_sbstats = dent;
+void gfs2_create_debugfs_file(struct gfs2_sbd *sdp)
+{
+   sdp->debugfs_dir = debugfs_create_dir(sdp->sd_table_name, gfs2_root);
 
-   return 0;
-fail:
-   gfs2_delete_debugfs_file(sdp);
-   return dent ? PTR_ERR(dent) : -ENOMEM;
+   debugfs_create_file("glocks", S_IFREG | S_IRUGO, sdp->debugfs_dir, sdp,
+   _glocks_fops);
+
+   debugfs_create_file("glstats", S_IFREG | S_IRUGO, sdp->debugfs_dir, sdp,
+   _glstats_fops);
+
+   debugfs_create_file("sbstats", S_IFREG | S_IRUGO, sdp->debugfs_dir, sdp,
+   _sbstats_fops);
 }
 
 void gfs2_delete_debugfs_file(struct gfs2_sbd *sdp)
 {
-   if (sdp->debugfs_dir) {
-   if (sdp->debugfs_dentry_glocks) {
-   debugfs_remove(sdp->debugfs_dentry_glocks);
-   sdp->debugfs_dentry_glocks = NULL;
-   }
-   if (sdp->debugfs_dentry_glstats) {
-   debugfs_remove(sdp->debugfs_dentry_glstats);
-   sdp->debugfs_dentry_glstats = NULL;
-   }
-   if (sdp->debugfs_dentry_sbstats) {
-   debugfs_remove(sdp->debugfs_dentry_sbstats);
-   sdp->debugfs_dentry_sbstats = NULL;
-   }
-   debugfs_remove(sdp->debugfs_dir);
-   sdp->debugfs_dir = NULL;
-   }
+   debugfs_remove_recursive(sdp->debugfs_dir);
+   sdp->debugfs_dir = NULL;
 }
 
-int gfs2_register_debugfs(void)
+void gfs2_register_debugfs(void)
 {
gfs2_root = debugfs_create_dir("gfs2", NULL);
-   if (IS_ERR(gfs2_root))
-   return PTR_ERR(gfs2_root);
-   return gfs2_root ? 0 : -ENOMEM;
 }
 
 void gfs2_unregister_debugfs(void)
diff --git a/fs/gfs2/glock.h b/fs/gfs2/glock.h
index 8949bf28b249..936b3295839c 100644
--- a/fs/gfs2/glock.h
+++ b/fs/gfs2/glock.h
@@ -243,9 +243,9 @@ extern void gfs2_glock_free(struct gfs2_glock *gl);
 extern int __init gfs2_glock_init(void);
 extern void gfs2_glock_exit(void);
 
-extern int gfs2_create_debugfs_file(struct gfs2_sbd *sdp);
+extern void gfs2_create_debugfs_file(struct gfs2_sbd *sdp);
 extern void gfs2_delete_debugfs_file(struct gfs2_sbd *sdp);
-extern int gfs2_register_debugfs(void);
+extern void gfs2_register_debugfs(void);
 extern void gfs2_unregister_debugfs(void);
 
 extern const struct lm_lockops gfs2_dlm_ops;
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index e10e0b0a7cd5..cdf07b408f54 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -853,9 +853,6 @@ struct gfs2_sbd {
 
unsigned long sd_last_warning;
struct dentry *debugfs_dir;/* debugfs directory */
-   struct dentry *debugfs_dentry_glocks;
-   struct dentry *d

Re: [Cluster-devel] [GIT PULL] gfs2: another 4.19 fix

2018-10-13 Thread Greg Kroah-Hartman
On Fri, Oct 12, 2018 at 06:26:08PM +0200, Andreas Gruenbacher wrote:
> Hi Greg,
> 
> as explained in the commit in this pull request, the previous fix I've
> sent was bad. Could you please pull this follow-up fix?
> 
> Thanks,
> Andreas
> 
> --
> 
> The following changes since commit dc480feb454a975b7ee2c18a2f98fb34e04d3baf:
> 
>   gfs2: Fix iomap buffered write support for journaled files
> (2018-10-09 18:20:13 +0200)
> 
> are available in the Git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git
> tags/gfs2-4.19.fixes3

Now merged, thanks.

greg k-h



Re: [Cluster-devel] [GIT PULL] gfs2: 4.19 fix

2018-10-10 Thread Greg Kroah-Hartman
On Tue, Oct 09, 2018 at 07:36:53PM +0200, Andreas Gruenbacher wrote:
> Hi Greg,
> 
> could you please pull the following gfs2 fix for 4.19? This fixes a
> regression introduced in commit 64bc06bb32ee "gfs2: iomap buffered
> write support" (4.19-rc1).
> 
> Thanks,
> Andreas
> 
> --
> 
> The following changes since commit 0854ba5ff5c938307cd783e996b62c83f1ce923b:
> 
>   Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
> (2018-10-08 16:25:01 +0200)
> 
> are available in the Git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git
> gfs2-4.19.fixes2

Now merged, thanks.

greg k-h



Re: [Cluster-devel] Fix gfs2 in 4.15.y

2018-03-16 Thread Greg Kroah-Hartman
On Fri, Mar 16, 2018 at 02:54:40PM +0100, Andreas Gruenbacher wrote:
> Hi Greg,
> 
> Andrew Price has observed that mounting gfs2 filesystems is currently
> broken in the 4.15.y kernels. The reason is that commit 'gfs2: Fixes
> to "Implement iomap for block_map"' was cherry-picked from mainline in
> 4.15.5 without adding a commit that that commit depends on. Could you
> please fix that by adding the following commit to 4.15.y:
> 
>   e8b43fe0c1 gfs2: Clean up {lookup,fillup}_metapath
> 
> In addition, could you please add the following commit to 4.15.y as well:
> 
>   3b5da96e45 gfs2: Fixes to "Implement iomap for block_map" (2)
> 
> Both commits can be cherry-picked cleanly.

Now done, thanks!

greg k-h



[Cluster-devel] [PATCH 4.11 047/150] gfs2: Make flush bios explicitely sync

2017-06-12 Thread Greg Kroah-Hartman
4.11-stable review patch.  If anyone has any objections, please let me know.

--

From: Jan Kara <j...@suse.cz>

commit 0f0b9b63e14fc3f66e4d342df016c9b071c5abed upstream.

Commit b685d3d65ac7 "block: treat REQ_FUA and REQ_PREFLUSH as
synchronous" removed REQ_SYNC flag from WRITE_{FUA|PREFLUSH|...}
definitions.  generic_make_request_checks() however strips REQ_FUA and
REQ_PREFLUSH flags from a bio when the storage doesn't report volatile
write cache and thus write effectively becomes asynchronous which can
lead to performance regressions

Fix the problem by making sure all bios which are synchronous are
properly marked with REQ_SYNC.

Fixes: b685d3d65ac791406e0dfd8779cc9b3707fea5a3
CC: Steven Whitehouse <swhit...@redhat.com>
CC: cluster-devel@redhat.com
Acked-by: Bob Peterson <rpete...@redhat.com>
Signed-off-by: Jan Kara <j...@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>

---
 fs/gfs2/log.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -659,7 +659,7 @@ static void log_write_header(struct gfs2
struct gfs2_log_header *lh;
unsigned int tail;
u32 hash;
-   int op_flags = REQ_PREFLUSH | REQ_FUA | REQ_META;
+   int op_flags = REQ_PREFLUSH | REQ_FUA | REQ_META | REQ_SYNC;
struct page *page = mempool_alloc(gfs2_page_pool, GFP_NOIO);
enum gfs2_freeze_state state = atomic_read(>sd_freeze_state);
lh = page_address(page);