GFS2: Increase i_writecount during gfs2_setattr_chown
authorBob Peterson <rpeterso@redhat.com>
Mon, 6 Jan 2014 22:16:01 +0000 (17:16 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 25 Jan 2014 16:49:28 +0000 (08:49 -0800)
commitdfc74e9ccc2a7266ac677c4af6e7760059f315f8
treeb3d3a4160231bf7743328c4e2c07817e85fd057f
parent280f5dcc8e2f5a3230598012cbb6391642ed1bb3
GFS2: Increase i_writecount during gfs2_setattr_chown

commit 62e96cf81988101fe9e086b2877307b6adda5197 upstream.

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.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/gfs2/inode.c