linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* GFS2: Pre-pull patch posting
@ 2008-09-26 12:00 Steven Whitehouse
  0 siblings, 0 replies; 21+ messages in thread
From: Steven Whitehouse @ 2008-09-26 12:00 UTC (permalink / raw)
  To: linux-kernel, cluster-devel

I'm guessing that the merge window opening might not be too far
away now, and in any case, I won't have quite my normal internet
access next week. So I'm pushing out the current GFS2 tree so
that (I hope) there will be time to fix any issues.

Again, there are fewer patches here. A lot of them are fairly small
too. The most noteable item deals with the meta filesystem which
was in response to Al Viro's suggestions concerning a better way
to structure that code. It certainly results in a much cleaner
implementation, so thanks go to Al for pointing that out.

A couple of new features: I/O barrier support (needs no user
configuration, see the patch for details) and UUID support
(no code changes, its all userland but we reserve space in
the super block, again details in the patch itself).

I know that I hardly need say, but please let me know if you have any
comments :-)

Steve.



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

* GFS2: Pre-pull patch posting
@ 2008-12-17 11:29 swhiteho
  0 siblings, 0 replies; 21+ messages in thread
From: swhiteho @ 2008-12-17 11:29 UTC (permalink / raw)
  To: linux-kernel, cluster-devel

In preparation for the next merge window, here is the current content
of the GFS2 git tree. Firstly, we have one new feature, which is
support for the FIEMAP ioctl. That patch does touch some code
outside of GFS2 itself, but its the only patch in this series which
does so.

The remaining patches are mostly clean up and bug fixes, as usual.
They are working towards a point where I can submit a patch to finally
merge the lock_dlm module (not dlm itself I should emphasise) into
GFS2. That is a large patch and a preliminary version has already been
posted to cluster-devel. My plan is to put that patch into my -nmw
git tree as the first patch for the following merge window to give
it maximum exposure.

The other highlight of this patch series, is a patch which removes
the two daemons (gfs2_scand and gfs2_glockd) and replaces them with
a "shrinker" routine registered with the VM. As expected, this also
reduces the code size. We are also expecting do do a similar thing
with the GFS2 quota data strucutures at some point in the future.

Steve.



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

* GFS2: Pre-pull patch posting
@ 2009-06-10  8:30 Steven Whitehouse
  0 siblings, 0 replies; 21+ messages in thread
From: Steven Whitehouse @ 2009-06-10  8:30 UTC (permalink / raw)
  To: linux-kernel, cluster-devel

Hi,

As the merge window is more or less upon us, here is the content
of the GFS2 -nmw tree. There is nothing too startling this time
as the focus has very much been bug fixes and clean up.

We have a new mount option, commit= which does exactly the same
thing as the ext3 equivalent option. We have a long term plan to
make all the tunable parameters available as mount options and
thus to be able to eventually drop the sysfs interface to these
parameters.

Another long term plan is to get rid of the files named
ops_somethingorother and to either merge them into other
files, or rename them to not have the ops_ prefix. This
patch series makes a start on that, and does all the easy
ones. As a result some functions with only one caller are
moved to the same file as their caller and made static.

The docs are also updated to reflect the fact that the
lock_dlm interface module no longer exists and that interface is
now built into GFS2.

Steve.



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

