All of lore.kernel.org
 help / color / mirror / Atom feed
From: xiubli@redhat.com
To: jlayton@kernel.org
Cc: idryomov@gmail.com, vshankar@redhat.com, khiremat@redhat.com,
	ceph-devel@vger.kernel.org, Xiubo Li <xiubli@redhat.com>
Subject: [PATCH 2/2] ceph: there is no need to round up the sizes when new size is 0
Date: Mon,  8 Nov 2021 21:50:12 +0800	[thread overview]
Message-ID: <20211108135012.79941-3-xiubli@redhat.com> (raw)
In-Reply-To: <20211108135012.79941-1-xiubli@redhat.com>

From: Xiubo Li <xiubli@redhat.com>

Signed-off-by: Xiubo Li <xiubli@redhat.com>
---
 fs/ceph/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index b371f596b97d..1b4ce453d397 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -2560,7 +2560,7 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr, struct ceph_iattr *c
 			mask |= CEPH_SETATTR_SIZE;
 			release |= CEPH_CAP_FILE_SHARED | CEPH_CAP_FILE_EXCL |
 				   CEPH_CAP_FILE_RD | CEPH_CAP_FILE_WR;
-			if (IS_ENCRYPTED(inode)) {
+			if (IS_ENCRYPTED(inode) && attr->ia_size) {
 				set_bit(CEPH_MDS_R_FSCRYPT_FILE, &req->r_req_flags);
 				mask |= CEPH_SETATTR_FSCRYPT_FILE;
 				req->r_args.setattr.size =
-- 
2.27.0


  parent reply	other threads:[~2021-11-08 13:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-08 13:50 [PATCH 0/2] ceph: misc fixes for the fscrypt truncate size handling xiubli
2021-11-08 13:50 ` [PATCH 1/2] ceph: fix possible crash and data corrupt bugs xiubli
2021-11-08 13:50 ` xiubli [this message]
2021-11-08 14:10 ` [PATCH 0/2] ceph: misc fixes for the fscrypt truncate size handling Xiubo Li
2021-11-08 14:26   ` Jeff Layton
2021-11-08 14:41     ` Xiubo Li
2021-11-08 14:44       ` Xiubo Li
2021-11-08 14:27   ` Xiubo Li
2021-11-08 14:32 ` Jeff Layton
2021-11-08 18:36 ` Jeff Layton
2021-11-09  0:21   ` Xiubo Li
2021-11-09  1:57     ` Jeff Layton
2021-11-09 12:33       ` Jeff Layton
2021-11-15  3:07         ` Xiubo Li
2021-11-16  4:56         ` Xiubo Li
2021-11-16  6:14           ` Xiubo Li

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=20211108135012.79941-3-xiubli@redhat.com \
    --to=xiubli@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=idryomov@gmail.com \
    --cc=jlayton@kernel.org \
    --cc=khiremat@redhat.com \
    --cc=vshankar@redhat.com \
    /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.