• Neil Brown's avatar
    nfsd: Fix possible BUG_ON firing in set_change_info · c1ac3ffc
    Neil Brown authored
    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: default avatarNeilBrown <neilb@suse.de>
    Cc: stable@kernel.org
    Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
    c1ac3ffc
xdr4.h 16.6 KB