]> git.karo-electronics.de Git - karo-tx-linux.git/commit
nfsd: Fix possible BUG_ON firing in set_change_info
authorNeil Brown <neilb@suse.de>
Thu, 2 Dec 2010 00:14:30 +0000 (11:14 +1100)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Sun, 17 Apr 2011 20:16:07 +0000 (16:16 -0400)
commit85f936885acc911d44cca888dcf313a0aa5adfa1
tree1f33cb9c2d1af07f4e49dee30d38f0bbc3543d7f
parentc438fc212dd9fb27a8fd2c34e179bee6c0b33fc0
nfsd: Fix possible BUG_ON firing in set_change_info

commit c1ac3ffcd0bc7e9617f62be8c7043d53ab84deac upstream.

If vfs_getattr in fill_post_wcc returns an error, we don't
set fh_post_change.
For NFSv4, this can result in set_change_info triggering a BUG_ON.
i.e. fh_post_saved being zero isn't really a bug.

So:
 - instead of BUGging when fh_post_saved is zero, just clear ->atomic.
 - if vfs_getattr fails in fill_post_wcc, take a copy of i_ctime anyway.
   This will be used i seg_change_info, but not overly trusted.
 - While we are there, remove the pointless 'if' statements in set_change_info.
   There is no harm setting all the values.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
fs/nfsd/nfs3xdr.c
fs/nfsd/xdr4.h