cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] [PATCH 0/9] GFS2: Pre-pull patch posting (merge window)
@ 2015-04-13 15:10 Bob Peterson
  0 siblings, 0 replies; 14+ messages in thread
From: Bob Peterson @ 2015-04-13 15:10 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

Here is a list of patches we've accumulated for GFS2 for the current upstream
merge window. Most of the patches fix GFS2 quotas, which were not properly
enforced. There's another that adds me as a GFS2 co-maintainer, and a
couple patches that fix a kernel panic doing splice_write on GFS2 as well
as a few correctness patches.

Regards,

Bob Peterson
Red Hat File Systems

----------------------------------------------------------------
Abhi Das (4):
  gfs2: perform quota checks against allocation parameters
  gfs2: allow quota_check and inplace_reserve to return available blocks
  gfs2: allow fallocate to max out quotas/fs efficiently
  gfs2: fix quota refresh race in do_glock()

Andreas Gruenbacher (1):
  GFS2: gfs2_set_acl(): Cache "no acl" as well

Bob Peterson (3):
  Add myself (Bob Peterson) as a maintainer of GFS2
  GFS2: Allocate reservation during splice_write
  GFS2: Move gfs2_file_splice_write outside of #ifdef

Chengyu Song (1):
  gfs2: incorrect check for debugfs returns

 MAINTAINERS      |   4 +--
 fs/gfs2/acl.c    |   6 +---
 fs/gfs2/aops.c   |   6 ++--
 fs/gfs2/bmap.c   |   2 +-
 fs/gfs2/file.c   | 101 ++++++++++++++++++++++++++++++++++++++-----------------
 fs/gfs2/glock.c  |  47 +++++++++++++++-----------
 fs/gfs2/incore.h |   4 ++-
 fs/gfs2/inode.c  |  18 +++++-----
 fs/gfs2/quota.c  |  62 ++++++++++++++++++++++++----------
 fs/gfs2/quota.h  |   8 +++--
 fs/gfs2/rgrp.c   |  20 ++++++++---
 fs/gfs2/rgrp.h   |   3 +-
 fs/gfs2/xattr.c  |   2 +-
 13 files changed, 186 insertions(+), 97 deletions(-)

-- 
1.9.3



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

* [Cluster-devel] [PATCH 0/9] GFS2: Pre-pull patch posting (merge window)
@ 2016-05-20 16:22 Bob Peterson
  2016-05-20 16:22 ` [Cluster-devel] [PATCH 1/9] GFS2: ignore unlock failures after withdraw Bob Peterson
                   ` (8 more replies)
  0 siblings, 9 replies; 14+ messages in thread
From: Bob Peterson @ 2016-05-20 16:22 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

We've got nine patches this time:

- Abhi Das has two patches that fix a GFS2 splice issue (and an adjustment).
- Ben Marzinski has a patch which allows the proper unmount of a GFS2
  file system after hitting a withdraw error.
- I have a patch to fix a problem where GFS2 would dereference an error
  value, plus three cosmetic / refactoring patches.
- Daniel DeFreez has a patch to fix two glock reference count problems,
  where GFS2 was not properly "uninitializing" its glock holder on error
  paths.
- Denys Vlasenko has a patch to change a function to not be inlined,
  thus reducing the memory footprint of the GFS2 module.

Regards,

Bob Peterson
---
Abhi Das (2):
  gfs2: Use gfs2 wrapper to sync inode before calling
    generic_file_splice_read()
  gfs2: use inode_lock/unlock instead of accessing i_mutex directly

Benjamin Marzinski (1):
  GFS2: ignore unlock failures after withdraw

Bob Peterson (4):
  GFS2: Get rid of dead code in inode_go_demote_ok
  GFS2: Don't dereference inode in gfs2_inode_lookup until it's valid
  GFS2: Remove allocation parms from gfs2_rbm_find
  GFS2: Refactor gfs2_remove_from_journal

Daniel DeFreez (1):
  GFS2: Add calls to gfs2_holder_uninit in two error handlers

Denys Vlasenko (1):
  GFS2: fs/gfs2/glock.c: Deinline do_error, save 1856 bytes

 fs/gfs2/aops.c    |  5 +++--
 fs/gfs2/file.c    | 31 ++++++++++++++++++++++++++++---
 fs/gfs2/glock.c   | 11 +++++++++--
 fs/gfs2/glops.c   |  7 -------
 fs/gfs2/inode.c   |  6 +++---
 fs/gfs2/meta_io.c |  7 ++++---
 fs/gfs2/meta_io.h |  8 ++++++--
 fs/gfs2/rgrp.c    | 16 ++++++----------
 fs/gfs2/util.c    |  1 +
 9 files changed, 60 insertions(+), 32 deletions(-)

-- 
2.5.5



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

* [Cluster-devel] [PATCH 1/9] GFS2: ignore unlock failures after withdraw
  2016-05-20 16:22 [Cluster-devel] [PATCH 0/9] GFS2: Pre-pull patch posting (merge window) Bob Peterson
