diff options
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/vfs.c | 8 | ||||
-rw-r--r-- | fs/nfsd/vfs.h | 1 |
2 files changed, 6 insertions, 3 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index a11b0e8678ee..c2dcb4c2b1fc 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -723,7 +723,7 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, | |||
723 | struct inode *inode; | 723 | struct inode *inode; |
724 | int flags = O_RDONLY|O_LARGEFILE; | 724 | int flags = O_RDONLY|O_LARGEFILE; |
725 | __be32 err; | 725 | __be32 err; |
726 | int host_err; | 726 | int host_err = 0; |
727 | 727 | ||
728 | validate_process_creds(); | 728 | validate_process_creds(); |
729 | 729 | ||
@@ -760,7 +760,8 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, | |||
760 | * Check to see if there are any leases on this file. | 760 | * Check to see if there are any leases on this file. |
761 | * This may block while leases are broken. | 761 | * This may block while leases are broken. |
762 | */ | 762 | */ |
763 | host_err = break_lease(inode, O_NONBLOCK | ((access & NFSD_MAY_WRITE) ? O_WRONLY : 0)); | 763 | if (!(access & NFSD_MAY_NOT_BREAK_LEASE)) |
764 | host_err = break_lease(inode, O_NONBLOCK | ((access & NFSD_MAY_WRITE) ? O_WRONLY : 0)); | ||
764 | if (host_err == -EWOULDBLOCK) | 765 | if (host_err == -EWOULDBLOCK) |
765 | host_err = -ETIMEDOUT; | 766 | host_err = -ETIMEDOUT; |
766 | if (host_err) /* NOMEM or WOULDBLOCK */ | 767 | if (host_err) /* NOMEM or WOULDBLOCK */ |
@@ -1168,7 +1169,8 @@ nfsd_commit(struct svc_rqst *rqstp, struct svc_fh *fhp, | |||
1168 | goto out; | 1169 | goto out; |
1169 | } | 1170 | } |
1170 | 1171 | ||
1171 | err = nfsd_open(rqstp, fhp, S_IFREG, NFSD_MAY_WRITE, &file); | 1172 | err = nfsd_open(rqstp, fhp, S_IFREG, |
1173 | NFSD_MAY_WRITE|NFSD_MAY_NOT_BREAK_LEASE, &file); | ||
1172 | if (err) | 1174 | if (err) |
1173 | goto out; | 1175 | goto out; |
1174 | if (EX_ISSYNC(fhp->fh_export)) { | 1176 | if (EX_ISSYNC(fhp->fh_export)) { |
diff --git a/fs/nfsd/vfs.h b/fs/nfsd/vfs.h index 4b1de0a9ea75..217a62c2a357 100644 --- a/fs/nfsd/vfs.h +++ b/fs/nfsd/vfs.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #define NFSD_MAY_OWNER_OVERRIDE 64 | 20 | #define NFSD_MAY_OWNER_OVERRIDE 64 |
21 | #define NFSD_MAY_LOCAL_ACCESS 128 /* IRIX doing local access check on device special file*/ | 21 | #define NFSD_MAY_LOCAL_ACCESS 128 /* IRIX doing local access check on device special file*/ |
22 | #define NFSD_MAY_BYPASS_GSS_ON_ROOT 256 | 22 | #define NFSD_MAY_BYPASS_GSS_ON_ROOT 256 |
23 | #define NFSD_MAY_NOT_BREAK_LEASE 512 | ||
23 | 24 | ||
24 | #define NFSD_MAY_CREATE (NFSD_MAY_EXEC|NFSD_MAY_WRITE) | 25 | #define NFSD_MAY_CREATE (NFSD_MAY_EXEC|NFSD_MAY_WRITE) |
25 | #define NFSD_MAY_REMOVE (NFSD_MAY_EXEC|NFSD_MAY_WRITE|NFSD_MAY_TRUNC) | 26 | #define NFSD_MAY_REMOVE (NFSD_MAY_EXEC|NFSD_MAY_WRITE|NFSD_MAY_TRUNC) |