]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Don't set a file's size for the MDS file of a pNFS service.
authorrmacklem <rmacklem@FreeBSD.org>
Fri, 17 Aug 2018 12:32:38 +0000 (12:32 +0000)
committerrmacklem <rmacklem@FreeBSD.org>
Fri, 17 Aug 2018 12:32:38 +0000 (12:32 +0000)
commit624b46f4018cb0118ff64e7a1a0e0bd535edfe17
treefbd3c1715d836078d4a130e4b79e3075283c9d6e
parent3f28472969d9dbb28acd47a334ff60db32cddcc6
Don't set a file's size for the MDS file of a pNFS service.

When a pNFS service is running, the size of the files created on the MDS
are normally 0, since the data is written to the data files on the DS(s).
However, without this patch, if a Setattr with a non-zero size was done by
a client, the MDS file was set to that size.  This was thought to be benign,
but it turns out that files with a non-zero size plus extended attributes
can cause a "ffs_truncate3" panic in UFS. Although the exact cause of this
panic() has not been isolated, this patch avoids the panic() and leaves
the MDS files in a consistent state of always having a size == 0.
Note that these MDS files never store data. The patch also includes an
unnecessary initialization of savsize in case some compiler or static
analyser complains it might not be initialized.
This patch only affects the NFS server when pNFS is enabled via the "-p"
command line option on nfsd.
sys/fs/nfsserver/nfs_nfsdport.c