@ 2016-05-20 16:22 ` Bob Peterson
  2016-05-20 16:22 ` [Cluster-devel] [PATCH 2/9] GFS2: Get rid of dead code in inode_go_demote_ok Bob Peterson
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Bob Peterson @ 2016-05-20 16:22 UTC (permalink / raw)
  To: cluster-devel.redhat.com

From: Benjamin Marzinski <bmarzins@redhat.com>

After gfs2 has withdrawn the filesystem, it may still have many locks not
in the unlocked state.  If it is using lock_dlm, it will failed trying
the unlocks since it has already unmounted the lock manager. Instead, it
should set the SDF_SKIP_DLM_UNLOCK flag on withdraw, to signal that
it can skip the lock_manager on unlocks, and failback to lock_nolock
style unlocking.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
---
 fs/gfs2/glock.c | 9 ++++++++-
 fs/gfs2/util.c  | 1 +
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 6539131..2897ced 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -475,7 +475,14 @@ __acquires(&gl->gl_lockref.lock)
 	if (sdp->sd_lockstruct.ls_ops->lm_lock)	{
 		/* lock_dlm */
 		ret = sdp->sd_lockstruct.ls_ops->lm_lock(gl, target, lck_flags);
-		if (ret) {
+		if (ret == -EINVAL && gl->gl_target == LM_ST_UNLOCKED &&
+		    target == LM_ST_UNLOCKED &&
+		    test_bit(SDF_SKIP_DLM_UNLOCK, &sdp->sd_flags)) {
+			finish_xmote(gl, target);
+			if (queue_delayed_work(glock_workqueue, &gl->gl_work, 0) == 0)
+				gfs2_glock_put(gl);
+		}
+		else if (ret) {
 			pr_err("lm_lock ret %d\n", ret);
 			GLOCK_BUG_ON(gl, 1);
 		}
diff --git a/fs/gfs2/util.c b/fs/gfs2/util.c
index cf64583..aee4485 100644
--- a/fs/gfs2/util.c
+++ b/fs/gfs2/util.c
@@ -68,6 +68,7 @@ int gfs2_lm_withdraw(struct gfs2_sbd *sdp, const char *fmt, ...)
 			fs_err(sdp, "telling LM to unmount\n");
 			lm->lm_unmount(sdp);
 		}
+		set_bit(SDF_SKIP_DLM_UNLOCK, &sdp->sd_flags);
 		fs_err(sdp, "withdrawn\n");
 		dump_stack();
 	}
-- 
2.5.5



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

