Re: [PATCH] ceph: fix race in concurrent __ceph_remove_cap invocations

2020-11-12 Thread Yan, Zheng
On Thu, Nov 12, 2020 at 6:48 PM Luis Henriques wrote: > > A NULL pointer dereference may occur in __ceph_remove_cap with some of the > callbacks used in ceph_iterate_session_caps, namely trim_caps_cb and > remove_session_caps_cb. These aren't protected against the concurrent > execution of

Re: [PATCH V3] fs/ceph:fix double unlock in handle_cap_export()

2020-04-30 Thread Yan, Zheng
> struct ceph_mds_caps *ex, > WARN_ON(1); > tsession = NULL; > target = -1; > + mutex_lock(>s_mutex); > } > goto retry; > > -- > 1.8.3.1 > Reviewed-by: "Yan, Zheng"

Re: [PATCH V2] fs/ceph:fix double unlock in handle_cap_export()

2020-04-29 Thread Yan, Zheng
On Wed, Apr 29, 2020 at 8:49 AM Wu Bo wrote: > > On 2020/4/28 22:48, Jeff Layton wrote: > > On Tue, 2020-04-28 at 21:13 +0800, Wu Bo wrote: > >> if the ceph_mdsc_open_export_target_session() return fails, > >> should add a lock to avoid twice unlocking. > >> Because the lock will be released at

Re: [PATCH] fs/ceph:fix double unlock in handle_cap_export()

2020-04-28 Thread Yan, Zheng
On Tue, Apr 28, 2020 at 8:50 PM Wu Bo wrote: > > If the ceph_mdsc_open_export_target_session() return fails, > should add a lock to avoid twice unlocking. > Because the lock will be released at the retry or out_unlock tag. > at retry label, i_ceph_lock get locked. I don't see how i_ceph_lock can

Re: [PATCH] MAINTAINERS: take over for Zheng as CephFS kernel client maintainer

2019-06-26 Thread Yan, Zheng
On 6/26/19 7:26 PM, Jeff Layton wrote: Zheng wants to be able to spend more time working on the MDS, so I've volunteered to take over for him as the CephFS kernel client maintainer. ACK Thanks Yan, Zheng Signed-off-by: Jeff Layton --- MAINTAINERS | 4 ++-- 1 file changed, 2 insertions

Re: [PATCH v4 3/3] ceph: don't NULL terminate virtual xattrs

2019-06-25 Thread Yan, Zheng
On Tue, Jun 25, 2019 at 4:18 AM Jeff Layton wrote: > > The convention with xattrs is to not store the termination with string > data, given that it returns the length. This is how setfattr/getfattr > operate. > > Most of ceph's virtual xattr routines use snprintf to plop the string > directly

Re: [PATCH v3 0/2] ceph: don't NULL terminate virtual xattr values

2019-06-24 Thread Yan, Zheng
On Fri, Jun 21, 2019 at 10:21 PM Jeff Layton wrote: > > v3: switch to using an intermediate buffer for snprintf destination > add patch to fix ceph_vxattrcb_layout return value > v2: drop bogus EXPORT_SYMBOL of static function > > This is the 3rd posting of this patchset. Instead of adding a

Re: [PATCH 1/3] lib/vsprintf: add snprintf_noterm

2019-06-14 Thread Yan, Zheng
On Fri, Jun 14, 2019 at 9:48 PM Jeff Layton wrote: > > The getxattr interface returns a length after filling out the value > buffer, and the convention with xattrs is to not NULL terminate string > data. > > CephFS implements some virtual xattrs by using snprintf to fill the > buffer, but that

[PATCH] ceph: use ceph_evict_inode to cleanup inode's resource

2019-06-01 Thread Yan, Zheng
remove_session_caps() relies on __wait_on_freeing_inode(), to wait for freezing inode to remove its caps. But VFS wakes freeing inode waiters before calling destroy_inode(). Signed-off-by: "Yan, Zheng" --- fs/ceph/inode.c | 25 ++--- fs/ceph/super.c | 1 + fs/ce

New CephFS kernel client maintainer

2019-05-30 Thread Yan, Zheng
, the CIFS client and the kernel's VFS layer. I will continue to work on CephFS, but spend more time on improving CephFS metadata server. Regards Yan, Zheng

Re: [PATCH 8/8] ceph: hold i_ceph_lock when removing caps for freeing inode

