Skip to content

Commit 5f034d3

Browse files
committed
ovl: propagate IOCB_APPEND flag on writes to realfile
If ovl file is opened O_APPEND, the underlying realfile is also opened O_APPEND, so it makes sense to propagate the IOCB_APPEND flags on sync writes to realfile, just as we do with aio writes. Effectively, because sync ovl writes are protected by inode lock, this change only makes a difference if the realfile is written to (size extending writes) from underneath overlayfs. The behavior in this case is undefined, so it is ok if we change the behavior (to fail the ovl IOCB_APPEND write). Signed-off-by: Amir Goldstein <amir73il@gmail.com>
1 parent db5b5e8 commit 5f034d3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/overlayfs/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ static void ovl_file_accessed(struct file *file)
264264
}
265265

266266
#define OVL_IOCB_MASK \
267-
(IOCB_NOWAIT | IOCB_HIPRI | IOCB_DSYNC | IOCB_SYNC)
267+
(IOCB_NOWAIT | IOCB_HIPRI | IOCB_DSYNC | IOCB_SYNC | IOCB_APPEND)
268268

269269
static rwf_t iocb_to_rw_flags(int flags)
270270
{

0 commit comments

Comments
 (0)