Skip to contentSkip to conversation

fs: Remove FIXME comment in generic_write_checks()

PATCH Applied Tal Zussman 2 participants 2 messages Dec 31, 2021 – Jan 30, 2022 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs: Remove FIXME comment in generic_write_checks()

This patch removes an unnecessary comment that had to do with block special files from generic_write_checks().

The comment, originally added in Linux v2.4.14.9, was to clarify that we only set pos to the file size when the file was opened with O_APPEND if the file wasn't a block special file. Prior to Linux v2.4, block special files had a different write() function which was unified into a generic write() function in Linux v2.4. This generic write() function called generic_write_checks(). For more details, see this earlier conversation:
https://lore.kernel.org/linux-fsdevel/[email protected]/

Currently, block special devices have their own write_iter() function and no longer share the same generic_write_checks(), therefore rendering the comment irrelevant.

---
 fs/read_write.c | 1 -
 1 file changed, 1 deletion(-)
fs/read_write.c +0 -1
index 0074afa7ecb3..0173dc7183c9 100644
@@ -1637,7 +1637,6 @@ ssize_t generic_write_checks(struct kiocb *iocb, struct iov_iter *from)
 	if (!iov_iter_count(from))
 		return 0;
 
-	/* FIXME: this is for backwards compatibility with 2.4 */
 	if (iocb->ki_flags & IOCB_APPEND)
 		iocb->ki_pos = i_size_read(inode);
 
Signature · 1 line
2.20.1
maintainer Applied
#1 lore raw
Quoted 11 lines · Tal Zussman

This patch removes an unnecessary comment that had to do with block special files from generic_write_checks().

The comment, originally added in Linux v2.4.14.9, was to clarify that we only set pos to the file size when the file was opened with O_APPEND if the file wasn't a block special file. Prior to Linux v2.4, block special files had a different write() function which was unified into a generic write() function in Linux v2.4. This generic write() function called generic_write_checks(). For more details, see this earlier conversation:
https://lore.kernel.org/linux-fsdevel/[email protected]/

Quoted 3 lines

Currently, block special devices have their own write_iter() function and no longer share the same generic_write_checks(), therefore rendering the comment irrelevant.

Applied