• R/O
  • HTTP
  • SSH
  • HTTPS

linux-2.4.36: Commit

2.4.36-stable kernel tree


Commit MetaInfo

Revision63789b37d0e2344ca4da9d1c7dc49bae7368c466 (tree)
Zeit2005-06-08 01:26:54
AutorNeilBrown <neilb@cse....>
CommiterMarcelo Tosatti

Log Message

[PATCH] Claim i_alloc_sem while changing file size in nfsd

nfsd should hold i_alloc_sem while calling notify_change
with ATTR_SIZE set, just like do_truncate does.

From: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>

### Diffstat output

./fs/nfsd/vfs.c | 2 ++
1 files changed, 2 insertions(+)

diff ./fs/nfsd/vfs.c~current~ ./fs/nfsd/vfs.c

Ändern Zusammenfassung

Diff

--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -301,6 +301,7 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, struct iattr *iap,
301301 iap->ia_valid |= ATTR_CTIME;
302302
303303 if (iap->ia_valid & ATTR_SIZE) {
304+ down_write(&inode->i_alloc_sem);
304305 fh_lock(fhp);
305306 size_change = 1;
306307 }
@@ -311,6 +312,7 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, struct iattr *iap,
311312 }
312313 if (size_change) {
313314 fh_unlock(fhp);
315+ up_write(&inode->i_alloc_sem);
314316 put_write_access(inode);
315317 }
316318 if (!err)
Show on old repository browser