]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: don't try to unlock pagecache page after releasing it
authorJeff Layton <jlayton@redhat.com>
Mon, 4 Mar 2013 20:18:25 +0000 (15:18 -0500)
committerSteve French <sfrench@us.ibm.com>
Thu, 7 Mar 2013 01:03:57 +0000 (19:03 -0600)
commited6542ed1419c9cf53dea58ff24c54d8b58f628c
treef01a05a61a19dc40599d2692226b6ddfb3e2ee76
parent487af7d0b33e55e4b1e833e6cbe311a47de72e39
cifs: don't try to unlock pagecache page after releasing it

We had a recent fix to fix the release of pagecache pages when
cifs_writev_requeue writes fail. Unfortunately, it releases the page
before trying to unlock it. At that point, the page might be gone by the
time the unlock comes in.

Unlock the page first before checking the value of "rc", and only then
end writeback and release the pages. The page lock isn't required for
any of those operations so this should be safe.

Reported-by: Anton Altaparmakov <aia21@cam.ac.uk>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/cifssmb.c