2019-05-29 Thread Yan, Zheng
b985d18 ("libceph: variable-sized ceph_object_id") d3383a8e37f80 ("ceph: avoid block operation when !TASK_RUNNING (ceph_mdsc_sync)") e3ec8d6898f71 ("ceph: send cap releases more aggressively") e96a650a8174e ("ceph, rbd: delete unnecessary checks

Re: [PATCH] ceph: fix warning PTR_ERR_OR_ZERO can be used

2019-05-25 Thread Yan, Zheng
nt %p ino %llx.%llx err=%ld\n", -child, ceph_vinop(inode), (IS_ERR(dn) ? PTR_ERR(dn) : 0)); +child, ceph_vinop(inode), (long)PTR_ERR_OR_ZERO(dn)); return dn; } Applied. Thanks Yan, Zheng

[PATCH 2/8] ceph: single workqueue for inode related works

2019-05-23 Thread Yan, Zheng
We have three workqueue for inode works. Later patch will introduce one more work for inode. It's not good to introcuce more workqueue and add more 'struct work_struct' to 'struct ceph_inode_info'. Signed-off-by: "Yan, Zheng" --- fs/ceph/file.c | 2 +- fs/ceph/ino

[PATCH 3/8] ceph: avoid iput_final() while holding mutex or in dispatch thread

2019-05-23 Thread Yan, Zheng
. In general, it's not good to call iput_final() inside MDS/OSD threads or while holding any mutex. The fix is introducing ceph_async_iput(), which calls iput_final() in workqueue. Signed-off-by: "Yan, Zheng" --- fs/ceph/caps.c | 12 fs/ceph/inode.c

[PATCH 6/8] ceph: use READ_ONCE to access d_parent in RCU critical section

2019-05-23 Thread Yan, Zheng
Signed-off-by: "Yan, Zheng" --- fs/ceph/mds_client.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 60e8ddbdfdc5..870754e9d572 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -913,7 +913,7

[PATCH 8/8] ceph: hold i_ceph_lock when removing caps for freeing inode

2019-05-23 Thread Yan, Zheng
ceph_d_revalidate(, LOOKUP_RCU) may call __ceph_caps_issued_mask() on a freeing inode. Cc: sta...@vger.kernel.org Signed-off-by: "Yan, Zheng" --- fs/ceph/caps.c | 10 ++ fs/ceph/inode.c | 2 +- fs/ceph/super.h | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff

[PATCH 4/8] ceph: close race between d_name_cmp() and update_dentry_lease()

2019-05-23 Thread Yan, Zheng
ode is locked. It does not need to check parent/target inode and dentry name. Another version is for the case that parent inode is not locked. It checks arent/target inode and dentry name after locking dentry->d_lock. Signed-off-by: "Yan, Zheng" --- fs/ce

[PATCH 5/8] ceph: fix dir_lease_is_valid()

2019-05-23 Thread Yan, Zheng
It should call __ceph_dentry_dir_lease_touch() under dentry->d_lock. Besides, ceph_dentry(dentry) can be NULL when called by LOOKUP_RCU d_revalidate() Cc: sta...@vger.kernel.org # v5.1+ Signed-off-by: "Yan, Zheng" --- fs/ceph/dir.c | 26 +- 1 file changed,

[PATCH 7/8] ceph: ensure d_name/d_parent stability in ceph_mdsc_lease_send_msg()

2019-05-23 Thread Yan, Zheng
Signed-off-by: "Yan, Zheng" --- fs/ceph/dir.c| 7 +++ fs/ceph/mds_client.c | 24 +--- fs/ceph/mds_client.h | 1 - 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index 1271024a3797..72efad28857c 100644 ---

[PATCH 1/8] ceph: fix error handling in ceph_get_caps()

2019-05-23 Thread Yan, Zheng
The function return 0 even when interrupted or try_get_cap_refs() return error. Introduce by commit 1199d7da2d "ceph: simplify arguments and return semantics of try_get_cap_refs" Signed-off-by: "Yan, Zheng" --- fs/ceph/caps.c | 22 +++--- 1 file changed,

Re: [PATCH 4/4] ceph: fix improper use of smp_mb__before_atomic()

2019-05-20 Thread Yan, Zheng
kernel.org Reported-by: "Paul E. McKenney" Reported-by: Peter Zijlstra Signed-off-by: Andrea Parri Cc: "Yan, Zheng" Cc: Sage Weil Cc: Ilya Dryomov Cc: ceph-de...@vger.kernel.org Cc: "Paul E. McKenney" Cc: Peter Zijlstra --- fs/ceph/super.h | 7 ++- 1 file chang

Re: [PATCH 4/5] ceph: fix improper use of smp_mb__before_atomic()

2019-05-13 Thread Yan, Zheng
On 5/10/19 4:55 AM, Andrea Parri wrote: On Tue, Apr 30, 2019 at 05:08:43PM +0800, Yan, Zheng wrote: On Tue, Apr 30, 2019 at 4:26 PM Peter Zijlstra wrote: On Mon, Apr 29, 2019 at 10:15:00PM +0200, Andrea Parri wrote: This barrier only applies to the read-modify-write operations

Re: [PATCH 4/5] ceph: fix improper use of smp_mb__before_atomic()

2019-04-30 Thread Yan, Zheng
On Tue, Apr 30, 2019 at 4:26 PM Peter Zijlstra wrote: > > On Mon, Apr 29, 2019 at 10:15:00PM +0200, Andrea Parri wrote: > > This barrier only applies to the read-modify-write operations; in > > particular, it does not apply to the atomic64_set() primitive. > > > > Replace the barrier with an

Re: [PATCH] ceph: Fix a memory leak in ci->i_head_snapc

2019-04-17 Thread Yan, Zheng
On Tue, Apr 16, 2019 at 9:30 PM Luis Henriques wrote: > > Luis Henriques writes: > > > "Yan, Zheng" writes: > > > >> On Fri, Mar 22, 2019 at 6:04 PM Luis Henriques wrote: > >>> > >>> Luis Henriques writes: > >>> >

Re: [PATCH] ceph: Fix a memory leak in ci->i_head_snapc

2019-04-02 Thread Yan, Zheng
On Fri, Mar 22, 2019 at 6:04 PM Luis Henriques wrote: > > Luis Henriques writes: > > > "Yan, Zheng" writes: > > > >> On Tue, Mar 19, 2019 at 12:22 AM Luis Henriques > >> wrote: > >>> > >>> "Yan, Zheng" w

Re: [RFC PATCH] ceph: Convert to fs_context

2019-03-27 Thread Yan, Zheng
On Wed, Mar 20, 2019 at 10:53 PM David Howells wrote: > > Signed-off-by: David Howells > cc: Ilya Dryomov > cc: "Yan, Zheng" > cc: Sage Weil > cc: ceph-de...@vger.kernel.org > --- > > drivers/block/rbd.c | 362 +++- >

Re: [RFC PATCH] ceph: Convert to fs_context

2019-03-25 Thread Yan, Zheng
On Wed, Mar 20, 2019 at 10:53 PM David Howells wrote: > > Signed-off-by: David Howells > cc: Ilya Dryomov > cc: "Yan, Zheng" > cc: Sage Weil > cc: ceph-de...@vger.kernel.org > --- > > drivers/block/rbd.c | 362 +++- >

Re: [PATCH] ceph: Fix a memory leak in ci->i_head_snapc

2019-03-18 Thread Yan, Zheng
On Tue, Mar 19, 2019 at 12:22 AM Luis Henriques wrote: > > "Yan, Zheng" writes: > > > On Mon, Mar 18, 2019 at 6:33 PM Luis Henriques wrote: > >> > >> "Yan, Zheng" writes: > >> > >> > On Fri, Mar 15, 2019 at 7:13

Re: [PATCH v2 2/2] ceph: quota: fix quota subdir mounts

2019-03-18 Thread Yan, Zheng
On Tue, Mar 12, 2019 at 10:22 PM Luis Henriques wrote: > > The CephFS kernel client does not enforce quotas set in a directory that > isn't visible from the mount point. For example, given the path > '/dir1/dir2', if quotas are set in 'dir1' and the filesystem is mounted with > > mount -t ceph

Re: [PATCH v2 2/2] ceph: quota: fix quota subdir mounts

2019-03-18 Thread Yan, Zheng
On Mon, Mar 18, 2019 at 6:55 PM Luis Henriques wrote: > > "Yan, Zheng" writes: > > > On Mon, Mar 18, 2019 at 5:06 PM Gregory Farnum wrote: > >> > >> On Mon, Mar 18, 2019 at 2:32 PM Yan, Zheng wrote: > >> > After re

Re: [PATCH] ceph: Fix a memory leak in ci->i_head_snapc

2019-03-18 Thread Yan, Zheng
On Mon, Mar 18, 2019 at 6:33 PM Luis Henriques wrote: > > "Yan, Zheng" writes: > > > On Fri, Mar 15, 2019 at 7:13 PM Luis Henriques wrote: > >> > >> I'm occasionally seeing a kmemleak warning in xfstest generic/013: > >> > >>

Re: [PATCH v2 2/2] ceph: quota: fix quota subdir mounts

2019-03-18 Thread Yan, Zheng
On Mon, Mar 18, 2019 at 5:06 PM Gregory Farnum wrote: > > On Mon, Mar 18, 2019 at 2:32 PM Yan, Zheng wrote: > > After reading the code carefully. I feel a little uncomfortable with > > the "lookup_ino" in get_quota_realm. how about populating directories > &g

Re: [PATCH v2 2/2] ceph: quota: fix quota subdir mounts

2019-03-18 Thread Yan, Zheng
ceph_put_snap_realm(mdsc, realm); > + goto restart; > + } > ci = ceph_inode(in); > spin_lock(>i_ceph_lock); > if (op == QUOTA_CHECK_MAX_FILES_OP) { > @@ -314,7 +400,7 @@ bool ceph_quota_update_statfs(struct ceph_fs_client *fsc, > struct kstatfs *buf) > bool is_updated = false; > > down_read(>snap_rwsem); > - realm = get_quota_realm(mdsc, d_inode(fsc->sb->s_root)); > + realm = get_quota_realm(mdsc, d_inode(fsc->sb->s_root), true); > up_read(>snap_rwsem); > if (!realm) > return false; > diff --git a/fs/ceph/super.h b/fs/ceph/super.h > index ce51e98b08ec..cc7766aeb73b 100644 > --- a/fs/ceph/super.h > +++ b/fs/ceph/super.h > @@ -375,6 +375,8 @@ struct ceph_inode_info { > struct list_head i_snap_realm_item; > struct list_head i_snap_flush_item; > > + struct list_head i_quotarealms_inode_item; > + > struct work_struct i_wb_work; /* writeback work */ > struct work_struct i_pg_inv_work; /* page invalidation work */ > After reading the code carefully. I feel a little uncomfortable with the "lookup_ino" in get_quota_realm. how about populating directories above the 'mount subdir' during mounting (similar to cifs_get_root ). Regards Yan, Zheng

Re: [PATCH] ceph: Fix a memory leak in ci->i_head_snapc

2019-03-17 Thread Yan, Zheng
On Fri, Mar 15, 2019 at 7:13 PM Luis Henriques wrote: > > I'm occasionally seeing a kmemleak warning in xfstest generic/013: > > unreferenced object 0x8881fccca940 (size 32): > comm "kworker/0:1", pid 12, jiffies 4295005883 (age 130.648s) > hex dump (first 32 bytes): > 01 00 00 00 00

Re: [PATCH 2/2] ceph: quota: fix quota subdir mounts

2019-03-10 Thread Yan, Zheng
On Sat, Mar 9, 2019 at 12:30 AM Luis Henriques wrote: > > The CephFS kernel client does not enforce quotas set in a directory that isn't > visible from the mount point. For example, given the path '/dir1/dir2', if > quotas > are set in 'dir1' and the filesystem is mounted with > > mount -t

Re: [RFC PATCH 2/2] ceph: quota: fix quota subdir mounts

2019-03-07 Thread Yan, Zheng
On Thu, Mar 7, 2019 at 7:02 PM Luis Henriques wrote: > > "Yan, Zheng" writes: > > > On Thu, Mar 7, 2019 at 2:21 AM Luis Henriques wrote: > >> > >> "Yan, Zheng" writes: > >> > >> > On Sat, Mar 2, 2019 at 3:13 AM Luis

Re: [RFC PATCH 2/2] ceph: quota: fix quota subdir mounts

2019-03-06 Thread Yan, Zheng
On Thu, Mar 7, 2019 at 2:21 AM Luis Henriques wrote: > > "Yan, Zheng" writes: > > > On Sat, Mar 2, 2019 at 3:13 AM Luis Henriques wrote: > >> > >> The CephFS kernel client doesn't enforce quotas that are set in a > >> directory that i

Re: [RFC PATCH 2/2] ceph: quota: fix quota subdir mounts

2019-03-03 Thread Yan, Zheng
On Sat, Mar 2, 2019 at 3:13 AM Luis Henriques wrote: > > The CephFS kernel client doesn't enforce quotas that are set in a > directory that isn't visible in the mount point. For example, given the > path '/dir1/dir2', if quotas are set in 'dir1' and the mount is done in with > > mount -t ceph

Re: [PATCH] ceph: quota: fix null pointer dereference in quota check

2018-11-06 Thread Yan, Zheng
tic bool check_quota_exceeded(struct inode *inode, > enum quota_check_op op, > ceph_put_snap_realm(mdsc, realm); > realm = next; > } > - ceph_put_snap_realm(mdsc, realm); > + if (realm) > + ceph_put_snap_realm(mdsc, realm); > up_read(>snap_rwsem); > > return exceeded; Applied, thanks. Yan, Zheng

Re: [PATCH] ceph: quota: fix null pointer dereference in quota check

2018-11-06 Thread Yan, Zheng
tic bool check_quota_exceeded(struct inode *inode, > enum quota_check_op op, > ceph_put_snap_realm(mdsc, realm); > realm = next; > } > - ceph_put_snap_realm(mdsc, realm); > + if (realm) > + ceph_put_snap_realm(mdsc, realm); > up_read(>snap_rwsem); > > return exceeded; Applied, thanks. Yan, Zheng

Re: [PATCH] ceph: add destination file data sync before doing any remote copy

2018-10-23 Thread Yan, Zheng
goto out; > + } > > /* > * We need FILE_WR caps for dst_ci and FILE_RD for src_ci as other Applied, thanks Yan, Zheng

Re: [PATCH] ceph: add destination file data sync before doing any remote copy

2018-10-23 Thread Yan, Zheng
goto out; > + } > > /* > * We need FILE_WR caps for dst_ci and FILE_RD for src_ci as other Applied, thanks Yan, Zheng

Re: [PATCH] ceph: only allow punch hole mode in fallocate

2018-10-09 Thread Yan, Zheng
gt; @@ -1817,9 +1793,6 @@ static long ceph_fallocate(struct file *file, int mode, > spin_unlock(>i_ceph_lock); > if (dirty) > __mark_inode_dirty(inode, dirty); > - if ((endoff > size) && > - ceph_quota_is_max_bytes_approaching(inode, endoff)) > - ceph_check_caps(ci, CHECK_CAPS_NODELAY, NULL); > } > > ceph_put_cap_refs(ci, got); Applied, thanks Yan, Zheng

Re: [PATCH] ceph: only allow punch hole mode in fallocate

2018-10-09 Thread Yan, Zheng
gt; @@ -1817,9 +1793,6 @@ static long ceph_fallocate(struct file *file, int mode, > spin_unlock(>i_ceph_lock); > if (dirty) > __mark_inode_dirty(inode, dirty); > - if ((endoff > size) && > - ceph_quota_is_max_bytes_approaching(inode, endoff)) > - ceph_check_caps(ci, CHECK_CAPS_NODELAY, NULL); > } > > ceph_put_cap_refs(ci, got); Applied, thanks Yan, Zheng

Re: [PATCH v2 04/17] ceph: fix compat_ioctl for ceph_dir_operations

2018-09-12 Thread Yan, Zheng
+1489,7 @@ const struct file_operations ceph_dir_fops = { > .open = ceph_open, > .release = ceph_release, > .unlocked_ioctl = ceph_ioctl, > + .compat_ioctl = ceph_ioctl, > .fsync = ceph_fsync, > .lock = ceph_lock, > .flock = ceph_flock, > -- > 2.18.0 > Reviewed-by: "Yan, Zheng"

Re: [PATCH v2 04/17] ceph: fix compat_ioctl for ceph_dir_operations

2018-09-12 Thread Yan, Zheng
+1489,7 @@ const struct file_operations ceph_dir_fops = { > .open = ceph_open, > .release = ceph_release, > .unlocked_ioctl = ceph_ioctl, > + .compat_ioctl = ceph_ioctl, > .fsync = ceph_fsync, > .lock = ceph_lock, > .flock = ceph_flock, > -- > 2.18.0 > Reviewed-by: "Yan, Zheng"

Re: [PATCH v2] fs: ceph: Adding new return type vm_fault_t

2018-07-23 Thread Yan, Zheng
set_page_dirty(page); > ret = VM_FAULT_LOCKED; > } > - } while (ret == -EAGAIN); > + } while (err == -EAGAIN); > > if (ret == VM_FAULT_LOCKED || > ci->i_inline_version != CEPH_INLINE_NONE) { > @@ -1610,14 +1612,14 @@ static int ceph_page_mkwrite(struct vm_fault *vmf) > __mark_inode_dirty(inode, dirty); > } > > - dout("page_mkwrite %p %llu~%zd dropping cap refs on %s ret %d\n", > + dout("page_mkwrite %p %llu~%zd dropping cap refs on %s ret %x\n", >inode, off, len, ceph_cap_string(got), ret); > ceph_put_cap_refs(ci, got); > out_free: > ceph_restore_sigs(); > ceph_free_cap_flush(prealloc_cf); > - if (ret < 0) > - ret = (ret == -ENOMEM) ? VM_FAULT_OOM : VM_FAULT_SIGBUS; > + if (err < 0) > + ret = vmf_error(err); > return ret; > } > Applied, Thanks Yan, Zheng > -- > 1.9.1 >

Re: [PATCH v2] fs: ceph: Adding new return type vm_fault_t

2018-07-23 Thread Yan, Zheng
set_page_dirty(page); > ret = VM_FAULT_LOCKED; > } > - } while (ret == -EAGAIN); > + } while (err == -EAGAIN); > > if (ret == VM_FAULT_LOCKED || > ci->i_inline_version != CEPH_INLINE_NONE) { > @@ -1610,14 +1612,14 @@ static int ceph_page_mkwrite(struct vm_fault *vmf) > __mark_inode_dirty(inode, dirty); > } > > - dout("page_mkwrite %p %llu~%zd dropping cap refs on %s ret %d\n", > + dout("page_mkwrite %p %llu~%zd dropping cap refs on %s ret %x\n", >inode, off, len, ceph_cap_string(got), ret); > ceph_put_cap_refs(ci, got); > out_free: > ceph_restore_sigs(); > ceph_free_cap_flush(prealloc_cf); > - if (ret < 0) > - ret = (ret == -ENOMEM) ? VM_FAULT_OOM : VM_FAULT_SIGBUS; > + if (err < 0) > + ret = vmf_error(err); > return ret; > } > Applied, Thanks Yan, Zheng > -- > 1.9.1 >

Re: [PATCH] fs: ceph: Adding new return type vm_fault_t

2018-07-23 Thread Yan, Zheng
set_page_dirty(page); > ret = VM_FAULT_LOCKED; > } > - } while (ret == -EAGAIN); > + } while (err == -EAGAIN); > > if (ret == VM_FAULT_LOCKED || > ci->i_inline_version != CEPH_INLINE_NONE) { > @@ -1606,14 +1608,14 @@ static int ceph_page_mkwrite(struct vm_fault *vmf) > __mark_inode_dirty(inode, dirty); > } > > - dout("page_mkwrite %p %llu~%zd dropping cap refs on %s ret %d\n", > + dout("page_mkwrite %p %llu~%zd dropping cap refs on %s ret %x\n", >inode, off, len, ceph_cap_string(got), ret); > ceph_put_cap_refs(ci, got); > out_free: > ceph_restore_sigs(); > ceph_free_cap_flush(prealloc_cf); > - if (ret < 0) > - ret = (ret == -ENOMEM) ? VM_FAULT_OOM : VM_FAULT_SIGBUS; > + if (err < 0) > + ret = vmf_error(err); > return ret; > } > Applied, thanks Yan, Zheng > -- > 1.9.1 >

Re: [PATCH] fs: ceph: Adding new return type vm_fault_t

2018-07-23 Thread Yan, Zheng
set_page_dirty(page); > ret = VM_FAULT_LOCKED; > } > - } while (ret == -EAGAIN); > + } while (err == -EAGAIN); > > if (ret == VM_FAULT_LOCKED || > ci->i_inline_version != CEPH_INLINE_NONE) { > @@ -1606,14 +1608,14 @@ static int ceph_page_mkwrite(struct vm_fault *vmf) > __mark_inode_dirty(inode, dirty); > } > > - dout("page_mkwrite %p %llu~%zd dropping cap refs on %s ret %d\n", > + dout("page_mkwrite %p %llu~%zd dropping cap refs on %s ret %x\n", >inode, off, len, ceph_cap_string(got), ret); > ceph_put_cap_refs(ci, got); > out_free: > ceph_restore_sigs(); > ceph_free_cap_flush(prealloc_cf); > - if (ret < 0) > - ret = (ret == -ENOMEM) ? VM_FAULT_OOM : VM_FAULT_SIGBUS; > + if (err < 0) > + ret = vmf_error(err); > return ret; > } > Applied, thanks Yan, Zheng > -- > 1.9.1 >

Re: [PATCH 2/5] ceph: stop using current_kernel_time()

2018-07-15 Thread Yan, Zheng
The cephfs part (patch 2~5) looks good for me. Regards Yan, Zheng On Sat, Jul 14, 2018 at 4:21 AM Arnd Bergmann wrote: > > ceph_mdsc_create_request() is one of the last callers of the > deprecated current_kernel_time() as well as timespec_trunc(). > > This changes it to use

Re: [PATCH 2/5] ceph: stop using current_kernel_time()

2018-07-15 Thread Yan, Zheng
The cephfs part (patch 2~5) looks good for me. Regards Yan, Zheng On Sat, Jul 14, 2018 at 4:21 AM Arnd Bergmann wrote: > > ceph_mdsc_create_request() is one of the last callers of the > deprecated current_kernel_time() as well as timespec_trunc(). > > This changes it to use

Re: [PATCH] ceph: fix use-after-free in ceph_statfs

2018-05-29 Thread Yan, Zheng
the fsid, for consistent values across arches */ > - fsid = le64_to_cpu(*(__le64 *)(>fsid)) ^ > - le64_to_cpu(*((__le64 *)>fsid + 1)); > + mutex_lock(>mutex); > + fsid = le64_to_cpu(*(__le64 *)(>monmap->fsid)) ^ > + le64_to_cpu(*((__le64 *)>monmap->fsid + 1)); > + mutex_unlock(>mutex); > + > buf->f_fsid.val[0] = fsid & 0x; > buf->f_fsid.val[1] = fsid >> 32; > Applied, thanks Yan, Zheng > -- > To unsubscribe from this list: send the line "unsubscribe ceph-devel" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] ceph: fix use-after-free in ceph_statfs

