Skip to content
Snippets Groups Projects
Commit 46cd5b6f authored by Wang Di's avatar Wang Di
Browse files

Branch: HEAD

add flock fix patch of Donm
fix about build warning in lustre_dlm.h
parent 404dd95c
No related branches found
No related tags found
No related merge requests found
...@@ -687,7 +687,7 @@ static inline void check_res_locked(struct ldlm_resource *res) ...@@ -687,7 +687,7 @@ static inline void check_res_locked(struct ldlm_resource *res)
{ {
LASSERT_SPIN_LOCKED(&res->lr_lock); LASSERT_SPIN_LOCKED(&res->lr_lock);
} }
#ifdef __KERNEL__
static inline void lock_bitlock(struct ldlm_lock *lock) static inline void lock_bitlock(struct ldlm_lock *lock)
{ {
bit_spin_lock(LDLM_FL_LOCK_PROTECT_BIT, (void *) &lock->l_flags); bit_spin_lock(LDLM_FL_LOCK_PROTECT_BIT, (void *) &lock->l_flags);
...@@ -701,7 +701,7 @@ static inline void unlock_bitlock(struct ldlm_lock *lock) ...@@ -701,7 +701,7 @@ static inline void unlock_bitlock(struct ldlm_lock *lock)
lock->l_pidb = 0; lock->l_pidb = 0;
bit_spin_unlock(LDLM_FL_LOCK_PROTECT_BIT, (void *) &lock->l_flags); bit_spin_unlock(LDLM_FL_LOCK_PROTECT_BIT, (void *) &lock->l_flags);
} }
#endif
struct ldlm_resource * lock_res_and_lock(struct ldlm_lock *lock); struct ldlm_resource * lock_res_and_lock(struct ldlm_lock *lock);
void unlock_res_and_lock(struct ldlm_lock *lock); void unlock_res_and_lock(struct ldlm_lock *lock);
......
Index: linux-2.6.10-base/fs/locks.c
===================================================================
--- linux-2.6.10-base.orig/fs/locks.c 2005-09-16 01:45:22.000000000 +0800
+++ linux-2.6.10-base/fs/locks.c 2005-09-16 01:45:48.000000000 +0800
@@ -1819,14 +1819,6 @@
{
struct file_lock lock, **before;
- /*
- * If there are no locks held on this file, we don't need to call
- * posix_lock_file(). Another process could be setting a lock on this
- * file at the same time, but we wouldn't remove that lock anyway.
- */
- before = &filp->f_dentry->d_inode->i_flock;
- if (*before == NULL)
- return;
lock.fl_type = F_UNLCK;
lock.fl_flags = FL_POSIX;
@@ -1843,6 +1835,15 @@
goto out;
}
+ /*
+ * If there are no locks held on this file, we don't need to call
+ * posix_lock_file(). Another process could be setting a lock on this
+ * file at the same time, but we wouldn't remove that lock anyway.
+ */
+ before = &filp->f_dentry->d_inode->i_flock;
+ if (*before == NULL)
+ return;
+
/* Can't use posix_lock_file here; we need to remove it no matter
* which pid we have.
*/
...@@ -27,4 +27,4 @@ vfs-intent_release_umount-vanilla-2.6.10-fc3.patch ...@@ -27,4 +27,4 @@ vfs-intent_release_umount-vanilla-2.6.10-fc3.patch
vfs-umount_lustre-vanilla-2.6.10-fc3.patch vfs-umount_lustre-vanilla-2.6.10-fc3.patch
nid-2.6-fc3.patch nid-2.6-fc3.patch
pag-basic-2.6.10-fc3.patch pag-basic-2.6.10-fc3.patch
linux-2.6.10-flock.patch
...@@ -33,3 +33,4 @@ highmem-split-2.6.10-fc3.patch ...@@ -33,3 +33,4 @@ highmem-split-2.6.10-fc3.patch
pag-basic-2.6.10-fc3.patch pag-basic-2.6.10-fc3.patch
sd_iostats-2.6-rhel4.patch sd_iostats-2.6-rhel4.patch
scsi-max-phys-segments-256.patch scsi-max-phys-segments-256.patch
linux-2.6.10-flock.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment