+ /* The maximum Lustre file size is variable, based on the
+ * OST maximum object size and number of stripes. This
+ * needs another check in addition to the VFS checks earlier. */
+ end = (io->u.ci_wr.wr_append ? i_size_read(inode) : *ppos) + count;
+ if (end > ll_file_maxbytes(inode)) {
+ result = -EFBIG;
+ CDEBUG(D_INODE, "%s: file "DFID" offset %llu > maxbytes "LPU64
+ ": rc = %zd\n", ll_get_fsname(inode->i_sb, NULL, 0),
+ PFID(&lli->lli_fid), end, ll_file_maxbytes(inode),
+ result);
+ RETURN(result);
+ }
+