2018-05-29 Thread Yan, Zheng
the fsid, for consistent values across arches */ > - fsid = le64_to_cpu(*(__le64 *)(>fsid)) ^ > - le64_to_cpu(*((__le64 *)>fsid + 1)); > + mutex_lock(>mutex); > + fsid = le64_to_cpu(*(__le64 *)(>monmap->fsid)) ^ > + le64_to_cpu(*((__le64 *)>monmap->fsid + 1)); > + mutex_unlock(>mutex); > + > buf->f_fsid.val[0] = fsid & 0x; > buf->f_fsid.val[1] = fsid >> 32; > Applied, thanks Yan, Zheng > -- > To unsubscribe from this list: send the line "unsubscribe ceph-devel" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] ceph: fix st_nlink stat for directories

2018-05-21 Thread Yan, Zheng
t; + */ > + if (stat->nlink == 1) > + /* '.' + '..' + subdirs */ > + stat->nlink = 1 + 1 + ci->i_subdirs; > } > } > return err; Applied, thanks. Yan, Zheng

Re: [PATCH] ceph: fix st_nlink stat for directories

2018-05-21 Thread Yan, Zheng
t; + /* '.' + '..' + subdirs */ > + stat->nlink = 1 + 1 + ci->i_subdirs; > } > } > return err; Applied, thanks. Yan, Zheng

