[XFS] remove permission check from xfs_change_file_space

Both callers of xfs_change_file_space alreaedy do the file->f_mode &
FMODE_WRITE check to ensure we have a file descriptor that has been opened
for write mode, so there is no need to re-check that with xfs_iaccess.
Especially as the later might wrongly deny it for corner cases like file
descriptor passing through unix domain sockets.

SGI-PV: 971186
SGI-Modid: xfs-linux-melb:xfs-kern:30365a

Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>

authored by

Christoph Hellwig and committed by
Lachlan McIlroy
199037c5 9742bb93

-12
-12
fs/xfs/xfs_vnodeops.c
··· 4317 4317 4318 4318 xfs_itrace_entry(ip); 4319 4319 4320 - /* 4321 - * must be a regular file and have write permission 4322 - */ 4323 4320 if (!S_ISREG(ip->i_d.di_mode)) 4324 4321 return XFS_ERROR(EINVAL); 4325 - 4326 - xfs_ilock(ip, XFS_ILOCK_SHARED); 4327 - 4328 - if ((error = xfs_iaccess(ip, S_IWUSR, credp))) { 4329 - xfs_iunlock(ip, XFS_ILOCK_SHARED); 4330 - return error; 4331 - } 4332 - 4333 - xfs_iunlock(ip, XFS_ILOCK_SHARED); 4334 4322 4335 4323 switch (bf->l_whence) { 4336 4324 case 0: /*SEEK_SET*/