* GFS2: Pre-pull patch posting
@ 2009-09-10 11:27 Steven Whitehouse
  2009-09-10 14:46 ` Daniel Walker
  0 siblings, 1 reply; 21+ messages in thread
From: Steven Whitehouse @ 2009-09-10 11:27 UTC (permalink / raw)
  To: linux-kernel, cluster-devel

As merge time is approaching, here is the current content of the
GFS2 -nmw git tree. I'm not expecting to take any more patches
now for the current merge window unless any last minute bugs
are discovered.

There is not a huge amount new this time. Some extra context for
uevent messages, better error handling during block allocation,
and a clean up of extended attribute support. There is still more
to do on the extended attribute side of things, but this is a good
start I think.

There are a few bug fixes as well. Once these patches are merged
I'm intending to start off the next -nmw tree with a patch to
remove some of the (now unused) sysfs files as per the message
on cluster-devel a few weeks back.

Steve.


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

* Re: GFS2: Pre-pull patch posting
  2009-09-10 11:27 Steven Whitehouse
@ 2009-09-10 14:46 ` Daniel Walker
  2009-09-14  7:57   ` Steven Whitehouse
  0 siblings, 1 reply; 21+ messages in thread
From: Daniel Walker @ 2009-09-10 14:46 UTC (permalink / raw)
  To: Steven Whitehouse; +Cc: linux-kernel, cluster-devel

On Thu, 2009-09-10 at 12:27 +0100, Steven Whitehouse wrote:
> As merge time is approaching, here is the current content of the
> GFS2 -nmw git tree. I'm not expecting to take any more patches
> now for the current merge window unless any last minute bugs
> are discovered.
> 
> There is not a huge amount new this time. Some extra context for
> uevent messages, better error handling during block allocation,
> and a clean up of extended attribute support. There is still more
> to do on the extended attribute side of things, but this is a good
> start I think.
> 
> There are a few bug fixes as well. Once these patches are merged
> I'm intending to start off the next -nmw tree with a patch to
> remove some of the (now unused) sysfs files as per the message
> on cluster-devel a few weeks back.

This patch set has a couple of checkpatch issues..

Patch 3,

ERROR: code indent should use tabs where possible
#83: FILE: fs/gfs2/rgrp.c:1466:
+^I        (unsigned long long)rgd->rd_addr);$


Patch 11,

ERROR: trailing whitespace
#741: FILE: fs/gfs2/eattr.c:565:
+^Iif (size) $

and patch 12,

ERROR: trailing whitespace
#2349: FILE: fs/gfs2/xattr.c:565:
+^Iif (size) $

ERROR: space required after that ',' (ctx:VxV)
#2833: FILE: fs/gfs2/xattr.c:1049:
+       return ea_remove_unstuffed(ip, el->el_bh, el->el_ea, el->el_prev,0);

ERROR: code indent should use tabs where possible
#3370: FILE: fs/gfs2/xattr.h:22:
+                                  (sizeof(__be64) * (ea)->ea_num_ptrs)), 8)$

Could you correct these prior to you pull request?

Daniel


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

* Re: GFS2: Pre-pull patch posting
  2009-09-10 14:46 ` Daniel Walker
@ 2009-09-14  7:57   ` Steven Whitehouse
  2009-09-14 14:15     ` Daniel Walker
  0 siblings, 1 reply; 21+ messages in thread
From: Steven Whitehouse @ 2009-09-14  7:57 UTC (permalink / raw)
  To: Daniel Walker; +Cc: linux-kernel, cluster-devel

Hi,

On Thu, 2009-09-10 at 07:46 -0700, Daniel Walker wrote:
> On Thu, 2009-09-10 at 12:27 +0100, Steven Whitehouse wrote:
> > As merge time is approaching, here is the current content of the
> > GFS2 -nmw git tree. I'm not expecting to take any more patches
> > now for the current merge window unless any last minute bugs
> > are discovered.
> > 
> > There is not a huge amount new this time. Some extra context for
> > uevent messages, better error handling during block allocation,
> > and a clean up of extended attribute support. There is still more
> > to do on the extended attribute side of things, but this is a good
> > start I think.
> > 
> > There are a few bug fixes as well. Once these patches are merged
> > I'm intending to start off the next -nmw tree with a patch to
> > remove some of the (now unused) sysfs files as per the message
> > on cluster-devel a few weeks back.
> 
> This patch set has a couple of checkpatch issues..
> 
> Patch 3,
> 
> ERROR: code indent should use tabs where possible
> #83: FILE: fs/gfs2/rgrp.c:1466:
> +^I        (unsigned long long)rgd->rd_addr);$
> 
> 
Now fixed in the latest -nmw tree.

> Patch 11,
> 
> ERROR: trailing whitespace
> #741: FILE: fs/gfs2/eattr.c:565:
> +^Iif (size) $
> 
> and patch 12,
> 
> ERROR: trailing whitespace
> #2349: FILE: fs/gfs2/xattr.c:565:
> +^Iif (size) $
> 
This is the same line of code. There is no need to report it twice.

> ERROR: space required after that ',' (ctx:VxV)
> #2833: FILE: fs/gfs2/xattr.c:1049:
> +       return ea_remove_unstuffed(ip, el->el_bh, el->el_ea, el->el_prev,0);
> 
> ERROR: code indent should use tabs where possible
> #3370: FILE: fs/gfs2/xattr.h:22:
> +                                  (sizeof(__be64) * (ea)->ea_num_ptrs)), 8)$
> 
> Could you correct these prior to you pull request?
> 
> Daniel
> 
The above two are both part of the context rather than something I've
added. I've fixed them anyway though,

Steve.



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

* Re: GFS2: Pre-pull patch posting
  2009-09-14  7:57   ` Steven Whitehouse
@ 2009-09-14 14:15     ` Daniel Walker
  0 siblings, 0 replies; 21+ messages in thread
From: Daniel Walker @ 2009-09-14 14:15 UTC (permalink / raw)
  To: Steven Whitehouse; +Cc: linux-kernel, cluster-devel

On Mon, 2009-09-14 at 08:57 +0100, Steven Whitehouse wrote:

> > ERROR: code indent should use tabs where possible
> > #83: FILE: fs/gfs2/rgrp.c:1466:
> > +^I        (unsigned long long)rgd->rd_addr);$
> > 
> > 
> Now fixed in the latest -nmw tree.
> 

Ok, Thank you.

Daniel


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

* GFS2: Pre-pull patch posting
@ 2010-03-01 15:08 Steven Whitehouse
  0 siblings, 0 replies; 21+ messages in thread
From: Steven Whitehouse @ 2010-03-01 15:08 UTC (permalink / raw)
  To: linux-kernel, cluster-devel

Hi,

Not so many patches for GFS2 this merge window. The bulk of the changes are
aimed at reducing overheads when caching large numbers of inodes and
the consequent simplification of the umount code,

Steve.


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

* GFS2: Pre-pull patch posting
@ 2010-03-11 17:21 Steven Whitehouse
  0 siblings, 0 replies; 21+ messages in thread
From: Steven Whitehouse @ 2010-03-11 17:21 UTC (permalink / raw)
  To: linux-kernel, cluster-devel

Here are three small (but important!) fixes to GFS2.

Steve.


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

* GFS2: Pre-pull patch posting
@ 2010-05-17 12:40 Steven Whitehouse
  0 siblings, 0 replies; 21+ messages in thread
From: Steven Whitehouse @ 2010-05-17 12:40 UTC (permalink / raw)
  To: linux-kernel, cluster-devel

Hi,

Nothing very exciting this time.... mostly minor bug fixes and
a docs update. The gfs2_logd patch has been hanging around for
a long time and is now finally integrated. It is the first step
towards a longer term goal of improving performance in that
area,

Steve.


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

* GFS2: Pre-pull patch posting
@ 2010-08-02  9:27 Steven Whitehouse
  0 siblings, 0 replies; 21+ messages in thread
From: Steven Whitehouse @ 2010-08-02  9:27 UTC (permalink / raw)
  To: linux-kernel, cluster-devel

Hi,

Here is the current content of the GFS2 -nmw git tree. Mostly its
just clean up and bug fixes this time. There is one exception which
is the "wait for journal id" patch which is a new feature aimed
at (eventually) allowing us to simplify the userland support which
GFS2 requires,

Steve.


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

* GFS2: Pre-pull patch posting
@ 2010-10-18 14:15 Steven Whitehouse
  0 siblings, 0 replies; 21+ messages in thread
From: Steven Whitehouse @ 2010-10-18 14:15 UTC (permalink / raw)
  To: linux-kernel, cluster-devel

Hi,

I know the merge window isn't open yet, but at this stage I'm going to
hold off on any larger patches until the following merge window so this
patch set isn't likely to change much, hence kicking it out a bit early
for review.

There are a few interesting points to note in this patch set:
 o GFS2 is updated to use the new truncate sequence
 o Support for fallocate is added
 o Clean up of some unused/obsolete mount options

I'm currently working on a patch to allow the glock hash table
to use RCU. That is currently a work-in-progress and that will
hopefully be ready for the succeeding merge window.

Steve.


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

* GFS2: Pre-pull patch posting
@ 2013-01-03 11:50 Steven Whitehouse
  0 siblings, 0 replies; 21+ messages in thread
From: Steven Whitehouse @ 2013-01-03 11:50 UTC (permalink / raw)
  To: cluster-devel, linux-kernel

Hi,

Here are four small bug fixes for GFS2. There is no common theme here
really, just a few items that were fixed recently. The first fixes
lock name generation when the glock number is 0. The second fixes a
race allocating reservation structures and the final two fix a performance
issue by making small changes in the allocation code,

Steve.


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

* GFS2: Pre-pull patch posting
@ 2013-04-05  9:57 Steven Whitehouse
  2013-04-05  9:57 ` [PATCH 1/6] GFS2: use kmalloc for lvb bitmap Steven Whitehouse
                   ` (5 more replies)
  0 siblings, 6 replies; 21+ messages in thread
From: Steven Whitehouse @ 2013-04-05  9:57 UTC (permalink / raw)
  To: linux-kernel, cluster-devel

Hi,