Re: [PATCH] mm: save/restore current->journal_info in handle_mm_fault

2017-12-14 Thread Yan, Zheng
On Fri, Dec 15, 2017 at 12:53 AM, Jan Kara <j...@suse.cz> wrote: > On Thu 14-12-17 22:30:26, Yan, Zheng wrote: >> On Thu, Dec 14, 2017 at 9:43 PM, Jan Kara <j...@suse.cz> wrote: >> > On Thu 14-12-17 18:55:27, Yan, Zheng wrote: >> >> We recently got an Oops

Re: [PATCH] mm: save/restore current->journal_info in handle_mm_fault

2017-12-14 Thread Yan, Zheng
On Fri, Dec 15, 2017 at 12:53 AM, Jan Kara wrote: > On Thu 14-12-17 22:30:26, Yan, Zheng wrote: >> On Thu, Dec 14, 2017 at 9:43 PM, Jan Kara wrote: >> > On Thu 14-12-17 18:55:27, Yan, Zheng wrote: >> >> We recently got an Oops report: >> >> >&

Re: [PATCH] mm: save/restore current->journal_info in handle_mm_fault

2017-12-14 Thread Yan, Zheng
On Thu, Dec 14, 2017 at 9:43 PM, Jan Kara <j...@suse.cz> wrote: > On Thu 14-12-17 18:55:27, Yan, Zheng wrote: >> We recently got an Oops report: >> >> BUG: unable to handle kernel NULL pointer dereference at (null) >> IP: jbd2__journal_start+

