diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2006-08-24 22:29:46 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-08-24 22:29:46 -0700 |
commit | 62250b3bb596ffbae17c4b3d865fecd6329ce8b3 (patch) | |
tree | 8f18da918c319a1f0be6c4011b60091bb29dc007 /fs/lockd/svcsubs.c | |
parent | 428a7e3e46a465a6cfe7ccbe15d7ea03a043a95a (diff) | |
parent | a969fd5a4e162c4485ae8f3e49d674656a18fa36 (diff) |
Merge branch 'fixes' of git://git.linux-nfs.org/pub/linux/nfs-2.6
Diffstat (limited to 'fs/lockd/svcsubs.c')
-rw-r--r-- | fs/lockd/svcsubs.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/fs/lockd/svcsubs.c b/fs/lockd/svcsubs.c index 2a4df9b3779..01b4db9e546 100644 --- a/fs/lockd/svcsubs.c +++ b/fs/lockd/svcsubs.c @@ -237,19 +237,22 @@ static int nlm_traverse_files(struct nlm_host *host, int action) { struct nlm_file *file, **fp; - int i; + int i, ret = 0; mutex_lock(&nlm_file_mutex); for (i = 0; i < FILE_NRHASH; i++) { fp = nlm_files + i; while ((file = *fp) != NULL) { + file->f_count++; + mutex_unlock(&nlm_file_mutex); + /* Traverse locks, blocks and shares of this file * and update file->f_locks count */ - if (nlm_inspect_file(host, file, action)) { - mutex_unlock(&nlm_file_mutex); - return 1; - } + if (nlm_inspect_file(host, file, action)) + ret = 1; + mutex_lock(&nlm_file_mutex); + file->f_count--; /* No more references to this file. Let go of it. */ if (!file->f_blocks && !file->f_locks && !file->f_shares && !file->f_count) { @@ -262,7 +265,7 @@ nlm_traverse_files(struct nlm_host *host, int action) } } mutex_unlock(&nlm_file_mutex); - return 0; + return ret; } /* |