Here are a few GFS2 fixes which are pending. There are two patches
which fix up a couple of minor issues in the DLM interface code,
a missing error path in gfs2_rs_alloc(), two patches which fix problems
during "withdraw" and a fix for discards/FITRIM when using 4k sector
sized devices,

Steve.



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

* [PATCH 1/6] GFS2: use kmalloc for lvb bitmap
  2013-04-05  9:57 GFS2: Pre-pull patch posting Steven Whitehouse
@ 2013-04-05  9:57 ` Steven Whitehouse
  2013-04-05  9:57 ` [PATCH 2/6] GFS2: use memchr_inv Steven Whitehouse
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 21+ messages in thread
From: Steven Whitehouse @ 2013-04-05  9:57 UTC (permalink / raw)
  To: linux-kernel, cluster-devel; +Cc: David Teigland, Steven Whitehouse

From: David Teigland <teigland@redhat.com>

The temp lvb bitmap was on the stack, which could
be an alignment problem for __set_bit_le.  Use
kmalloc for it instead.

Signed-off-by: David Teigland <teigland@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index 156e42e..5c29216 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -588,6 +588,7 @@ struct lm_lockstruct {
 	struct dlm_lksb ls_control_lksb; /* control_lock */
 	char ls_control_lvb[GDLM_LVB_SIZE]; /* control_lock lvb */
 	struct completion ls_sync_wait; /* {control,mounted}_{lock,unlock} */
+	char *ls_lvb_bits;
 
 	spinlock_t ls_recover_spin; /* protects following fields */
 	unsigned long ls_recover_flags; /* DFL_ */
diff --git a/fs/gfs2/lock_dlm.c b/fs/gfs2/lock_dlm.c
index 9802de0..b15bb45 100644
--- a/fs/gfs2/lock_dlm.c
+++ b/fs/gfs2/lock_dlm.c
@@ -580,7 +580,6 @@ static void gfs2_control_func(struct work_struct *work)
 {
 	struct gfs2_sbd *sdp = container_of(work, struct gfs2_sbd, sd_control_work.work);
 	struct lm_lockstruct *ls = &sdp->sd_lockstruct;
-	char lvb_bits[GDLM_LVB_SIZE];
 	uint32_t block_gen, start_gen, lvb_gen, flags;
 	int recover_set = 0;
 	int write_lvb = 0;
@@ -634,7 +633,7 @@ static void gfs2_control_func(struct work_struct *work)
 		return;
 	}
 
-	control_lvb_read(ls, &lvb_gen, lvb_bits);
+	control_lvb_read(ls, &lvb_gen, ls->ls_lvb_bits);
 
 	spin_lock(&ls->ls_recover_spin);
 	if (block_gen != ls->ls_recover_block ||
@@ -664,10 +663,10 @@ static void gfs2_control_func(struct work_struct *work)
 
 			ls->ls_recover_result[i] = 0;
 
-			if (!test_bit_le(i, lvb_bits + JID_BITMAP_OFFSET))
+			if (!test_bit_le(i, ls->ls_lvb_bits + JID_BITMAP_OFFSET))
 				continue;
 
-			__clear_bit_le(i, lvb_bits + JID_BITMAP_OFFSET);
+			__clear_bit_le(i, ls->ls_lvb_bits + JID_BITMAP_OFFSET);
 			write_lvb = 1;
 		}
 	}
