Message ID | 1438288381-12327-1-git-send-email-hubcap@logtruck.clemson.edu (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Thu, Jul 30, 2015 at 04:33:01PM -0400, hubcap wrote: > From: Mike Marshall <hubcap@omnibond.com> > > make.cross ARCH=tile doesn't like "inode->i_bytes = PAGE_CACHE_SIZE;", > so cast PAGE_CACHE_SIZE to unsigned short. I don't think this is correct. i_bytes is short because it only contains the low bits of th size, the rest goes into i_blocks. You probably want to use inode_set_bytes here instead. -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Fri, Jul 31, 2015 at 12:36:22AM -0700, Christoph Hellwig wrote: > On Thu, Jul 30, 2015 at 04:33:01PM -0400, hubcap wrote: > > From: Mike Marshall <hubcap@omnibond.com> > > > > make.cross ARCH=tile doesn't like "inode->i_bytes = PAGE_CACHE_SIZE;", > > so cast PAGE_CACHE_SIZE to unsigned short. > > I don't think this is correct. i_bytes is short because it only > contains the low bits of th size, the rest goes into i_blocks. > > You probably want to use inode_set_bytes here instead. ... or just leave ->i_bytes zero, what with PAGE_CACHE_SIZE being a multiple of 512... -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/fs/orangefs/pvfs2-utils.c b/fs/orangefs/pvfs2-utils.c index 8d4411c..6eecb18 100644 --- a/fs/orangefs/pvfs2-utils.c +++ b/fs/orangefs/pvfs2-utils.c @@ -163,7 +163,7 @@ static int copy_attributes_to_inode(struct inode *inode, /*FALLTHRU*/ default: pvfs2_lock_inode(inode); - inode->i_bytes = PAGE_CACHE_SIZE; + inode->i_bytes = (unsigned short)PAGE_CACHE_SIZE; inode->i_blocks = (unsigned long)(PAGE_CACHE_SIZE / 512); pvfs2_unlock_inode(inode);