]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
GFS2: Make rename not save dirent location
authorBob Peterson <rpeterso@redhat.com>
Mon, 29 Sep 2014 12:52:04 +0000 (08:52 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Nov 2014 17:23:15 +0000 (09:23 -0800)
commit2a0173fa9acafe94159c48efe88ea36a72a16d84
tree688295eb71c6cfa6f7f41fd77a3ce247d6758d47
parent5aa67e1743992a470e8187dbb2e9bd3a66e385d0
GFS2: Make rename not save dirent location

commit 19aeb5a65f1a6504fc665466c188241e7393d66f upstream.

This patch fixes a regression in the patch "GFS2: Remember directory
insert point", commit 2b47dad866d04f14c328f888ba5406057b8c7d33.
The problem had to do with the rename function: The function found
space for the new dirent, and remembered that location. But then the
old dirent was removed, which often moved the eligible location for
the renamed dirent. Putting the new dirent at the saved location
caused file system corruption.

This patch adds a new "save_loc" variable to struct gfs2_diradd.
If 1, the dirent location is saved. If 0, the dirent location is not
saved and the buffer_head is released as per previous behavior.

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/dir.c
fs/gfs2/dir.h
fs/gfs2/inode.c