Re: [PATCH] mm: save/restore current->journal_info in handle_mm_fault

2017-12-14 Thread Yan, Zheng
On Thu, Dec 14, 2017 at 9:43 PM, Jan Kara wrote: > On Thu 14-12-17 18:55:27, Yan, Zheng wrote: >> We recently got an Oops report: >> >> BUG: unable to handle kernel NULL pointer dereference at (null) >> IP: jbd2__journal_start+0x38/0x1a2 >> [...] >> Call Tr

[PATCH] mm: save/restore current->journal_info in handle_mm_fault

2017-12-14 Thread Yan, Zheng
page) Cc: sta...@vger.kernel.org Signed-off-by: "Yan, Zheng" <z...@redhat.com> --- mm/memory.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/mm/memory.c b/mm/memory.c index a728bed16c20..db2a50233c49 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4044,6 +4044

[PATCH] mm: save/restore current->journal_info in handle_mm_fault

2017-12-14 Thread Yan, Zheng
page) Cc: sta...@vger.kernel.org Signed-off-by: "Yan, Zheng" --- mm/memory.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/mm/memory.c b/mm/memory.c index a728bed16c20..db2a50233c49 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4044,6 +4044,7 @@ int han

Re: [PATCH] mm: save current->journal_info before calling fault/page_mkwrite

