[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Cluster-devel] [GFS2 PATCH] GFS2: Increase i_writecount during gfs2_setattr_chown

----- Original Message -----
| On Mon, Jan 06, 2014 at 05:16:01PM -0500, Bob Peterson wrote:
| > Hi,
| > 
| > This patch calls get_write_access in function gfs2_setattr_chown,
| > which merely increases inode->i_writecount for the duration of the
| > function. That will ensure that any file closes won't delete the
| > inode's multi-block reservation while the function is running.
| > It also ensures that a multi-block reservation exists when needed
| > for quota change operations during the chown.
| Can you explain how gfs2 (ab-)uses i_writecount in the allocator?
| i_writecunt has very complicated semantics including negative values
| to deal with mappings for executables, and I can't really see how these
| high-level semantics interact well with a block allocator.


GFS2's allocator doesn't use i_writecount per se.

With GFS2, the last person to close a file will free the inode's
multi-block reservation structure (struct gfs2_blkreserv), which is
used by the allocator for reserving blocks in order to reduce
fragmentation. For convenience sake (and to not overly bloat the
inode structure itself), that structure is sometimes used for
ancillary things, like quota manipulations. In my patch, the
i_writecount is merely used to prevent file closes from deleting
the multi-block reservation structures during that particular use by
the GFS2 quota code.


Bob Peterson
Red Hat File Systems

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]