nfs: prevent truncate on active swapfile
authorOmar Sandoval <osandov@osandov.com>
Thu, 8 Jan 2015 09:18:30 +0000 (01:18 -0800)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Sat, 31 Jan 2015 01:43:29 +0000 (20:43 -0500)
Most filesystems prevent truncation of an active swapfile by way of
inode_newsize_ok, called from inode_change_ok. NFS doesn't call either
from nfs_setattr, presumably because most of these checks are expected
to be done server-side. However, the IS_SWAPFILE check can only be done
client-side, and truncating a swapfile can't possibly be good.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/inode.c

diff --cc fs/nfs/inode.c
Simple merge