2017-12-13 Thread Yan, Zheng
> On 14 Dec 2017, at 08:59, Andrew Morton <a...@linux-foundation.org> wrote: > > On Wed, 13 Dec 2017 11:58:36 +0800 "Yan, Zheng" <z...@redhat.com> wrote: > >> We recently got an Oops report: >> >> BUG: unable to handle kernel NULL pointer d

Re: [PATCH] mm: save current->journal_info before calling fault/page_mkwrite

2017-12-13 Thread Yan, Zheng
> On 14 Dec 2017, at 08:59, Andrew Morton wrote: > > On Wed, 13 Dec 2017 11:58:36 +0800 "Yan, Zheng" wrote: > >> We recently got an Oops report: >> >> BUG: unable to handle kernel NULL pointer dereference at (null) >> IP: jbd2__j

Re: [PATCH] mm: save current->journal_info before calling fault/page_mkwrite

2017-12-13 Thread Yan, Zheng
> On 14 Dec 2017, at 08:59, Andrew Morton <a...@linux-foundation.org> wrote: > > On Wed, 13 Dec 2017 11:58:36 +0800 "Yan, Zheng" <z...@redhat.com> wrote: > >> We recently got an Oops report: >> >> BUG: unable to handle kernel NULL pointer d

Re: [PATCH] mm: save current->journal_info before calling fault/page_mkwrite

2017-12-13 Thread Yan, Zheng
> On 14 Dec 2017, at 08:59, Andrew Morton wrote: > > On Wed, 13 Dec 2017 11:58:36 +0800 "Yan, Zheng" wrote: > >> We recently got an Oops report: >> >> BUG: unable to handle kernel NULL pointer dereference at (null) >> IP: jbd2__j

[PATCH] mm: save current->journal_info before calling fault/page_mkwrite

2017-12-12 Thread Yan, Zheng
ace memory is mapped to a file on another filesystem, the later filesystem may also want to use current->journal_info. Signed-off-by: "Yan, Zheng" <z...@redhat.com> --- mm/memory.c | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/mm/memory

[PATCH] mm: save current->journal_info before calling fault/page_mkwrite

2017-12-12 Thread Yan, Zheng
ace memory is mapped to a file on another filesystem, the later filesystem may also want to use current->journal_info. Signed-off-by: "Yan, Zheng" --- mm/memory.c | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/mm/memory.c b/mm/memory.c in

Re: [PATCH] ceph: Fix bool initialization/comparison

