diff options
Diffstat (limited to 'fs/nfsd/nfsproc.c')
-rw-r--r-- | fs/nfsd/nfsproc.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c index e9214768cde9..08188743db53 100644 --- a/fs/nfsd/nfsproc.c +++ b/fs/nfsd/nfsproc.c | |||
@@ -74,10 +74,10 @@ nfsd_proc_setattr(struct svc_rqst *rqstp, struct nfsd_sattrargs *argp, | |||
74 | * which only requires access, and "set-[ac]time-to-X" which | 74 | * which only requires access, and "set-[ac]time-to-X" which |
75 | * requires ownership. | 75 | * requires ownership. |
76 | * So if it looks like it might be "set both to the same time which | 76 | * So if it looks like it might be "set both to the same time which |
77 | * is close to now", and if inode_change_ok fails, then we | 77 | * is close to now", and if setattr_prepare fails, then we |
78 | * convert to "set to now" instead of "set to explicit time" | 78 | * convert to "set to now" instead of "set to explicit time" |
79 | * | 79 | * |
80 | * We only call inode_change_ok as the last test as technically | 80 | * We only call setattr_prepare as the last test as technically |
81 | * it is not an interface that we should be using. | 81 | * it is not an interface that we should be using. |
82 | */ | 82 | */ |
83 | #define BOTH_TIME_SET (ATTR_ATIME_SET | ATTR_MTIME_SET) | 83 | #define BOTH_TIME_SET (ATTR_ATIME_SET | ATTR_MTIME_SET) |
@@ -92,17 +92,15 @@ nfsd_proc_setattr(struct svc_rqst *rqstp, struct nfsd_sattrargs *argp, | |||
92 | * request is. We require it be within 30 minutes of now. | 92 | * request is. We require it be within 30 minutes of now. |
93 | */ | 93 | */ |
94 | time_t delta = iap->ia_atime.tv_sec - get_seconds(); | 94 | time_t delta = iap->ia_atime.tv_sec - get_seconds(); |
95 | struct inode *inode; | ||
96 | 95 | ||
97 | nfserr = fh_verify(rqstp, fhp, 0, NFSD_MAY_NOP); | 96 | nfserr = fh_verify(rqstp, fhp, 0, NFSD_MAY_NOP); |
98 | if (nfserr) | 97 | if (nfserr) |
99 | goto done; | 98 | goto done; |
100 | inode = d_inode(fhp->fh_dentry); | ||
101 | 99 | ||
102 | if (delta < 0) | 100 | if (delta < 0) |
103 | delta = -delta; | 101 | delta = -delta; |
104 | if (delta < MAX_TOUCH_TIME_ERROR && | 102 | if (delta < MAX_TOUCH_TIME_ERROR && |
105 | inode_change_ok(inode, iap) != 0) { | 103 | setattr_prepare(fhp->fh_dentry, iap) != 0) { |
106 | /* | 104 | /* |
107 | * Turn off ATTR_[AM]TIME_SET but leave ATTR_[AM]TIME. | 105 | * Turn off ATTR_[AM]TIME_SET but leave ATTR_[AM]TIME. |
108 | * This will cause notify_change to set these times | 106 | * This will cause notify_change to set these times |