make the feature checks in ->fallocate future proof
Instead of various home grown checks that might need updates for new flags just check for any bit outside the mask of the features supported by the filesystem. This makes the check future proof for any newly added flag. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
committed by
Al Viro
parent
eb745dbccc
commit
64c23e8687
@@ -518,6 +518,9 @@ xfs_vn_fallocate(
|
||||
xfs_inode_t *ip = XFS_I(inode);
|
||||
int cmd = XFS_IOC_RESVSP;
|
||||
|
||||
if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
/* preallocation on directories not yet supported */
|
||||
error = -ENODEV;
|
||||
if (S_ISDIR(inode->i_mode))
|
||||
|
Reference in New Issue
Block a user