* [Cluster-devel] [PATCH 2/9] GFS2: Get rid of dead code in inode_go_demote_ok
  2016-05-20 16:22 [Cluster-devel] [PATCH 0/9] GFS2: Pre-pull patch posting (merge window) Bob Peterson
  2016-05-20 16:22 ` [Cluster-devel] [PATCH 1/9] GFS2: ignore unlock failures after withdraw Bob Peterson
@ 2016-05-20 16:22 ` Bob Peterson
  2016-05-20 16:22 ` [Cluster-devel] [PATCH 3/9] gfs2: Use gfs2 wrapper to sync inode before calling generic_file_splice_read() Bob Peterson
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Bob Peterson @ 2016-05-20 16:22 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Function inode_go_demote_ok had some code that was only executed
if gl_holders was not empty. However, if gl_holders was not empty,
the only caller, demote_ok(), returns before inode_go_demote_ok
would ever be called. Therefore, it's dead code, so I removed it.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Acked-by: Steven Whitehouse <swhiteho@redhat.com>
---
 fs/gfs2/glops.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c
index 437fd73..5db59d4 100644
--- a/fs/gfs2/glops.c
+++ b/fs/gfs2/glops.c
@@ -286,17 +286,10 @@ static void inode_go_inval(struct gfs2_glock *gl, int flags)
 static int inode_go_demote_ok(const struct gfs2_glock *gl)
 {
 	struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
-	struct gfs2_holder *gh;
 
 	if (sdp->sd_jindex == gl->gl_object || sdp->sd_rindex == gl->gl_object)
 		return 0;
 
-	if (!list_empty(&gl->gl_holders)) {
-		gh = list_entry(gl->gl_holders.next, struct gfs2_holder, gh_list);
-		if (gh->gh_list.next != &gl->gl_holders)
-			return 0;
-	}
-
 	return 1;
 }
 
-- 
2.5.5



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

* [Cluster-devel] [PATCH 3/9] gfs2: Use gfs2 wrapper to sync inode before calling generic_file_splice_read()
  2016-05-20 16:22 [Cluster-devel] [PATCH 0/9] GFS2: Pre-pull patch posting (merge window) Bob Peterson
  2016-05-20 16:22 ` [Cluster-devel] [PATCH 1/9] GFS2: ignore unlock failures after withdraw Bob Peterson
  2016-05-20 16:22 ` [Cluster-devel] [PATCH 2/9] GFS2: Get rid of dead code in inode_go_demote_ok Bob Peterson
@ 2016-05-20 16:22 ` Bob Peterson
  2016-05-20 16:22 ` [Cluster-devel] [PATCH 4/9] GFS2: fs/gfs2/glock.c: Deinline do_error, save 1856 bytes Bob Peterson
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Bob Peterson @ 2016-05-20 16:22 UTC (permalink / raw)
  To: cluster-devel.redhat.com

From: Abhi Das <adas@redhat.com>

gfs2_file_splice_read() f_op grabs and releases the cluster-wide
inode glock to sync the inode size to the latest.

Without this, generic_file_splice_read() uses an older i_size value
and can return EOF for valid offsets in the inode.

Signed-off-by: Abhi Das <adas@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
---
 fs/gfs2/file.c | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index c9384f9..fd9a10e 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -950,6 +950,30 @@ out_uninit:
 	return ret;
 }
 
+static ssize_t gfs2_file_splice_read(struct file *in, loff_t *ppos,
+				     struct pipe_inode_info *pipe, size_t len,
+				     unsigned int flags)
+{
+	struct inode *inode = in->f_mapping->host;
+	struct gfs2_inode *ip = GFS2_I(inode);
+	struct gfs2_holder gh;
+	int ret;
+
+	mutex_lock(&inode->i_mutex);
+
+	ret = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, 0, &gh);
+	if (ret) {
+		mutex_unlock(&inode->i_mutex);
+		return ret;
+	}
+
+	gfs2_glock_dq_uninit(&gh);
+	mutex_unlock(&inode->i_mutex);
+
+	return generic_file_splice_read(in, ppos, pipe, len, flags);
+}
+
+
 static ssize_t gfs2_file_splice_write(struct pipe_inode_info *pipe,
 				      struct file *out, loff_t *ppos,
 				      size_t len, unsigned int flags)
@@ -1112,7 +1136,7 @@ const struct file_operations gfs2_file_fops = {
 	.fsync		= gfs2_fsync,
 	.lock		= gfs2_lock,
 	.flock		= gfs2_flock,
-	.splice_read	= generic_file_splice_read,
+	.splice_read	= gfs2_file_splice_read,
 	.splice_write	= gfs2_file_splice_write,
 	.setlease	= simple_nosetlease,
 	.fallocate	= gfs2_fallocate,
@@ -1140,7 +1164,7 @@ const struct file_operations gfs2_file_fops_nolock = {
 	.open		= gfs2_open,
 	.release	= gfs2_release,
 	.fsync		= gfs2_fsync,
-	.splice_read	= generic_file_splice_read,
+	.splice_read	= gfs2_file_splice_read,
 	.splice_write	= gfs2_file_splice_write,
 	.setlease	= generic_setlease,
 	.fallocate	= gfs2_fallocate,
-- 
2.5.5



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

* [Cluster-devel] [PATCH 4/9] GFS2: fs/gfs2/glock.c: Deinline do_error, save 1856 bytes
  2016-05-20 16:22 [Cluster-devel] [PATCH 0/9] GFS2: Pre-pull patch posting (merge window) Bob Peterson
                   ` (2 preceding siblings ...)
  2016-05-20 16:22 ` [Cluster-devel] [PATCH 3/9] gfs2: Use gfs2 wrapper to sync inode before calling generic_file_splice_read() Bob Peterson
@ 2016-05-20 16:22 ` Bob Peterson
  2016-05-20 16:22 ` [Cluster-devel] [PATCH 5/9] GFS2: Don't dereference inode in gfs2_inode_lookup until it's valid Bob Peterson
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Bob Peterson @ 2016-05-20 16:22 UTC (permalink / raw)
  To: cluster-devel.redhat.com

From: Denys Vlasenko <dvlasenk@redhat.com>

This function compiles to 522 bytes of machine code.

Error paths are not very time critical.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
---
 fs/gfs2/glock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 2897ced..3910cea 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -218,7 +218,7 @@ static void gfs2_holder_wake(struct gfs2_holder *gh)
  *
  */
 
-static inline void do_error(struct gfs2_glock *gl, const int ret)
+static void do_error(struct gfs2_glock *gl, const int ret)
 {
 	struct gfs2_holder *gh, *tmp;
 
-- 
2.5.5



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

* [Cluster-devel] [PATCH 5/9] GFS2: Don't dereference inode in gfs2_inode_lookup until it's valid
  2016-05-20 16:22 [Cluster-devel] [PATCH 0/9] GFS2: Pre-pull patch posting (merge window) Bob Peterson
                   ` (3 preceding siblings ...)
  2016-05-20 16:22 ` [Cluster-devel] [PATCH 4/9] GFS2: fs/gfs2/glock.c: Deinline do_error, save 1856 bytes Bob Peterson
@ 2016-05-20 16:22 ` Bob Peterson
  2016-05-20 16:22 ` [Cluster-devel] [PATCH 6/9] GFS2: Add calls to gfs2_holder_uninit in two error handlers Bob Peterson
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Bob Peterson @ 2016-05-20 16:22 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Function gfs2_inode_lookup was dereferencing the inode, and after,
it checks for the value being NULL. We need to check that first.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
---
 fs/gfs2/inode.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index bb30f9a..aea002e 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -93,12 +93,12 @@ struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned int type,
 	int error;
 
 	inode = iget_locked(sb, (unsigned long)no_addr);
-	ip = GFS2_I(inode);
-	ip->i_no_addr = no_addr;
-
 	if (!inode)
 		return ERR_PTR(-ENOMEM);
 
+	ip = GFS2_I(inode);
+	ip->i_no_addr = no_addr;
+
 	if (inode->i_state & I_NEW) {
 		struct gfs2_sbd *sdp = GFS2_SB(inode);
 		ip->i_no_formal_ino = no_formal_ino;
-- 
2.5.5



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

* [Cluster-devel] [PATCH 6/9] GFS2: Add calls to gfs2_holder_uninit in two error handlers
  2016-05-20 16:22 [Cluster-devel] [PATCH 0/9] GFS2: Pre-pull patch posting (merge window) Bob Peterson
                   ` (4 preceding siblings ...)
  2016-05-20 16:22 ` [Cluster-devel] [PATCH 5/9] GFS2: Don't dereference inode in gfs2_inode_lookup until it's valid Bob Peterson
@ 2016-05-20 16:22 ` Bob Peterson
  2016-05-20 16:22 ` [Cluster-devel] [PATCH 7/9] gfs2: use inode_lock/unlock instead of accessing i_mutex directly Bob Peterson
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Bob Peterson @ 2016-05-20 16:22 UTC (permalink / raw)
  To: cluster-devel.redhat.com

From: Daniel DeFreez <dcdefreez@ucdavis.edu>

This patch fixes two locations that do not call gfs2_holder_uninit
if gfs2_glock_nq returns an error.

Signed-off-by: Daniel DeFreez <dcdefreez@ucdavis.edu>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
---
 fs/gfs2/aops.c | 3 ++-
 fs/gfs2/file.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c
index aa016e4..58dd006 100644
--- a/fs/gfs2/aops.c
+++ b/fs/gfs2/aops.c
@@ -1063,7 +1063,7 @@ static ssize_t gfs2_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
 	gfs2_holder_init(ip->i_gl, LM_ST_DEFERRED, 0, &gh);
 	rv = gfs2_glock_nq(&gh);
 	if (rv)
-		return rv;
+		goto out_uninit;
 	rv = gfs2_ok_for_dio(ip, offset);
 	if (rv != 1)
 		goto out; /* dio not valid, fall back to buffered i/o */
@@ -1102,6 +1102,7 @@ static ssize_t gfs2_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
 				  offset, gfs2_get_block_direct, NULL, NULL, 0);
 out:
 	gfs2_glock_dq(&gh);
+out_uninit:
 	gfs2_holder_uninit(&gh);
 	return rv;
 }
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index fd9a10e..f33fd92 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -160,7 +160,7 @@ static int gfs2_get_flags(struct file *filp, u32 __user *ptr)
 	gfs2_holder_init(ip->i_gl, LM_ST_SHARED, 0, &gh);
 	error = gfs2_glock_nq(&gh);
 	if (error)
-		return error;
+		goto out_uninit;
 
 	fsflags = fsflags_cvt(gfs2_to_fsflags, ip->i_diskflags);
 	if (!S_ISDIR(inode->i_mode) && ip->i_diskflags & GFS2_DIF_JDATA)
@@ -169,6 +169,7 @@ static int gfs2_get_flags(struct file *filp, u32 __user *ptr)
 		error = -EFAULT;
 
 	gfs2_glock_dq(&gh);
+out_uninit:
 	gfs2_holder_uninit(&gh);
 	return error;
 }
-- 
2.5.5



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

* [Cluster-devel] [PATCH 7/9] gfs2: use inode_lock/unlock instead of accessing i_mutex directly
  2016-05-20 16:22 [Cluster-devel] [PATCH 0/9] GFS2: Pre-pull patch posting (merge window) Bob Peterson
                   ` (5 preceding siblings ...)
  2016-05-20 16:22 ` [Cluster-devel] [PATCH 6/9] GFS2: Add calls to gfs2_holder_uninit in two error handlers Bob Peterson
@ 2016-05-20 16:22 ` Bob Peterson
  2016-05-20 16:22 ` [Cluster-devel] [PATCH 8/9] GFS2: Remove allocation parms from gfs2_rbm_find Bob Peterson
  2016-05-20 16:22 ` [Cluster-devel] [PATCH 9/9] GFS2: Refactor gfs2_remove_from_journal Bob Peterson
  8 siblings, 0 replies; 14+ messages in thread