@@ -691,7 +690,7 @@ static void gfs2_control_func(struct work_struct *work)
 				continue;
 			if (ls->ls_recover_submit[i] < start_gen) {
 				ls->ls_recover_submit[i] = 0;
-				__set_bit_le(i, lvb_bits + JID_BITMAP_OFFSET);
+				__set_bit_le(i, ls->ls_lvb_bits + JID_BITMAP_OFFSET);
 			}
 		}
 		/* even if there are no bits to set, we need to write the
@@ -705,7 +704,7 @@ static void gfs2_control_func(struct work_struct *work)
 	spin_unlock(&ls->ls_recover_spin);
 
 	if (write_lvb) {
-		control_lvb_write(ls, start_gen, lvb_bits);
+		control_lvb_write(ls, start_gen, ls->ls_lvb_bits);
 		flags = DLM_LKF_CONVERT | DLM_LKF_VALBLK;
 	} else {
 		flags = DLM_LKF_CONVERT;
@@ -725,7 +724,7 @@ static void gfs2_control_func(struct work_struct *work)
 	 */
 
 	for (i = 0; i < recover_size; i++) {
-		if (test_bit_le(i, lvb_bits + JID_BITMAP_OFFSET)) {
+		if (test_bit_le(i, ls->ls_lvb_bits + JID_BITMAP_OFFSET)) {
 			fs_info(sdp, "recover generation %u jid %d\n",
 				start_gen, i);
 			gfs2_recover_set(sdp, i);
@@ -758,7 +757,6 @@ static void gfs2_control_func(struct work_struct *work)
 static int control_mount(struct gfs2_sbd *sdp)
 {
 	struct lm_lockstruct *ls = &sdp->sd_lockstruct;
-	char lvb_bits[GDLM_LVB_SIZE];
 	uint32_t start_gen, block_gen, mount_gen, lvb_gen;
 	int mounted_mode;
 	int retries = 0;
@@ -857,7 +855,7 @@ locks_done:
 	 * lvb_gen will be non-zero.
 	 */
 
-	control_lvb_read(ls, &lvb_gen, lvb_bits);
+	control_lvb_read(ls, &lvb_gen, ls->ls_lvb_bits);
 
 	if (lvb_gen == 0xFFFFFFFF) {
 		/* special value to force mount attempts to fail */
@@ -887,7 +885,7 @@ locks_done:
 	 * and all lvb bits to be clear (no pending journal recoveries.)
 	 */
 
-	if (!all_jid_bits_clear(lvb_bits)) {
+	if (!all_jid_bits_clear(ls->ls_lvb_bits)) {
 		/* journals need recovery, wait until all are clear */
 		fs_info(sdp, "control_mount wait for journal recovery\n");
 		goto restart;
@@ -949,7 +947,6 @@ static int dlm_recovery_wait(void *word)
 static int control_first_done(struct gfs2_sbd *sdp)
 {
 	struct lm_lockstruct *ls = &sdp->sd_lockstruct;
-	char lvb_bits[GDLM_LVB_SIZE];
 	uint32_t start_gen, block_gen;
 	int error;
 
@@ -991,8 +988,8 @@ restart:
 	memset(ls->ls_recover_result, 0, ls->ls_recover_size*sizeof(uint32_t));
 	spin_unlock(&ls->ls_recover_spin);
 
-	memset(lvb_bits, 0, sizeof(lvb_bits));
-	control_lvb_write(ls, start_gen, lvb_bits);
+	memset(ls->ls_lvb_bits, 0, GDLM_LVB_SIZE);
+	control_lvb_write(ls, start_gen, ls->ls_lvb_bits);
 
 	error = mounted_lock(sdp, DLM_LOCK_PR, DLM_LKF_CONVERT);
 	if (error)
@@ -1022,6 +1019,12 @@ static int set_recover_size(struct gfs2_sbd *sdp, struct dlm_slot *slots,
 	uint32_t old_size, new_size;
 	int i, max_jid;
 
+	if (!ls->ls_lvb_bits) {
+		ls->ls_lvb_bits = kzalloc(GDLM_LVB_SIZE, GFP_NOFS);
+		if (!ls->ls_lvb_bits)
+			return -ENOMEM;
+	}
+
 	max_jid = 0;
 	for (i = 0; i < num_slots; i++) {
 		if (max_jid < slots[i].slot - 1)
@@ -1057,6 +1060,7 @@ static int set_recover_size(struct gfs2_sbd *sdp, struct dlm_slot *slots,
 
 static void free_recover_size(struct lm_lockstruct *ls)
 {
+	kfree(ls->ls_lvb_bits);
 	kfree(ls->ls_recover_submit);
 	kfree(ls->ls_recover_result);
 	ls->ls_recover_submit = NULL;
@@ -1205,6 +1209,7 @@ static int gdlm_mount(struct gfs2_sbd *sdp, const char *table)
 	ls->ls_recover_size = 0;
 	ls->ls_recover_submit = NULL;
 	ls->ls_recover_result = NULL;
+	ls->ls_lvb_bits = NULL;
 
 	error = set_recover_size(sdp, NULL, 0);
 	if (error)
-- 
1.7.4


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

* [PATCH 2/6] GFS2: use memchr_inv
  2013-04-05  9:57 GFS2: Pre-pull patch posting Steven Whitehouse
  2013-04-05  9:57 ` [PATCH 1/6] GFS2: use kmalloc for lvb bitmap Steven Whitehouse
@ 2013-04-05  9:57 ` Steven Whitehouse
  2013-04-05  9:57 ` [PATCH 3/6] GFS2: return error if malloc failed in gfs2_rs_alloc() Steven Whitehouse
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 21+ messages in thread
From: Steven Whitehouse @ 2013-04-05  9:57 UTC (permalink / raw)
  To: linux-kernel, cluster-devel
  Cc: Akinobu Mita, Steven Whitehouse, Christine Caulfield,
	David Teigland

From: Akinobu Mita <akinobu.mita@gmail.com>

Use memchr_inv to verify that the specified memory range is cleared.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: cluster-devel@redhat.com
Cc: Christine Caulfield <ccaulfie@redhat.com>
Cc: David Teigland <teigland@redhat.com>

diff --git a/fs/gfs2/lock_dlm.c b/fs/gfs2/lock_dlm.c
index b15bb45..c8423d6 100644
--- a/fs/gfs2/lock_dlm.c
+++ b/fs/gfs2/lock_dlm.c
@@ -483,12 +483,8 @@ static void control_lvb_write(struct lm_lockstruct *ls, uint32_t lvb_gen,
 
 static int all_jid_bits_clear(char *lvb)
 {
-	int i;
-	for (i = JID_BITMAP_OFFSET; i < GDLM_LVB_SIZE; i++) {
-		if (lvb[i])
-			return 0;
-	}
-	return 1;
+	return !memchr_inv(lvb + JID_BITMAP_OFFSET, 0,
+			GDLM_LVB_SIZE - JID_BITMAP_OFFSET);
 }
 
 static void sync_wait_cb(void *arg)
-- 
1.7.4


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

* [PATCH 3/6] GFS2: return error if malloc failed in gfs2_rs_alloc()
  2013-04-05  9:57 GFS2: Pre-pull patch posting Steven Whitehouse
  2013-04-05  9:57 ` [PATCH 1/6] GFS2: use kmalloc for lvb bitmap Steven Whitehouse
  2013-04-05  9:57 ` [PATCH 2/6] GFS2: use memchr_inv Steven Whitehouse
@ 2013-04-05  9:57 ` Steven Whitehouse
  2013-04-05  9:57 ` [PATCH 4/6] GFS2: Fix unlock of fcntl locks during withdrawn state Steven Whitehouse
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 21+ messages in thread
From: Steven Whitehouse @ 2013-04-05  9:57 UTC (permalink / raw)
  To: linux-kernel, cluster-devel; +Cc: Wei Yongjun, Steven Whitehouse

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

The error code in gfs2_rs_alloc() is set to ENOMEM when error
but never be used, instead, gfs2_rs_alloc() always return 0.
Fix to return 'error'.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index d1f51fd..70d1cd0 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -576,7 +576,7 @@ int gfs2_rs_alloc(struct gfs2_inode *ip)
 	RB_CLEAR_NODE(&ip->i_res->rs_node);
 out:
 	up_write(&ip->i_rw_mutex);
-	return 0;
+	return error;
 }
 
 static void dump_rs(struct seq_file *seq, const struct gfs2_blkreserv *rs)
-- 
1.7.4


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

* [PATCH 4/6] GFS2: Fix unlock of fcntl locks during withdrawn state
  2013-04-05  9:57 GFS2: Pre-pull patch posting Steven Whitehouse
                   ` (2 preceding siblings ...)
  2013-04-05  9:57 ` [PATCH 3/6] GFS2: return error if malloc failed in gfs2_rs_alloc() Steven Whitehouse
@ 2013-04-05  9:57 ` Steven Whitehouse
  2013-04-05  9:57 ` [PATCH 5/6] " Steven Whitehouse
  2013-04-05  9:57 ` [PATCH 6/6] GFS2: Issue discards in 512b sectors Steven Whitehouse
  5 siblings, 0 replies; 21+ messages in thread
From: Steven Whitehouse @ 2013-04-05  9:57 UTC (permalink / raw)
  To: linux-kernel, cluster-devel; +Cc: Steven Whitehouse

When withdraw occurs, we need to continue to allow unlocks of fcntl
locks to occur, however these will only be local, since the node has
withdrawn from the cluster. This prevents triggering a VFS level
bug trap due to locks remaining when a file is closed.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 019f45e..d79c2da 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -923,8 +923,11 @@ static int gfs2_lock(struct file *file, int cmd, struct file_lock *fl)
 		cmd = F_SETLK;
 		fl->fl_type = F_UNLCK;
 	}
-	if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
+	if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) {
+		if (fl->fl_type == F_UNLCK)
+			posix_lock_file_wait(file, fl);
 		return -EIO;
+	}
 	if (IS_GETLK(cmd))
 		return dlm_posix_get(ls->ls_dlm, ip->i_no_addr, file, fl);
 	else if (fl->fl_type == F_UNLCK)
-- 
1.7.4


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

* [PATCH 5/6] GFS2: Fix unlock of fcntl locks during withdrawn state
  2013-04-05  9:57 GFS2: Pre-pull patch posting Steven Whitehouse
                   ` (3 preceding siblings ...)
  2013-04-05  9:57 ` [PATCH 4/6] GFS2: Fix unlock of fcntl locks during withdrawn state Steven Whitehouse
@ 2013-04-05  9:57 ` Steven Whitehouse
  2013-04-05  9:57 ` [PATCH 6/6] GFS2: Issue discards in 512b sectors Steven Whitehouse
  5 siblings, 0 replies; 21+ messages in thread
From: Steven Whitehouse @ 2013-04-05  9:57 UTC (permalink / raw)
  To: linux-kernel, cluster-devel; +Cc: David Teigland, Steven Whitehouse

From: David Teigland <teigland@redhat.com>

This reminded me of another old patch I had sitting around which I never
had a chance to test.  I copied this idea from the nfs code.  The problem
is that when the kernel clears flocks/plocks during close, it calls posix
unlock even if there are no posix locks on the file.  Without this patch,
that extraneous unlock propagates up to controld, across the cluster, and
back down to the kernel.  That can amount to a lot of plock activity on a
fs that may have never used a single plock (only flocks).  With this
patch, we should detect that the unlock is extraneous (since it doesn't
exist in the vfs), and skip all the userland traffic.

Signed-off-by: David Teigland <teigland@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

diff --git a/fs/dlm/plock.c b/fs/dlm/plock.c
index 01fd5c1..f704458 100644
--- a/fs/dlm/plock.c
+++ b/fs/dlm/plock.c
@@ -247,6 +247,7 @@ int dlm_posix_unlock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
 	struct dlm_ls *ls;
 	struct plock_op *op;
 	int rv;
+	unsigned char fl_flags = fl->fl_flags;
 
 	ls = dlm_find_lockspace_local(lockspace);
 	if (!ls)
@@ -258,9 +259,18 @@ int dlm_posix_unlock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
 		goto out;
 	}
 
-	if (posix_lock_file_wait(file, fl) < 0)
-		log_error(ls, "dlm_posix_unlock: vfs unlock error %llx",
-			  (unsigned long long)number);
+	/* cause the vfs unlock to return ENOENT if lock is not found */
+	fl->fl_flags |= FL_EXISTS;
+
+	rv = posix_lock_file_wait(file, fl);
+	if (rv == -ENOENT) {
+		rv = 0;
+		goto out_free;
+	}
+	if (rv < 0) {
+		log_error(ls, "dlm_posix_unlock: vfs unlock error %d %llx",
+			  rv, (unsigned long long)number);
+	}
 
 	op->info.optype		= DLM_PLOCK_OP_UNLOCK;
 	op->info.pid		= fl->fl_pid;
@@ -296,9 +306,11 @@ int dlm_posix_unlock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
 	if (rv == -ENOENT)
 		rv = 0;
 
+out_free:
 	kfree(op);
 out:
 	dlm_put_lockspace(ls);
+	fl->fl_flags = fl_flags;
 	return rv;
 }
 EXPORT_SYMBOL_GPL(dlm_posix_unlock);
-- 
1.7.4


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

* [PATCH 6/6] GFS2: Issue discards in 512b sectors
  2013-04-05  9:57 GFS2: Pre-pull patch posting Steven Whitehouse
                   ` (4 preceding siblings ...)
  2013-04-05  9:57 ` [PATCH 5/6] " Steven Whitehouse
@ 2013-04-05  9:57 ` Steven Whitehouse
  5 siblings, 0 replies; 21+ messages in thread
From: Steven Whitehouse @ 2013-04-05  9:57 UTC (permalink / raw)
  To: linux-kernel, cluster-devel; +Cc: Bob Peterson, Steven Whitehouse

From: Bob Peterson <rpeterso@redhat.com>

This patch changes GFS2's discard issuing code so that it calls
function sb_issue_discard rather than blkdev_issue_discard. The
code was calling blkdev_issue_discard and specifying the correct
sector offset and sector size, but blkdev_issue_discard expects
these values to be in terms of 512 byte sectors, even if the native
sector size for the device is different. Calling sb_issue_discard
with the BLOCK size instead ensures the correct block-to-512b-sector
translation. I verified that "minlen" is specified in blocks, so
comparing it to a number of blocks is correct.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 70d1cd0..5a51265 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -1181,12 +1181,9 @@ int gfs2_rgrp_send_discards(struct gfs2_sbd *sdp, u64 offset,
 			     const struct gfs2_bitmap *bi, unsigned minlen, u64 *ptrimmed)
 {
 	struct super_block *sb = sdp->sd_vfs;
-	struct block_device *bdev = sb->s_bdev;
-	const unsigned int sects_per_blk = sdp->sd_sb.sb_bsize /
-					   bdev_logical_block_size(sb->s_bdev);
 	u64 blk;
 	sector_t start = 0;
-	sector_t nr_sects = 0;
+	sector_t nr_blks = 0;
 	int rv;
 	unsigned int x;
 	u32 trimmed = 0;
@@ -1206,35 +1203,34 @@ int gfs2_rgrp_send_discards(struct gfs2_sbd *sdp, u64 offset,
 		if (diff == 0)
 			continue;
 		blk = offset + ((bi->bi_start + x) * GFS2_NBBY);
-		blk *= sects_per_blk; /* convert to sectors */
 		while(diff) {
 			if (diff & 1) {
-				if (nr_sects == 0)
+				if (nr_blks == 0)
 					goto start_new_extent;
-				if ((start + nr_sects) != blk) {
-					if (nr_sects >= minlen) {
-						rv = blkdev_issue_discard(bdev,
-							start, nr_sects,
+				if ((start + nr_blks) != blk) {
+					if (nr_blks >= minlen) {
+						rv = sb_issue_discard(sb,
+							start, nr_blks,
 							GFP_NOFS, 0);
 						if (rv)
 							goto fail;
-						trimmed += nr_sects;
+						trimmed += nr_blks;
 					}
-					nr_sects = 0;
+					nr_blks = 0;
 start_new_extent:
 					start = blk;
 				}
-				nr_sects += sects_per_blk;
+				nr_blks++;
 			}
 			diff >>= 2;
-			blk += sects_per_blk;
+			blk++;
 		}
 	}
-	if (nr_sects >= minlen) {
-		rv = blkdev_issue_discard(bdev, start, nr_sects, GFP_NOFS, 0);
+	if (nr_blks >= minlen) {
+		rv = sb_issue_discard(sb, start, nr_blks, GFP_NOFS, 0);
 		if (rv)
 			goto fail;
-		trimmed += nr_sects;
+		trimmed += nr_blks;
 	}
 	if (ptrimmed)
 		*ptrimmed = trimmed;
-- 
1.7.4


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

* GFS2: Pre-pull patch posting
@ 2015-02-10 10:36 Steven Whitehouse
  0 siblings, 0 replies; 21+ messages in thread
From: Steven Whitehouse @ 2015-02-10 10:36 UTC (permalink / raw)
  To: linux-kernel, cluster-devel

This time we have mostly clean ups. There is a bug fix for a NULL dereference
relating to ACLs, and another which improves (but does not fix entirely) an
allocation fall-back code path. The other three patches are small clean ups.

Steve.


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

end of thread, other threads:[~2015-02-10 10:36 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-05  9:57 GFS2: Pre-pull patch posting Steven Whitehouse
2013-04-05  9:57 ` [PATCH 1/6] GFS2: use kmalloc for lvb bitmap Steven Whitehouse
2013-04-05  9:57 ` [PATCH 2/6] GFS2: use memchr_inv Steven Whitehouse
2013-04-05  9:57 ` [PATCH 3/6] GFS2: return error if malloc failed in gfs2_rs_alloc() Steven Whitehouse
2013-04-05  9:57 ` [PATCH 4/6] GFS2: Fix unlock of fcntl locks during withdrawn state Steven Whitehouse
2013-04-05  9:57 ` [PATCH 5/6] " Steven Whitehouse
2013-04-05  9:57 ` [PATCH 6/6] GFS2: Issue discards in 512b sectors Steven Whitehouse
  -- strict thread matches above, loose matches on Subject: below --
2015-02-10 10:36 GFS2: Pre-pull patch posting Steven Whitehouse
2013-01-03 11:50 Steven Whitehouse
2010-10-18 14:15 Steven Whitehouse
2010-08-02  9:27 Steven Whitehouse
2010-05-17 12:40 Steven Whitehouse
2010-03-11 17:21 Steven Whitehouse
2010-03-01 15:08 Steven Whitehouse
2009-09-10 11:27 Steven Whitehouse
2009-09-10 14:46 ` Daniel Walker
2009-09-14  7:57   ` Steven Whitehouse
2009-09-14 14:15     ` Daniel Walker
2009-06-10  8:30 Steven Whitehouse
2008-12-17 11:29 swhiteho
2008-09-26 12:00 Steven Whitehouse

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).