2017-10-08 Thread Yan, Zheng
gt; + bool wake_ci = false; > + bool wake_mdsc = false; > > list_for_each_entry_safe(cf, tmp_cf, >i_cap_flush_list, i_list) { > if (cf->tid == flush_tid) Applied, thanks Yan, Zheng

Re: [PATCH] ceph: Fix bool initialization/comparison

2017-10-08 Thread Yan, Zheng
wake_mdsc = false; > > list_for_each_entry_safe(cf, tmp_cf, >i_cap_flush_list, i_list) { > if (cf->tid == flush_tid) Applied, thanks Yan, Zheng

Re: [PATCH 0/3] Ceph: Adjustments for some function implementations

2017-08-20 Thread Yan, Zheng
| 18 +- > fs/ceph/xattr.c | 8 > 10 files changed, 38 insertions(+), 42 deletions(-) > > — Whole series applied, thanks Yan, Zheng > 2.14.0 >

Re: [PATCH 0/3] Ceph: Adjustments for some function implementations

2017-08-20 Thread Yan, Zheng
anged, 38 insertions(+), 42 deletions(-) > > — Whole series applied, thanks Yan, Zheng > 2.14.0 >

Re: [PATCH 1/2] ceph: use errseq_t for writeback error reporting

2017-07-26 Thread Yan, Zheng
= file_write_and_wait_range(file, start, end); > if (ret < 0) > goto out; > > -- > 2.13.3 > Reviewed-by: "Yan, Zheng" <z...@redhat.com>

Re: [PATCH 1/2] ceph: use errseq_t for writeback error reporting

2017-07-26 Thread Yan, Zheng
nd, int datasync) > > dout("fsync %p%s\n", inode, datasync ? " datasync" : ""); > > - ret = filemap_write_and_wait_range(inode->i_mapping, start, end); > + ret = file_write_and_wait_range(file, start, end); > if (ret < 0) > goto out; > > -- > 2.13.3 > Reviewed-by: "Yan, Zheng"

Re: [PATCH 2/2] ceph: pagecache writeback fault injection switch

2017-07-26 Thread Yan, Zheng
eph_fs_client { > > unsigned long mount_state; > int min_caps; /* min caps i added */ > + bool wb_fault; > > struct ceph_mds_client *mdsc; > > @@ -100,6 +101,7 @@ struct ceph_fs_client { > struct dentry *debugfs_bdi; > struct dentry *debugfs_mdsc, *debugfs_mdsmap; > struct dentry *debugfs_mds_sessions; > + struct dentry *debugfs_wb_fault; > #endif > I think it's better not to enable this feature by default. Enabling it by compilation option or mount option? Regards Yan, Zheng > #ifdef CONFIG_CEPH_FSCACHE > -- > 2.13.3 >

Re: [PATCH 2/2] ceph: pagecache writeback fault injection switch

2017-07-26 Thread Yan, Zheng
aps; /* min caps i added */ > + bool wb_fault; > > struct ceph_mds_client *mdsc; > > @@ -100,6 +101,7 @@ struct ceph_fs_client { > struct dentry *debugfs_bdi; > struct dentry *debugfs_mdsc, *debugfs_mdsmap; > struct dentry *debugfs_mds_sessions; > + struct dentry *debugfs_wb_fault; > #endif > I think it's better not to enable this feature by default. Enabling it by compilation option or mount option? Regards Yan, Zheng > #ifdef CONFIG_CEPH_FSCACHE > -- > 2.13.3 >

Re: [PATCH] ceph: kernel client startsync can be removed

2017-07-23 Thread Yan, Zheng
> @@ -916,9 +914,6 @@ static u32 osd_req_encode_op(struct ceph_osd_op *dst, > * if the file was recently truncated, we include information about its > * old and new size so that the object can be updated appropriately. (we > * avoid synchronously deleting truncated objects because it's slow.) > - * > - * if @do_sync, include a 'startsync' command so that the osd will flush > - * data quickly. > */ > struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc, > struct ceph_file_layout *layout, > -- > 1.8.3.1 > Applied, thanks. Yan, Zheng

Re: [PATCH] ceph: kernel client startsync can be removed

2017-07-23 Thread Yan, Zheng
14,6 @@ static u32 osd_req_encode_op(struct ceph_osd_op *dst, > * if the file was recently truncated, we include information about its > * old and new size so that the object can be updated appropriately. (we > * avoid synchronously deleting truncated objects because it's slow.) > - * > - * if @do_sync, include a 'startsync' command so that the osd will flush > - * data quickly. > */ > struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc, > struct ceph_file_layout *layout, > -- > 1.8.3.1 > Applied, thanks. Yan, Zheng

Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts()

2017-06-04 Thread Yan, Zheng
On Fri, Jun 2, 2017 at 10:18 PM, Arnd Bergmann <a...@arndb.de> wrote: > On Fri, Jun 2, 2017 at 2:18 PM, Yan, Zheng <uker...@gmail.com> wrote: >> On Fri, Jun 2, 2017 at 7:33 PM, Arnd Bergmann <a...@arndb.de> wrote: >>> On Fri, Jun 2, 2017 at 1:18 PM, Yan, Zheng &

Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts()

2017-06-04 Thread Yan, Zheng
On Fri, Jun 2, 2017 at 10:18 PM, Arnd Bergmann wrote: > On Fri, Jun 2, 2017 at 2:18 PM, Yan, Zheng wrote: >> On Fri, Jun 2, 2017 at 7:33 PM, Arnd Bergmann wrote: >>> On Fri, Jun 2, 2017 at 1:18 PM, Yan, Zheng wrote: >>> What I meant is another related pr

Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts()

2017-06-02 Thread Yan, Zheng
On Fri, Jun 2, 2017 at 7:33 PM, Arnd Bergmann <a...@arndb.de> wrote: > On Fri, Jun 2, 2017 at 1:18 PM, Yan, Zheng <uker...@gmail.com> wrote: >> On Fri, Jun 2, 2017 at 6:51 PM, Arnd Bergmann <a...@arndb.de> wrote: >>> On Fri, Jun 2, 2017 at 12:10 PM,

Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts()

2017-06-02 Thread Yan, Zheng
On Fri, Jun 2, 2017 at 7:33 PM, Arnd Bergmann wrote: > On Fri, Jun 2, 2017 at 1:18 PM, Yan, Zheng wrote: >> On Fri, Jun 2, 2017 at 6:51 PM, Arnd Bergmann wrote: >>> On Fri, Jun 2, 2017 at 12:10 PM, Yan, Zheng wrote: >>>> On Fri, Jun 2, 2017 at 5:45 PM, Arnd Bergma

Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts()

2017-06-02 Thread Yan, Zheng
On Fri, Jun 2, 2017 at 6:51 PM, Arnd Bergmann <a...@arndb.de> wrote: > On Fri, Jun 2, 2017 at 12:10 PM, Yan, Zheng <uker...@gmail.com> wrote: >> On Fri, Jun 2, 2017 at 5:45 PM, Arnd Bergmann <a...@arndb.de> wrote: >>> On Fri, Jun 2, 2017 at 4:09 AM,

Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts()

2017-06-02 Thread Yan, Zheng
On Fri, Jun 2, 2017 at 6:51 PM, Arnd Bergmann wrote: > On Fri, Jun 2, 2017 at 12:10 PM, Yan, Zheng wrote: >> On Fri, Jun 2, 2017 at 5:45 PM, Arnd Bergmann wrote: >>> On Fri, Jun 2, 2017 at 4:09 AM, Yan, Zheng wrote: >>>> On Fri, Jun 2, 2017 at 8:57 AM, Deepa Dinam

Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts()

2017-06-02 Thread Yan, Zheng
On Fri, Jun 2, 2017 at 5:45 PM, Arnd Bergmann <a...@arndb.de> wrote: > On Fri, Jun 2, 2017 at 4:09 AM, Yan, Zheng <uker...@gmail.com> wrote: >> On Fri, Jun 2, 2017 at 8:57 AM, Deepa Dinamani <deepa.ker...@gmail.com> >> wrote: >>> On Thu, Jun 1, 2017 at 5:

Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts()

2017-06-02 Thread Yan, Zheng
On Fri, Jun 2, 2017 at 5:45 PM, Arnd Bergmann wrote: > On Fri, Jun 2, 2017 at 4:09 AM, Yan, Zheng wrote: >> On Fri, Jun 2, 2017 at 8:57 AM, Deepa Dinamani >> wrote: >>> On Thu, Jun 1, 2017 at 5:36 PM, John Stultz wrote: >>>> On Thu, Jun 1, 2017 at 5:26 PM,

Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts()

2017-06-01 Thread Yan, Zheng
On Fri, Jun 2, 2017 at 8:57 AM, Deepa Dinamani <deepa.ker...@gmail.com> wrote: > On Thu, Jun 1, 2017 at 5:36 PM, John Stultz <john.stu...@linaro.org> wrote: >> On Thu, Jun 1, 2017 at 5:26 PM, Yan, Zheng <uker...@gmail.com> wrote: >>> On Thu, Jun 1, 2017 at 6

Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts()

2017-06-01 Thread Yan, Zheng
On Fri, Jun 2, 2017 at 8:57 AM, Deepa Dinamani wrote: > On Thu, Jun 1, 2017 at 5:36 PM, John Stultz wrote: >> On Thu, Jun 1, 2017 at 5:26 PM, Yan, Zheng wrote: >>> On Thu, Jun 1, 2017 at 6:22 PM, Arnd Bergmann wrote: >>>> On Thu, Jun 1, 2017 at 11:56 AM, Yan, Zhe

Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts()

2017-06-01 Thread Yan, Zheng
On Thu, Jun 1, 2017 at 6:22 PM, Arnd Bergmann <a...@arndb.de> wrote: > On Thu, Jun 1, 2017 at 11:56 AM, Yan, Zheng <uker...@gmail.com> wrote: >> On Sat, Apr 8, 2017 at 8:57 AM, Deepa Dinamani <deepa.ker...@gmail.com> >> wrote: > >>> diff --git a/driver

Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts()

2017-06-01 Thread Yan, Zheng
On Thu, Jun 1, 2017 at 6:22 PM, Arnd Bergmann wrote: > On Thu, Jun 1, 2017 at 11:56 AM, Yan, Zheng wrote: >> On Sat, Apr 8, 2017 at 8:57 AM, Deepa Dinamani >> wrote: > >>> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c >>> index 517838b..77204da

Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts()

2017-06-01 Thread Yan, Zheng
On Thu, Jun 1, 2017 at 6:22 PM, Arnd Bergmann <a...@arndb.de> wrote: > On Thu, Jun 1, 2017 at 11:56 AM, Yan, Zheng <uker...@gmail.com> wrote: >> On Sat, Apr 8, 2017 at 8:57 AM, Deepa Dinamani <deepa.ker...@gmail.com> >> wrote: > >>> diff --git a/driver

Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts()

2017-06-01 Thread Yan, Zheng
On Thu, Jun 1, 2017 at 6:22 PM, Arnd Bergmann wrote: > On Thu, Jun 1, 2017 at 11:56 AM, Yan, Zheng wrote: >> On Sat, Apr 8, 2017 at 8:57 AM, Deepa Dinamani >> wrote: > >>> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c >>> index 517838b..77204da

Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts()

2017-06-01 Thread Yan, Zheng
->sb->s_time_gran); This change causes our kernel_untar_tar test case to fail (inode's ctime goes back). The reason is that there is time drift between the time stamps got by ktime_get_real_ts() and current_time(). We need to revert this change until current_time() uses ktime_get_real_ts() in

Re: [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts()

2017-06-01 Thread Yan, Zheng
gt; INIT_LIST_HEAD(>r_unsafe_item); > > - req->r_stamp = current_fs_time(mdsc->fsc->sb); > + ktime_get_real_ts(); > + req->r_stamp = timespec_trunc(ts, mdsc->fsc->sb->s_time_gran); This change causes our kernel_untar_tar test case to fai

Re: [PATCH] ceph: check i_nlink while converting a file handle to dentry

2017-05-18 Thread Yan, Zheng
> On 19 May 2017, at 00:48, Luis Henriques <lhenriq...@suse.com> wrote: > > On Thu, May 18, 2017 at 09:36:44PM +0800, Yan, Zheng wrote: >> >>> On 17 May 2017, at 19:21, Luis Henriques <lhenriq...@suse.com> wrote: >>> >>> Converting a fi

Re: [PATCH] ceph: check i_nlink while converting a file handle to dentry

2017-05-18 Thread Yan, Zheng
> On 19 May 2017, at 00:48, Luis Henriques wrote: > > On Thu, May 18, 2017 at 09:36:44PM +0800, Yan, Zheng wrote: >> >>> On 17 May 2017, at 19:21, Luis Henriques wrote: >>> >>> Converting a file handle to a dentry can be done call after the inode &

Re: [PATCH] ceph: check i_nlink while converting a file handle to dentry

2017-05-18 Thread Yan, Zheng
return ERR_PTR(-ESTALE); > + if (inode->i_nlink == 0) { > + iput(inode); > + return ERR_PTR(-ESTALE); > + } > } maybe we should do this check in MDS Regards Yan, Zheng > > return d_obtain_alias(inode);

Re: [PATCH] ceph: check i_nlink while converting a file handle to dentry

2017-05-18 Thread Yan, Zheng
node->i_nlink == 0) { > + iput(inode); > + return ERR_PTR(-ESTALE); > + } > } maybe we should do this check in MDS Regards Yan, Zheng > > return d_obtain_alias(inode);

Re: [PATCH] ceph: Check that the new inode size is within limits in ceph_fallocate()

2017-05-07 Thread Yan, Zheng
ZE)) > + if (!(mode & FALLOC_FL_KEEP_SIZE)) { > endoff = offset + length; > + ret = inode_newsize_ok(inode, endoff); > + if (ret) > + goto unlock; > + } > > if (fi->fmode & CEPH_F

Re: [PATCH] ceph: Check that the new inode size is within limits in ceph_fallocate()

2017-05-07 Thread Yan, Zheng
E)) { > endoff = offset + length; > + ret = inode_newsize_ok(inode, endoff); > + if (ret) > + goto unlock; > + } > > if (fi->fmode & CEPH_FILE_MODE_LAZY) > want = CEPH_CAP_

  1   2   3   4   5   6   7   8   9   10   >