15 Jul, 2009
1 commit
-
In the tcp_connect_to_sock() error exit path, the socket
allocated at the top of the function was not being freed.Signed-off-by: Casey Dahlin
Signed-off-by: David Teigland
19 Jun, 2009
1 commit
-
Fix a regression from the original addition of nfs lock support
586759f03e2e9031ac5589912a51a909ed53c30a. When a synchronous
(non-nfs) plock completes, the waiting thread will wake up and
free the op struct. This races with the user thread in
dev_write() which goes on to read the op's callback field to
check if the lock is async and needs a callback. This check
can happen on the freed op. The fix is to note the callback
value before the op can be freed.Signed-off-by: David Teigland
18 Jun, 2009
1 commit
-
CC [M] fs/dlm/lock.o
fs/dlm/lock.c: In function ‘find_rsb’:
fs/dlm/lock.c:438: warning: ‘r’ may be used uninitialized in this functionSince r is used on the error path to set r_ret, set it to NULL.
Signed-off-by: Steven Whitehouse
Signed-off-by: David Teigland
16 May, 2009
1 commit
-
Change some GFP_KERNEL allocations to use either GFP_NOFS or
ls_allocation (when available) which the fs sets to GFP_NOFS.
The point is to prevent allocations from going back into the
cluster fs in places where that might lead to deadlock.Signed-off-by: David Teigland
15 May, 2009
1 commit
-
Make network connections to other nodes earlier, in the context of
dlm_recoverd. This avoids connecting to nodes from dlm_send where we
try to avoid allocations which could possibly deadlock if memory reclaim
goes into the cluster fs which may try to do a dlm operation.Signed-off-by: Christine Caulfield
Signed-off-by: David Teigland
07 May, 2009
2 commits
-
When a lockspace was joined multiple times, the global dlm
use count was incremented when it should not have been. This
caused the global dlm threads to not be stopped when all
lockspaces were eventually be removed.Signed-off-by: David Teigland
-
| fs/gfs2/lock_dlm.c:207: warning: passing argument 1 of 'dlm_new_lockspace' discards qualifiers from pointer target type
Signed-off-by: Geert Uytterhoeven
Signed-off-by: David Teigland
12 Mar, 2009
4 commits
-
Using offsetof() to calculate name length does not work because
it does not produce consistent results with with structure packing.
This caused memcpy to corrupt memory by copying 4 extra bytes off
the end of the buffer on 64 bit kernels with 32 bit userspace
(the only case where this 32/64 compat code is used).The fix is to calculate name length directly from the start instead
of trying to derive it later using count and offsetof.Signed-off-by: David Teigland
-
Return immediately from dlm_unlock(CANCEL) if the lock is
granted and not being converted; there's nothing to cancel.Signed-off-by: David Teigland
-
When a conversion completes successfully and finds that a cancel
of the convert is still in progress (which is now a moot point),
preemptively clear the state associated with outstanding cancel.
That state could cause a subsequent conversion to be ignored.Also, improve the consistency and content of error and debug
messages in this area.Signed-off-by: David Teigland
-
Integer nodeids can be too large for the idr code; use a hash
table instead.Signed-off-by: Christine Caulfield
Signed-off-by: David Teigland
29 Jan, 2009
3 commits
-
Signed-off-by: Joe Perches
Signed-off-by: David Teigland -
Signed-off-by: Joe Perches
Signed-off-by: David Teigland -
The ls_dirtbl[].lock was an rwlock, but since it was only used in write
mode a spinlock will suffice.Signed-off-by: Steven Whitehouse
Signed-off-by: David Teigland
22 Jan, 2009
2 commits
-
dlm_posix_get fills out the relevant fields in the file_lock before
returning when there is a lock conflict, but doesn't clean out any of
the other fields in the file_lock.When nfsd does a NFSv4 lockt call, it sets the fl_lmops to
nfsd_posix_mng_ops before calling the lower fs. When the lock comes back
after testing a lock on GFS2, it still has that field set. This confuses
nfsd into thinking that the file_lock is a nfsd4 lock.Fix this by making DLM reinitialize the file_lock before copying the
fields from the conflicting lock.Signed-off-by: Jeff Layton
Signed-off-by: David Teigland -
We should use the original copy of the file_lock, fl, instead
of the copy, flc in the lockd notify callback. The range in flc has
been modified by posix_lock_file(), so it will not match a copy of the
lock in lockd.Signed-off-by: David Teigland
09 Jan, 2009
2 commits
-
The rwlock is almost always used in write mode, so there's no reason
to not use a spinlock instead.Signed-off-by: David Teigland
-
The old code would leak iterators and leave reference counts on
rsbs because it was ignoring the "stop" seq callback. The code
followed an example that used the seq operations differently.
This new code is based on actually understanding how the seq
operations work. It also improves things by saving the hash bucket
in the position to avoid cycling through completed buckets in start.Siged-off-by: Davd Teigland
06 Jan, 2009
1 commit
-
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm:
dlm: fs/dlm/ast.c: fix warning
dlm: add new debugfs entry
dlm: add time stamp of blocking callback
dlm: change lock time stamping
dlm: improve how bast mode handling
dlm: remove extra blocking callback check
dlm: replace schedule with cond_resched
dlm: remove kmap/kunmap
dlm: trivial annotation of be16 value
dlm: fix up memory allocation flags
24 Dec, 2008
10 commits
-
fs/dlm/ast.c: In function 'dlm_astd':
fs/dlm/ast.c:64: warning: 'bastmode' may be used uninitialized in this functionCleans code up.
Signed-off-by: Andrew Morton
Signed-off-by: David Teigland -
The new debugfs entry dumps all rsb and lkb structures, and includes
a lot more information than has been available before. This includes
the new timestamps added by a previous patch for debugging callback
issues.Signed-off-by: David Teigland
-
Record the time the latest blocking callback was queued for
a lock. This will be used for debugging in combination with
lock queue timestamp changes in the previous patch.Signed-off-by: David Teigland
-
Use ktime instead of jiffies for timestamping lkb's. Also stamp the
time on every lkb whenever it's added to a resource queue, instead of
just stamping locks subject to timeouts. This will allow us to use
timestamps more widely for debugging all locks.Signed-off-by: David Teigland
-
The lkb bastmode value is set in the context of processing the
lock, and read by the dlm_astd thread. Because it's accessed
in these two separate contexts, the writing/reading ought to
be done under a lock. This is simple to do by setting it and
reading it when the lkb is added to and removed from dlm_astd's
callback list which is properly locked.Signed-off-by: David Teigland
-
Just before delivering a blocking callback (bast), the dlm_astd
thread checks again that the granted mode of the lkb actually
blocks the mode requested by the bast. The idea behind this was
originally that the granted mode may have changed since the bast
was queued, making the callback now unnecessary. Reasons for
removing this extra check are:
- dlm_astd doesn't lock the rsb before reading the lkb grmode, so
it's not technically safe (this removes the long standing FIXME)
- after running some tests, it doesn't appear the check ever actually
eliminates a bast
- delivering an unnecessary blocking callback isn't a bad thing and
can happen anywaySigned-off-by: David Teigland
-
This is a one-liner to use cond_resched() rather than schedule()
in the ast delivery loop. It should not be necessary to schedule
every time, so this will save some cpu time while continuing to
allow scheduling when required.Signed-off-by: Steven Whitehouse
Signed-off-by: David Teigland -
The pages used in lowcomms are not highmem, so kmap is not necessary.
Cc: Christine Caulfield
Signed-off-by: Steven Whitehouse
Signed-off-by: David Teigland -
fs/dlm/dir.c:419:14: warning: incorrect type in assignment (different base types)
fs/dlm/dir.c:419:14: expected unsigned short [unsigned] [addressable] [assigned] [usertype] be_namelen
fs/dlm/dir.c:419:14: got restricted __be16 [usertype]Signed-off-by: Harvey Harrison
Signed-off-by: David Teigland -
Use ls_allocation for memory allocations, which a cluster fs sets to
GFP_NOFS. Use GFP_NOFS for allocations when no lockspace struct is
available. Taking dlm locks needs to avoid calling back into the
cluster fs because write-out can require taking dlm locks.Cc: Christine Caulfield
Signed-off-by: Steven Whitehouse
Signed-off-by: David Teigland
26 Nov, 2008
1 commit
-
this warning:
fs/dlm/netlink.c: In function ‘dlm_timeout_warn’:
fs/dlm/netlink.c:131: warning: ‘send_skb’ may be used uninitialized in this functiontriggers because GCC does not recognize the (correct) error flow
between prepare_data() and send_skb.Annotate it.
Signed-off-by: Ingo Molnar
Signed-off-by: David S. Miller
14 Nov, 2008
1 commit
-
Fixes a regression from commit 0f8e0d9a317406612700426fad3efab0b7bbc467,
"dlm: allow multiple lockspace creates".An extraneous 'else' slipped into a code fragment being moved from
release_lockspace() to dlm_release_lockspace(). The result of the
unwanted 'else' is that dlm threads and structures are not stopped
and cleaned up when the final dlm lockspace is removed. Trying to
create a new lockspace again afterward will fail with
"kmem_cache_create: duplicate cache dlm_conn" because the cache
was not previously destroyed.Signed-off-by: David Teigland
05 Sep, 2008
2 commits
-
sparc32:
fs/dlm/config.c:397: error: expected identifier or '(' before '{' token
fs/dlm/config.c: In function 'drop_node':
fs/dlm/config.c:589: warning: initialization from incompatible pointer type
fs/dlm/config.c:589: warning: initialization from incompatible pointer type
fs/dlm/config.c: In function 'release_node':
fs/dlm/config.c:601: warning: initialization from incompatible pointer type
fs/dlm/config.c:601: warning: initialization from incompatible pointer type
fs/dlm/config.c: In function 'show_node':
fs/dlm/config.c:717: warning: initialization from incompatible pointer type
fs/dlm/config.c:717: warning: initialization from incompatible pointer type
fs/dlm/config.c: In function 'store_node':
fs/dlm/config.c:726: warning: initialization from incompatible pointer type
fs/dlm/config.c:726: warning: initialization from incompatible pointer typeCc: Christine Caulfield
Signed-off-by: Andrew Morton
Signed-off-by: David Teigland -
BLK from recent pushdown is not needed.
Signed-off-by: David Teigland
03 Sep, 2008
1 commit
-
Compare only the addr and port fields of sockaddr structures.
Fixes a problem with ipv6 where sin6_scope_id does not match.Signed-off-by: David Teigland
29 Aug, 2008
3 commits
-
The dlm_scand thread needs to lock the list of lockspaces
when going through it.Signed-off-by: David Teigland
-
If dlm_controld (the userspace daemon that controls the setup and
recovery of the dlm) fails, the kernel should shut down the lockspaces
in the kernel rather than leaving them running. This is detected by
having dlm_controld hold a misc device open while running, and if
the kernel detects a close while the daemon is still needed, it stops
the lockspaces in the kernel.Knowing that the userspace daemon isn't running also allows the
lockspace create/remove routines to avoid waiting on the daemon
for join/leave operations.Signed-off-by: David Teigland
-
Add a count for lockspace create and release so that create can
be called multiple times to use the lockspace from different places.
Also add the new flag DLM_LSFL_NEWEXCL to create a lockspace with
the previous behavior of returning -EEXIST if the lockspace already
exists.Signed-off-by: David Teigland
14 Aug, 2008
2 commits
-
Add a dlm_ prefix to the struct names in config.c. This resolves a
conflict with struct node in particular, when include/linux/node.h
happens to be included.Reported-by: Andrew Morton
Signed-off-by: David Teigland -
A couple of unlikely error conditions were missing a kfree on the error
exit path.Reported-by: Juha Leppanen
Signed-off-by: David Teigland
29 Jul, 2008
1 commit
-
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm:
dlm: fix uninitialized variable for search_rsb_list callers
dlm: release socket on error
dlm: fix basts for granted CW waiting PR/CW
dlm: check for null in device_write