From: <gregkh@linuxfoundation.org>
To: viro@zeniv.linux.org.uk, gregkh@linuxfoundation.org
Cc: <stable@vger.kernel.org>, <stable-commits@vger.kernel.org>
Subject: Patch "excessive checks in ufs_write_failed() and ufs_evict_inode()" has been added to the 4.11-stable tree
Date: Mon, 12 Jun 2017 11:19:02 +0200 [thread overview]
Message-ID: <14972591428852@kroah.com> (raw)
This is a note to let you know that I've just added the patch titled
excessive checks in ufs_write_failed() and ufs_evict_inode()
to the 4.11-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
excessive-checks-in-ufs_write_failed-and-ufs_evict_inode.patch
and it can be found in the queue-4.11 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From babef37dccbaa49249a22bae9150686815d7be71 Mon Sep 17 00:00:00 2001
From: Al Viro <viro@zeniv.linux.org.uk>
Date: Fri, 9 Jun 2017 16:20:34 -0400
Subject: excessive checks in ufs_write_failed() and ufs_evict_inode()
From: Al Viro <viro@zeniv.linux.org.uk>
commit babef37dccbaa49249a22bae9150686815d7be71 upstream.
As it is, short copy in write() to append-only file will fail
to truncate the excessive allocated blocks. As the matter of
fact, all checks in ufs_truncate_blocks() are either redundant
or wrong for that caller. As for the only other caller
(ufs_evict_inode()), we only need the file type checks there.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ufs/inode.c | 18 +++++-------------
1 file changed, 5 insertions(+), 13 deletions(-)
--- a/fs/ufs/inode.c
+++ b/fs/ufs/inode.c
@@ -844,7 +844,9 @@ void ufs_evict_inode(struct inode * inod
truncate_inode_pages_final(&inode->i_data);
if (want_delete) {
inode->i_size = 0;
- if (inode->i_blocks)
+ if (inode->i_blocks &&
+ (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
+ S_ISLNK(inode->i_mode)))
ufs_truncate_blocks(inode);
}
@@ -1103,7 +1105,7 @@ out:
return err;
}
-static void __ufs_truncate_blocks(struct inode *inode)
+static void ufs_truncate_blocks(struct inode *inode)
{
struct ufs_inode_info *ufsi = UFS_I(inode);
struct super_block *sb = inode->i_sb;
@@ -1186,7 +1188,7 @@ static int ufs_truncate(struct inode *in
truncate_setsize(inode, size);
- __ufs_truncate_blocks(inode);
+ ufs_truncate_blocks(inode);
inode->i_mtime = inode->i_ctime = current_time(inode);
mark_inode_dirty(inode);
out:
@@ -1194,16 +1196,6 @@ out:
return err;
}
-static void ufs_truncate_blocks(struct inode *inode)
-{
- if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
- S_ISLNK(inode->i_mode)))
- return;
- if (IS_APPEND(inode) || IS_IMMUTABLE(inode))
- return;
- __ufs_truncate_blocks(inode);
-}
-
int ufs_setattr(struct dentry *dentry, struct iattr *attr)
{
struct inode *inode = d_inode(dentry);
Patches currently in stable-queue which might be from viro@zeniv.linux.org.uk are
queue-4.11/excessive-checks-in-ufs_write_failed-and-ufs_evict_inode.patch
queue-4.11/ufs-set-correct-s_maxsize.patch
queue-4.11/ufs_getfrag_block-we-only-grab-truncate_mutex-on-block-creation-path.patch
queue-4.11/ufs-restore-proper-tail-allocation.patch
queue-4.11/ufs_extend_tail-fix-the-braino-in-calling-conventions-of-ufs_new_fragments.patch
queue-4.11/ufs-restore-maintaining-i_blocks.patch
queue-4.11/fix-ufs_isblockset.patch
reply other threads:[~2017-06-12 9:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=14972591428852@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=stable-commits@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.