]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
udf: Drop pointless IS_IMMUTABLE and IS_APPEND check
authorJan Kara <jack@suse.cz>
Mon, 20 May 2024 13:18:44 +0000 (15:18 +0200)
committerJan Kara <jack@suse.cz>
Wed, 5 Jun 2024 08:36:46 +0000 (10:36 +0200)
udf_setsize() checks for IS_IMMUTABLE and IS_APPEND flags. This is
however pointless as UDF does not have capability to store these flags
and never allows to set them. Furthermore this is the only place in UDF
code that was actually checking these flags. Remove the pointless check.

Signed-off-by: Jan Kara <jack@suse.cz>
fs/udf/inode.c

index 2fb21c5ffccfe477d85398a74df72005b10cbe6a..9d39fdd26015349ad14e7eb93547abd777f15eb7 100644 (file)
@@ -1247,8 +1247,6 @@ int udf_setsize(struct inode *inode, loff_t newsize)
        if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
              S_ISLNK(inode->i_mode)))
                return -EINVAL;
-       if (IS_APPEND(inode) || IS_IMMUTABLE(inode))
-               return -EPERM;
 
        filemap_invalidate_lock(inode->i_mapping);
        iinfo = UDF_I(inode);