On 06/01/2010 01:43 PM, Christoph Hellwig wrote: > On Tue, Jun 01, 2010 at 01:28:50PM +0300, Boaz Harrosh wrote: >> + if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) || >> + S_ISLNK(inode->i_mode))) >> + return -EINVAL; >> if (exofs_inode_is_fast_symlink(inode)) >> - return; >> + return -EINVAL; > > do_sys_truncate already makes sure ATTR_SIZE changes only happen on > ISREG files. > I copy/pasted this from ext2_setsize. (Would you remove it from there as well?) >> if (IS_APPEND(inode) || IS_IMMUTABLE(inode)) >> - return; > > Same for these - IS_APPEND directly and IS_IMMUTABLE via > inode_permission(). > >> + oldsize = inode->i_size; >> + i_size_write(inode, newsize); >> + truncate_pagecache(inode, oldsize, newsize); > > At this point you can probably just inline this in exofs_setattr. > Especially as the lines above will be replaced with a single > function call in my next batch. > OK, I'm re-spinning minus these and inlined. I'll want to re-run a few tests just to make sure. Thanks Boaz -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html