From: Bob Peterson @ 2016-05-20 16:22 UTC (permalink / raw)
  To: cluster-devel.redhat.com

From: Abhi Das <adas@redhat.com>

i_mutex has been replaced by i_rwsem and directly accessing the
non-existent i_mutex breaks the kernel build.

Signed-off-by: Abhi Das <adas@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
---
 fs/gfs2/file.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index f33fd92..374dd53 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -960,16 +960,16 @@ static ssize_t gfs2_file_splice_read(struct file *in, loff_t *ppos,
 	struct gfs2_holder gh;
 	int ret;
 
-	mutex_lock(&inode->i_mutex);
+	inode_lock(inode);
 
 	ret = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, 0, &gh);
 	if (ret) {
-		mutex_unlock(&inode->i_mutex);
+		inode_unlock(inode);
 		return ret;
 	}
 
 	gfs2_glock_dq_uninit(&gh);
-	mutex_unlock(&inode->i_mutex);
+	inode_unlock(inode);
 
 	return generic_file_splice_read(in, ppos, pipe, len, flags);
 }
-- 
2.5.5



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

* [Cluster-devel] [PATCH 8/9] GFS2: Remove allocation parms from gfs2_rbm_find
  2016-05-20 16:22 [Cluster-devel] [PATCH 0/9] GFS2: Pre-pull patch posting (merge window) Bob Peterson
                   ` (6 preceding siblings ...)
  2016-05-20 16:22 ` [Cluster-devel] [PATCH 7/9] gfs2: use inode_lock/unlock instead of accessing i_mutex directly Bob Peterson
