Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1655261
| From | Ben Hutchings <ben@decadent.org.uk> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 3.16 141/212] nfsd: update mtime on truncate |
| Date | 2017-06-01 17:50 +0200 |
| Message-ID | <tNAwi-4oP-33@gated-at.bofh.it> (permalink) |
| References | <tNAwh-4oP-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
3.16.44-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Christoph Hellwig <hch@lst.de> commit f0c63124a6165792f6e37e4b5983792d009e1ce8 upstream. This fixes a failure in xfstests generic/313 because nfs doesn't update mtime on a truncate. The protocol requires this to be done implicity for a size changing setattr. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Ben Hutchings <ben@decadent.org.uk> --- fs/nfsd/vfs.c | 10 ++++++++++ 1 file changed, 10 insertions(+) --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -448,6 +448,16 @@ nfsd_setattr(struct svc_rqst *rqstp, str if (err) goto out; size_change = 1; + + /* + * RFC5661, Section 18.30.4: + * Changing the size of a file with SETATTR indirectly + * changes the time_modify and change attributes. + * + * (and similar for the older RFCs) + */ + if (iap->ia_size != i_size_read(inode)) + iap->ia_valid |= ATTR_MTIME; } iap->ia_valid |= ATTR_CTIME;
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH 3.16 141/212] nfsd: update mtime on truncate Ben Hutchings <ben@decadent.org.uk> - 2017-06-01 17:50 +0200
csiph-web