diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-15 19:07:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-15 19:07:40 -0400 |
commit | 541010e4b8921cd781ff02ae68028501457045b6 (patch) | |
tree | 58bd529d4c6e69899a0aa20afa2d7f1c23326417 /fs/nfsd | |
parent | e457f790d8b05977853aa238bbc667b3bb375671 (diff) | |
parent | 5e7fc436426b1f9e106f511a049de91c82ec2c53 (diff) |
Merge branch 'locks' of git://linux-nfs.org/~bfields/linux
* 'locks' of git://linux-nfs.org/~bfields/linux:
nfsd: remove IS_ISMNDLCK macro
Rework /proc/locks via seq_files and seq_list helpers
fs/locks.c: use list_for_each_entry() instead of list_for_each()
NFS: clean up explicit check for mandatory locks
AFS: clean up explicit check for mandatory locks
9PFS: clean up explicit check for mandatory locks
GFS2: clean up explicit check for mandatory locks
Cleanup macros for distinguishing mandatory locks
Documentation: move locks.txt in filesystems/
locks: add warning about mandatory locking races
Documentation: move mandatory locking documentation to filesystems/
locks: Fix potential OOPS in generic_setlease()
Use list_first_entry in locks_wake_up_blocks
locks: fix flock_lock_file() comment
Memory shortage can result in inconsistent flocks state
locks: kill redundant local variable
locks: reverse order of posix_locks_conflict() arguments
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4state.c | 2 | ||||
-rw-r--r-- | fs/nfsd/vfs.c | 13 |
2 files changed, 7 insertions, 8 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 6f182d25793d..31673cd251c3 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -2035,7 +2035,7 @@ static inline int | |||
2035 | io_during_grace_disallowed(struct inode *inode, int flags) | 2035 | io_during_grace_disallowed(struct inode *inode, int flags) |
2036 | { | 2036 | { |
2037 | return nfs4_in_grace() && (flags & (RD_STATE | WR_STATE)) | 2037 | return nfs4_in_grace() && (flags & (RD_STATE | WR_STATE)) |
2038 | && MANDATORY_LOCK(inode); | 2038 | && mandatory_lock(inode); |
2039 | } | 2039 | } |
2040 | 2040 | ||
2041 | /* | 2041 | /* |
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index cec78c82b1f9..2a8d665b134b 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -61,12 +61,6 @@ | |||
61 | #define NFSDDBG_FACILITY NFSDDBG_FILEOP | 61 | #define NFSDDBG_FACILITY NFSDDBG_FILEOP |
62 | 62 | ||
63 | 63 | ||
64 | /* We must ignore files (but only files) which might have mandatory | ||
65 | * locks on them because there is no way to know if the accesser has | ||
66 | * the lock. | ||
67 | */ | ||
68 | #define IS_ISMNDLK(i) (S_ISREG((i)->i_mode) && MANDATORY_LOCK(i)) | ||
69 | |||
70 | /* | 64 | /* |
71 | * This is a cache of readahead params that help us choose the proper | 65 | * This is a cache of readahead params that help us choose the proper |
72 | * readahead strategy. Initially, we set all readahead parameters to 0 | 66 | * readahead strategy. Initially, we set all readahead parameters to 0 |
@@ -689,7 +683,12 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, | |||
689 | err = nfserr_perm; | 683 | err = nfserr_perm; |
690 | if (IS_APPEND(inode) && (access & MAY_WRITE)) | 684 | if (IS_APPEND(inode) && (access & MAY_WRITE)) |
691 | goto out; | 685 | goto out; |
692 | if (IS_ISMNDLK(inode)) | 686 | /* |
687 | * We must ignore files (but only files) which might have mandatory | ||
688 | * locks on them because there is no way to know if the accesser has | ||
689 | * the lock. | ||
690 | */ | ||
691 | if (S_ISREG((inode)->i_mode) && mandatory_lock(inode)) | ||
693 | goto out; | 692 | goto out; |
694 | 693 | ||
695 | if (!inode->i_fop) | 694 | if (!inode->i_fop) |