@ 2016-05-20 16:22 ` Bob Peterson
  2016-05-20 16:22 ` [Cluster-devel] [PATCH 9/9] GFS2: Refactor gfs2_remove_from_journal Bob Peterson
  8 siblings, 0 replies; 14+ messages in thread
From: Bob Peterson @ 2016-05-20 16:22 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Struct gfs2_alloc_parms ap is never referenced in function
gfs2_rbm_find, so this patch removes it.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
---
 fs/gfs2/rgrp.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 07c0265..8b580e5 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -73,8 +73,7 @@ static const char valid_change[16] = {
 };
 
 static int gfs2_rbm_find(struct gfs2_rbm *rbm, u8 state, u32 *minext,
-			 const struct gfs2_inode *ip, bool nowrap,
-			 const struct gfs2_alloc_parms *ap);
+			 const struct gfs2_inode *ip, bool nowrap);
 
 
 /**
@@ -1512,7 +1511,7 @@ static void rg_mblk_search(struct gfs2_rgrpd *rgd, struct gfs2_inode *ip,
 	if (WARN_ON(gfs2_rbm_from_block(&rbm, goal)))
 		return;
 
-	ret = gfs2_rbm_find(&rbm, GFS2_BLKST_FREE, &extlen, ip, true, ap);
+	ret = gfs2_rbm_find(&rbm, GFS2_BLKST_FREE, &extlen, ip, true);
 	if (ret == 0) {
 		rs->rs_rbm = rbm;
 		rs->rs_free = extlen;
@@ -1639,7 +1638,6 @@ fail:
  * @ip: If set, check for reservations
  * @nowrap: Stop looking at the end of the rgrp, rather than wrapping
  *          around until we've reached the starting point.
- * @ap: the allocation parameters
  *
  * Side effects:
  * - If looking for free blocks, we set GBF_FULL on each bitmap which
@@ -1651,8 +1649,7 @@ fail:
  */
 
 static int gfs2_rbm_find(struct gfs2_rbm *rbm, u8 state, u32 *minext,
-			 const struct gfs2_inode *ip, bool nowrap,
-			 const struct gfs2_alloc_parms *ap)
+			 const struct gfs2_inode *ip, bool nowrap)
 {
 	struct buffer_head *bh;
 	int initial_bii;
@@ -1773,7 +1770,7 @@ static void try_rgrp_unlink(struct gfs2_rgrpd *rgd, u64 *last_unlinked, u64 skip
 	while (1) {
 		down_write(&sdp->sd_log_flush_lock);
 		error = gfs2_rbm_find(&rbm, GFS2_BLKST_UNLINKED, NULL, NULL,
-				      true, NULL);
+				      true);
 		up_write(&sdp->sd_log_flush_lock);
 		if (error == -ENOSPC)
 			break;
@@ -2330,12 +2327,11 @@ int gfs2_alloc_blocks(struct gfs2_inode *ip, u64 *bn, unsigned int *nblocks,
 	int error;
 
 	gfs2_set_alloc_start(&rbm, ip, dinode);
-	error = gfs2_rbm_find(&rbm, GFS2_BLKST_FREE, NULL, ip, false, NULL);
+	error = gfs2_rbm_find(&rbm, GFS2_BLKST_FREE, NULL, ip, false);
 
 	if (error == -ENOSPC) {
 		gfs2_set_alloc_start(&rbm, ip, dinode);
-		error = gfs2_rbm_find(&rbm, GFS2_BLKST_FREE, NULL, NULL, false,
-				      NULL);
+		error = gfs2_rbm_find(&rbm, GFS2_BLKST_FREE, NULL, NULL, false);
 	}
 
 	/* Since all blocks are reserved in advance, this shouldn't happen */
-- 
2.5.5



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

* [Cluster-devel] [PATCH 9/9] GFS2: Refactor gfs2_remove_from_journal
  2016-05-20 16:22 [Cluster-devel] [PATCH 0/9] GFS2: Pre-pull patch posting (merge window) Bob Peterson
                   ` (7 preceding siblings ...)
  2016-05-20 16:22 ` [Cluster-devel] [PATCH 8/9] GFS2: Remove allocation parms from gfs2_rbm_find Bob Peterson
@ 2016-05-20 16:22 ` Bob Peterson
  8 siblings, 0 replies; 14+ messages in thread
From: Bob Peterson @ 2016-05-20 16:22 UTC (permalink / raw)
  To: cluster-devel.redhat.com

This patch makes two simple changes to function gfs2_remove_from_journal.
First, it removes the parameter that specifies the transaction.
Since it's always passed in as current->journal_info, we might as well
set that in the function rather than passing it in. Second, it changes
the meta parameter to use an enum to make the code more clear.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Acked-by: Steven Whitehouse <swhiteho@redhat.com>
---
 fs/gfs2/aops.c    | 2 +-
 fs/gfs2/meta_io.c | 7 ++++---
 fs/gfs2/meta_io.h | 8 ++++++--
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c
index 58dd006..e21a931 100644
--- a/fs/gfs2/aops.c
+++ b/fs/gfs2/aops.c
@@ -977,7 +977,7 @@ static void gfs2_discard(struct gfs2_sbd *sdp, struct buffer_head *bh)
 		if (!list_empty(&bd->bd_list) && !buffer_pinned(bh))
 			list_del_init(&bd->bd_list);
 		else
-			gfs2_remove_from_journal(bh, current->journal_info, 0);
+			gfs2_remove_from_journal(bh, REMOVE_JDATA);
 	}
 	bh->b_bdev = NULL;
 	clear_buffer_mapped(bh);
diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c
index e137d96..8f3f1b8 100644
--- a/fs/gfs2/meta_io.c
+++ b/fs/gfs2/meta_io.c
@@ -325,18 +325,19 @@ int gfs2_meta_wait(struct gfs2_sbd *sdp, struct buffer_head *bh)
 	return 0;
 }
 
-void gfs2_remove_from_journal(struct buffer_head *bh, struct gfs2_trans *tr, int meta)
+void gfs2_remove_from_journal(struct buffer_head *bh, int meta)
 {
 	struct address_space *mapping = bh->b_page->mapping;
 	struct gfs2_sbd *sdp = gfs2_mapping2sbd(mapping);
 	struct gfs2_bufdata *bd = bh->b_private;
+	struct gfs2_trans *tr = current->journal_info;
 	int was_pinned = 0;
 
 	if (test_clear_buffer_pinned(bh)) {
 		trace_gfs2_pin(bd, 0);
 		atomic_dec(&sdp->sd_log_pinned);
 		list_del_init(&bd->bd_list);
-		if (meta)
+		if (meta == REMOVE_META)
 			tr->tr_num_buf_rm++;
 		else
 			tr->tr_num_databuf_rm++;
@@ -376,7 +377,7 @@ void gfs2_meta_wipe(struct gfs2_inode *ip, u64 bstart, u32 blen)
 		if (bh) {
 			lock_buffer(bh);
 			gfs2_log_lock(sdp);
-			gfs2_remove_from_journal(bh, current->journal_info, 1);
+			gfs2_remove_from_journal(bh, REMOVE_META);
 			gfs2_log_unlock(sdp);
 			unlock_buffer(bh);
 			brelse(bh);
diff --git a/fs/gfs2/meta_io.h b/fs/gfs2/meta_io.h
index c5086c8..ffdf6aa 100644
--- a/fs/gfs2/meta_io.h
+++ b/fs/gfs2/meta_io.h
@@ -57,8 +57,12 @@ extern int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags,
 extern int gfs2_meta_wait(struct gfs2_sbd *sdp, struct buffer_head *bh);
 extern struct buffer_head *gfs2_getbuf(struct gfs2_glock *gl, u64 blkno,
 				       int create);
-extern void gfs2_remove_from_journal(struct buffer_head *bh,
-				     struct gfs2_trans *tr, int meta);
+enum {
+	REMOVE_JDATA = 0,
+	REMOVE_META = 1,
+};
+
+extern void gfs2_remove_from_journal(struct buffer_head *bh, int meta);
 extern void gfs2_meta_wipe(struct gfs2_inode *ip, u64 bstart, u32 blen);
 extern int gfs2_meta_indirect_buffer(struct gfs2_inode *ip, int height, u64 num,
 				     struct buffer_head **bhp);
-- 
2.5.5



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

* [Cluster-devel] [PATCH 0/9] GFS2: Pre-pull patch posting (merge window)
@ 2017-05-03 13:45 Bob Peterson
  0 siblings, 0 replies; 14+ messages in thread
From: Bob Peterson @ 2017-05-03 13:45 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

We've got nine GFS2 patches for this merge window.

1. Andreas Gruenbacher wrote a patch to replace the deprecated
   call to rhashtable_walk_init with rhashtable_walk_enter.
2. Andreas also wrote a patch to eliminate redundant code in
   two of our debugfs sequence files.
3. Andreas also cleaned up the rhashtable key ugliness Linus
   pointed out during this cycle, following Linus's suggestions.
4. Andreas also wrote a patch to take advantage of his new
   function rhashtable_lookup_get_insert_fast. This makes glock
   lookup faster and more bullet-proof.
5. Andreas also wrote a patch to revert a patch in the evict
   path that caused occasional deadlocks, and is no longer
   needed.

6. Andrew Price wrote a patch to re-enable fallocate for the
   rindex system file to enable gfs2_grow to grow properly on
   secondary file system grow operations.

7. I wrote a patch to initialize an inode number field to make
   certain kernel trace points more understandable.
8. I also wrote a patch that makes GFS2 file system "withdraw"
   work more like it should by ignoring operations after a
   withdraw that would formerly cause a BUG() and kernel panic.
9. I also reworked the entire truncate/delete algorithm,
   scrapping the old recursive algorithm in favor of a new
   non-recursive algorithm. This was done for performance:
   This way, GFS2 no longer needs to lock multiple resource
   groups while doing truncates and deletes of files that cross
   multiple resource group boundaries, allowing for better
   parallelism. It also solves a problem whereby deleting large
   files would request a large chunk of kernel memory, which
   resulted in a get_page_from_freelist warning.

Regards,

Bob Peterson
---
Andreas Gruenbacher (5):
  gfs2: Replace rhashtable_walk_init with rhashtable_walk_enter
  gfs2: Deduplicate gfs2_{glocks,glstats}_open
  gfs2: Don't pack struct lm_lockname
  gfs2: Switch to rhashtable_lookup_get_insert_fast
  Revert "GFS2: Wait for iopen glock dequeues"

Andrew Price (1):
  gfs2: Re-enable fallocate for the rindex

Bob Peterson (3):
  GFS2: Prevent BUG from occurring when normal Withdraws occur
  GFS2: Temporarily zero i_no_addr when creating a dinode
  GFS2: Non-recursive delete



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

* [Cluster-devel] [PATCH 0/9] GFS2: Pre-pull patch posting (merge window)
@ 2018-04-02 15:44 Bob Peterson
  0 siblings, 0 replies; 14+ messages in thread
From: Bob Peterson @ 2018-04-02 15:44 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

We've only got 9 GFS2 patches for this merge window:

1. Abhi Das contributed a patch to report journal recovery times more
   accurately during journal replay.
2. Andreas Gruenbacher contributed a patch to fix fallocate chunk size.
3. Andreas added a patch to correctly dirty inodes during rename.
4. Andreas added a patch to improve the comment for function gfs2_block_map.
5. Andreas added a patch to improve kernel trace point iomap end:
   The physical block address was added.
6. Andreas added a patch to fix a nasty file system corruption bug that
   surfaced in xfstests 476 in punch-hole/truncate.
7. Andreas fixed a problem Christoph Helwig pointed out, namely, that GFS2
   was misusing the IOMAP_ZERO flag. The zeroing of new blocks was moved
   to the proper fallocate code.
8. I contributed a patch to declare function gfs2_remove_from_ail as static.
9. I added a patch to only set PageChecked for jdata page writes.

Regards,

Bob Peterson
---
Abhi Das (1):
  gfs2: time journal recovery steps accurately

Andreas Gruenbacher (6):
  gfs2: Fix fallocate chunk size
  gfs2: Dirty source inode during rename
  gfs2: Improve gfs2_block_map comment
  gfs2: gfs2_iomap_end tracepoint: log block address
  gfs2: Check for the end of metadata in punch_hole
  gfs2: Zero out fallocated blocks in fallocate_chunk

Bob Peterson (2):
  GFS2: Make function gfs2_remove_from_ail static
  GFS2: Only set PageChecked for jdata pages

 fs/gfs2/aops.c       |  8 ++++----
 fs/gfs2/bmap.c       | 38 ++++++++++++++++++++------------------
 fs/gfs2/dir.c        | 13 ++-----------
 fs/gfs2/file.c       | 34 +++++++++++++++++-----------------
 fs/gfs2/incore.h     |  3 ---
 fs/gfs2/inode.c      | 10 +---------
 fs/gfs2/log.c        |  2 +-
 fs/gfs2/log.h        |  1 -
 fs/gfs2/quota.h      |  2 ++
 fs/gfs2/recovery.c   | 20 ++++++++++++++------
 fs/gfs2/trace_gfs2.h |  9 +++++++--
 11 files changed, 68 insertions(+), 72 deletions(-)

-- 
2.14.3



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

* [Cluster-devel] [PATCH 0/9] GFS2: Pre-pull patch posting (merge window)
@ 2018-06-04 16:29 Bob Peterson
  0 siblings, 0 replies; 14+ messages in thread
From: Bob Peterson @ 2018-06-04 16:29 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

We've got 9 more patches for this merge window.

1. Andreas Gruenbacher contributed a patch to remove sd_jheightsize to
   greatly simplify some code.
2. Andreas fixed some comments.
3. Andreas fixed a glock recursion bug when allocation errors occur.
4. Andreas improved the hole_size function so it returns the entire hole
   rather than figuring it out piecemeal.
5. Andreas cleaned up gfs2_stuffed_write_end to remove a lot of redundancy.
6. Andreas clarified code with regard to the way ordered writes are processed.
7. Andreas did a bunch of improvements and cleanups of the iomap code to
   pave the way for iomap writes, which is a future patch set.
8. I fixed a bug where block reservations can run off the end of a bitmap.
9. I added Andreas to the MAINTAINERS file.

Regards,

Bob Peterson
---
Andreas Gruenbacher (7):
  gfs2: Remove sdp->sd_jheightsize
  gfs2: Update find_metapath comment
  GFS2: Fix allocation error bug with recursive rgrp glocking
  gfs2: hole_size improvement
  gfs2: gfs2_stuffed_write_end cleanup
  gfs2: Remove ordered write mode handling from gfs2_trans_add_data
  gfs2: Iomap cleanups and improvements

Bob Peterson (2):
  GFS2: gfs2_free_extlen can return an extent that is too long
  MAINTAINERS: Add Andreas Gruenbacher as a maintainer for gfs2

 MAINTAINERS          |   2 +-
 fs/gfs2/aops.c       |  69 +++----
 fs/gfs2/bmap.c       | 428 +++++++++++++++++++++++++++----------------
 fs/gfs2/bmap.h       |   6 +-
 fs/gfs2/file.c       |   6 +-
 fs/gfs2/incore.h     |   3 +-
 fs/gfs2/inode.c      |   4 -
 fs/gfs2/log.h        |   7 +-
 fs/gfs2/ops_fstype.c |  19 --
 fs/gfs2/quota.c      |   5 +-
 fs/gfs2/rgrp.c       |   2 +-
 fs/gfs2/trans.c      |  27 +--
 12 files changed, 332 insertions(+), 246 deletions(-)

-- 
2.17.1



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

end of thread, other threads:[~2018-06-04 16:29 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-20 16:22 [Cluster-devel] [PATCH 0/9] GFS2: Pre-pull patch posting (merge window) Bob Peterson
2016-05-20 16:22 ` [Cluster-devel] [PATCH 1/9] GFS2: ignore unlock failures after withdraw Bob Peterson
2016-05-20 16:22 ` [Cluster-devel] [PATCH 2/9] GFS2: Get rid of dead code in inode_go_demote_ok Bob Peterson
2016-05-20 16:22 ` [Cluster-devel] [PATCH 3/9] gfs2: Use gfs2 wrapper to sync inode before calling generic_file_splice_read() Bob Peterson
2016-05-20 16:22 ` [Cluster-devel] [PATCH 4/9] GFS2: fs/gfs2/glock.c: Deinline do_error, save 1856 bytes Bob Peterson
2016-05-20 16:22 ` [Cluster-devel] [PATCH 5/9] GFS2: Don't dereference inode in gfs2_inode_lookup until it's valid Bob Peterson
2016-05-20 16:22 ` [Cluster-devel] [PATCH 6/9] GFS2: Add calls to gfs2_holder_uninit in two error handlers Bob Peterson
2016-05-20 16:22 ` [Cluster-devel] [PATCH 7/9] gfs2: use inode_lock/unlock instead of accessing i_mutex directly Bob Peterson
2016-05-20 16:22 ` [Cluster-devel] [PATCH 8/9] GFS2: Remove allocation parms from gfs2_rbm_find Bob Peterson
2016-05-20 16:22 ` [Cluster-devel] [PATCH 9/9] GFS2: Refactor gfs2_remove_from_journal Bob Peterson
  -- strict thread matches above, loose matches on Subject: below --
2018-06-04 16:29 [Cluster-devel] [PATCH 0/9] GFS2: Pre-pull patch posting (merge window) Bob Peterson
2018-04-02 15:44 Bob Peterson
2017-05-03 13:45 Bob Peterson
2015-04-13 15:10 Bob Peterson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).