From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Monakhov Subject: Re: [PATCH] vfs: reorganize inode chattr checks Date: Wed, 17 Mar 2010 20:18:09 +0300 Message-ID: <87ljdqyii6.fsf@openvz.org> References: <87pr32yix3.fsf@openvz.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Al Viro , Nick Piggin To: linux-fsdevel@vger.kernel.org Return-path: Received: from mail-bw0-f212.google.com ([209.85.218.212]:53459 "EHLO mail-bw0-f212.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751818Ab0CQRSN (ORCPT ); Wed, 17 Mar 2010 13:18:13 -0400 Received: by bwz4 with SMTP id 4so1308906bwz.39 for ; Wed, 17 Mar 2010 10:18:12 -0700 (PDT) In-Reply-To: <87pr32yix3.fsf@openvz.org> (Dmitry Monakhov's message of "Wed, 17 Mar 2010 20:09:12 +0300") Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Dmitry Monakhov writes: > This patch fix nasty bug with truncate on swapfile. > It contains only vfs core helpers and fix isize check path for > fs w/o i_op->setattr method. Later i'll send corresponding changes > to other fs which has ->setattr method. > > This patch is depends on Nick's patch > http://marc.info/?l=linux-fsdevel&m=126752788514574&w=2 > diff --git a/include/linux/fs.h b/include/linux/fs.h > index 81c91d9..fb6809d 100644 > --- a/include/linux/fs.h > +++ b/include/linux/fs.h > @@ -2388,9 +2388,10 @@ extern int buffer_migrate_page(struct address_space *, > #else > #define buffer_migrate_page NULL > #endif > - > -extern int inode_change_ok(const struct inode *, struct iattr *); Following define will be removed after all filesystems will be moved to new isize check sequance. This will be the signal for external modules to migrate to new logic. > +#define inode_change_ok(inode, iattr) inode_change_posix_ok(inode, iattr) > +extern int inode_change_posix_ok(const struct inode *, struct iattr *); > extern int inode_newsize_ok(const struct inode *, loff_t offset); > +extern int inode_change_attr_ok(const struct inode *, struct iattr *); > extern int __must_check inode_setattr(struct inode *, const struct iattr *); > extern void generic_setattr(struct inode *inode, const struct iattr *attr);