<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Aug 2, 2021, at 6:00 PM, Gang He &lt;<a href="mailto:ghe@suse.com" class="">ghe@suse.com</a>&gt; wrote:</div>
<br class="Apple-interchange-newline">
<div class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">On
 2021/8/3 2:22, Wengang Wang wrote:</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<blockquote type="cite" class="">On Aug 1, 2021, at 9:35 PM, Gang He &lt;<a href="mailto:ghe@suse.com" class="">ghe@suse.com</a>&gt; wrote:<br class="">
<br class="">
Hi Wengang,<br class="">
<br class="">
The ocfs2 file system is mounted at /mnt/shared,<br class="">
The test file(e.g. 40G VM image) is located at /mnt/shared/test, the snapshot direcory is /mnt/shared/.snapshots, then the user runs a reflink command from each node to generate a clone file repeatedly like,<br class="">
reflink &quot;/mnt/shared/test&quot; \<br class="">
&nbsp;&nbsp;&quot;/mnt/shared/.snapshots/test.`date +%m%d%H%M%S`.`hostname`&quot;<br class="">
<br class="">
after a while, the reflink process on each node is hung, the user<br class="">
cannot list the file system again.<br class="">
<br class="">
The problematic reflink command process is blocked at one node, like<br class="">
__schedule+0x2fd/0x750<br class="">
schedule+0x2f/0xa0<br class="">
schedule_timeout+0x1cc/0x310<br class="">
? ocfs2_control_cfu+0x50/0x50 [ocfs2_stack_user]<br class="">
? 0xffffffffc0e3e000<br class="">
wait_for_completion+0xba/0x140<br class="">
? wake_up_q+0xa0/0xa0<br class="">
__ocfs2_cluster_lock.isra.41+0x3b5/0x820 [ocfs2]<br class="">
? ocfs2_inode_lock_full_nested+0x1fc/0x960 [ocfs2]<br class="">
ocfs2_inode_lock_full_nested+0x1fc/0x960 [ocfs2]<br class="">
ocfs2_init_security_and_acl+0xbe/0x1d0 [ocfs2]<br class="">
ocfs2_reflink+0x436/0x4c0 [ocfs2]<br class="">
? ocfs2_reflink_ioctl+0x2ca/0x360 [ocfs2]<br class="">
ocfs2_reflink_ioctl+0x2ca/0x360 [ocfs2]<br class="">
ocfs2_ioctl+0x25e/0x670 [ocfs2]<br class="">
do_vfs_ioctl+0xa0/0x680<br class="">
ksys_ioctl+0x70/0x80<br class="">
__x64_sys_ioctl+0x16/0x20<br class="">
<br class="">
In fact, this node has acquired .snapshots directory inode dlm lock,<br class="">
but the reflink process is blocked at ocfs2_init_security_and_acl+0xbe/0x1d0, the process is wait for getting<br class="">
.snapshots directory inode dlm lock.<br class="">
The reflink process on other nodes is also blocked at getting .snapshots<br class="">
directory inode dlm lock, then the file system cannot be listed since &quot;ls -l&quot; command also need to get .snapshot directory's attributes.<br class="">
<br class="">
</blockquote>
I still didn’t get which locks are involved in the dead lock party.<br class="">
If that is not clear, it’s hard to review your patch further.<br class="">
</blockquote>
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">.snapshot
 inode dlm lock, the node has acquired this lock, then</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">acquire
 it again, this is a deadlock key point.</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
</div>
</blockquote>
<div><br class="">
</div>
If the .snapshot inode lock is already granted to node1, it shouldn’t block when the processes on node 1 lock it again. It just increases the in use counter.<br class="">
<br class="">
<blockquote type="cite" class="">
<div class="">
<blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<blockquote type="cite" class="">Why the the reflink process is blocked at ocfs2_init_security_and_acl+0xbe/0x1d0? I feel it is caused by multiple acquiring the .snapshots directory inode dlm lock in ocfs2_reflink function. For the deeper reasons, it is probably
 related to dlmglue layer or there is any factor which blocked .snapshots inode dlm lock to downconvert.<br class="">
</blockquote>
I suggest you take tcpdump in your system and get clear what was going on. &nbsp;So you can remove the words like “feel” or “probably” next time.<br class="">
If the problem is in downconvert, we should fix that instead.<br class="">
</blockquote>
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">I
 think we can fix it via using one time acquire the lock before trying to investigate further. In fact, this way also can improve the performance in case the user run the reflink to clone file to the same directory simultaneously.</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
</div>
</blockquote>
<div>If the downconvert has problem, it also affect other locks (not only for your case), we have to fix it. &nbsp;For performance consideration, it can be in a separated patch.</div>
<div><br class="">
</div>
<div>thanks,</div>
<div>wengang</div>
<br class="">
<blockquote type="cite" class="">
<div class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Thanks</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Gang</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
thanks,<br class="">
wengang<br class="">
<blockquote type="cite" class=""><br class="">
Thanks<br class="">
Gang<br class="">
<br class="">
<br class="">
<br class="">
<br class="">
On 2021/7/31 0:35, Wengang Wang wrote:<br class="">
<blockquote type="cite" class="">Hi Gang,<br class="">
<blockquote type="cite" class="">On Jul 29, 2021, at 11:16 PM, Gang He &lt;<a href="mailto:ghe@suse.com" class="">ghe@suse.com</a>&gt; wrote:<br class="">
<br class="">
Hello Wengang and all,<br class="">
<br class="">
This issue can be reproduced stably when you run the below reflink command line(maybe you also can follow a &quot;rm this file&quot; command line and &nbsp;sleep some usecs) from each node repeatedly for a while.<br class="">
Based on my observation, the reflink processes are always blocked at the below points.<br class="">
From dlm_tool output and crash analysis, the node1 has acquired .snapshots directory inode EX dlm lock, but the reflink process is blocked at ocfs2_init_security_and_acl+0xbe/0x1d0 to acqure it's inode dlm lock again.<br class="">
</blockquote>
So the reflink path on node 1 have .snapshots inode lock granted and is blocking at the new created inode under orphan directory. &nbsp;BTW, what’s .snapshots directory? What’s the call path to lock that .snapshots inode?<br class="">
<blockquote type="cite" class="">On the other two nodes, the reflink processes are blocked at acquire .snapshots directory inode dlm lock, then the whole file system is hung,<br class="">
you can not list this file again.<br class="">
</blockquote>
So there are reflink paths on the other two nodes blocking at .snapshots inode. But what lock they are granted already?<br class="">
For a typical ABBA deadlock,<br class="">
path 1 granted lock A and blocks at lock B<br class="">
path 2 granted lock B and blocks at lock A<br class="">
Per your description, I see this:<br class="">
reflink path on node1 &nbsp;granted .snapshots lock and blocks at new inode lock<br class="">
reflnk paths on onde2/3 block at .snapshots lock.<br class="">
I don't see how deadlock formed… the new inode lock is granted to any of the reflink path on node2/3? how?<br class="">
thanks,<br class="">
wengang<br class="">
<blockquote type="cite" class=""><br class="">
The problem looks like acquiring the destination direcory multiple during ocfs2_reflink, dlm glue layer cannot downconvert lock in some case.<br class="">
e.g.<br class="">
kernel: (ocfs2dc-F50B203,1593,0):ocfs2_downconvert_lock:3674 ERROR: DLM error -16 while calling ocfs2_dlm_lock on resource M000000000000000004661c00000000<br class="">
kernel: (ocfs2dc-F50B203,1593,0):ocfs2_unblock_lock:3918 ERROR: status = -16<br class="">
kernel: (ocfs2dc-F50B203,1593,0):ocfs2_process_blocked_lock:4317 ERROR: status = -16<br class="">
<br class="">
Then, I change the code to acquire this destination direcory dlm lock, and hold the lock until the end of ocfs2_reflink function.<br class="">
After this change, I did not encounter this hang problem again after lots of testing. Second, I find the code change also improve reflink performance, since the code avoids the previous ping-pong effect.<br class="">
<br class="">
Thanks<br class="">
Gang<br class="">
<br class="">
<br class="">
On 2021/7/30 6:07, Wengang Wang wrote:<br class="">
<blockquote type="cite" class="">Hi Gang,<br class="">
I’d suggest you list the call paths on the related nodes, Say call path 1 on node one granted lock A and is requesting for lock B, at the same time, path2 on node two granted lock B and now is requesting for lock A.<br class="">
With that, the problem would be easier to understand.<br class="">
thanks,<br class="">
wengang<br class="">
<blockquote type="cite" class="">On Jul 29, 2021, at 4:02 AM, Gang He &lt;<a href="mailto:ghe@suse.com" class="">ghe@suse.com</a>&gt; wrote:<br class="">
<br class="">
Running reflink from multiple nodes simultaneously to clone a file<br class="">
to the same directory probably triggers a deadlock issue.<br class="">
For example, there is a three node ocfs2 cluster, each node mounts<br class="">
the ocfs2 file system to /mnt/shared, and run the reflink command<br class="">
from each node repeatedly, like<br class="">
&nbsp;reflink &quot;/mnt/shared/test&quot; \<br class="">
&nbsp;&quot;/mnt/shared/.snapshots/test.`date +%m%d%H%M%S`.`hostname`&quot;<br class="">
then, reflink command process will be hung on each node, and you<br class="">
can't list this file system directory.<br class="">
The problematic reflink command process is blocked at one node,<br class="">
task:reflink &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;state:D stack: &nbsp;&nbsp;&nbsp;0 pid: 1283 ppid: &nbsp;4154<br class="">
Call Trace:<br class="">
&nbsp;__schedule+0x2fd/0x750<br class="">
&nbsp;schedule+0x2f/0xa0<br class="">
&nbsp;schedule_timeout+0x1cc/0x310<br class="">
&nbsp;? ocfs2_control_cfu+0x50/0x50 [ocfs2_stack_user]<br class="">
&nbsp;? 0xffffffffc0e3e000<br class="">
&nbsp;wait_for_completion+0xba/0x140<br class="">
&nbsp;? wake_up_q+0xa0/0xa0<br class="">
&nbsp;__ocfs2_cluster_lock.isra.41+0x3b5/0x820 [ocfs2]<br class="">
&nbsp;? ocfs2_inode_lock_full_nested+0x1fc/0x960 [ocfs2]<br class="">
&nbsp;ocfs2_inode_lock_full_nested+0x1fc/0x960 [ocfs2]<br class="">
&nbsp;ocfs2_init_security_and_acl+0xbe/0x1d0 [ocfs2]<br class="">
&nbsp;ocfs2_reflink+0x436/0x4c0 [ocfs2]<br class="">
&nbsp;? ocfs2_reflink_ioctl+0x2ca/0x360 [ocfs2]<br class="">
&nbsp;ocfs2_reflink_ioctl+0x2ca/0x360 [ocfs2]<br class="">
&nbsp;ocfs2_ioctl+0x25e/0x670 [ocfs2]<br class="">
&nbsp;do_vfs_ioctl+0xa0/0x680<br class="">
&nbsp;ksys_ioctl+0x70/0x80<br class="">
&nbsp;__x64_sys_ioctl+0x16/0x20<br class="">
&nbsp;do_syscall_64+0x5b/0x1e0<br class="">
The other reflink command processes are blocked at other nodes,<br class="">
task:reflink &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;state:D stack: &nbsp;&nbsp;&nbsp;0 pid:29759 ppid: &nbsp;4088<br class="">
Call Trace:<br class="">
&nbsp;__schedule+0x2fd/0x750<br class="">
&nbsp;schedule+0x2f/0xa0<br class="">
&nbsp;schedule_timeout+0x1cc/0x310<br class="">
&nbsp;? ocfs2_control_cfu+0x50/0x50 [ocfs2_stack_user]<br class="">
&nbsp;? 0xffffffffc0b19000<br class="">
&nbsp;wait_for_completion+0xba/0x140<br class="">
&nbsp;? wake_up_q+0xa0/0xa0<br class="">
&nbsp;__ocfs2_cluster_lock.isra.41+0x3b5/0x820 [ocfs2]<br class="">
&nbsp;? ocfs2_inode_lock_full_nested+0x1fc/0x960 [ocfs2]<br class="">
&nbsp;ocfs2_inode_lock_full_nested+0x1fc/0x960 [ocfs2]<br class="">
&nbsp;ocfs2_mv_orphaned_inode_to_new+0x87/0x7e0 [ocfs2]<br class="">
&nbsp;ocfs2_reflink+0x335/0x4c0 [ocfs2]<br class="">
&nbsp;? ocfs2_reflink_ioctl+0x2ca/0x360 [ocfs2]<br class="">
&nbsp;ocfs2_reflink_ioctl+0x2ca/0x360 [ocfs2]<br class="">
&nbsp;ocfs2_ioctl+0x25e/0x670 [ocfs2]<br class="">
&nbsp;do_vfs_ioctl+0xa0/0x680<br class="">
&nbsp;ksys_ioctl+0x70/0x80<br class="">
&nbsp;__x64_sys_ioctl+0x16/0x20<br class="">
&nbsp;do_syscall_64+0x5b/0x1e0<br class="">
or<br class="">
task:reflink &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;state:D stack: &nbsp;&nbsp;&nbsp;0 pid:18465 ppid: &nbsp;4156<br class="">
Call Trace:<br class="">
&nbsp;__schedule+0x302/0x940<br class="">
&nbsp;? usleep_range+0x80/0x80<br class="">
&nbsp;schedule+0x46/0xb0<br class="">
&nbsp;schedule_timeout+0xff/0x140<br class="">
&nbsp;? ocfs2_control_cfu+0x50/0x50 [ocfs2_stack_user]<br class="">
&nbsp;? 0xffffffffc0c3b000<br class="">
&nbsp;__wait_for_common+0xb9/0x170<br class="">
&nbsp;__ocfs2_cluster_lock.constprop.0+0x1d6/0x860 [ocfs2]<br class="">
&nbsp;? ocfs2_wait_for_recovery+0x49/0xd0 [ocfs2]<br class="">
&nbsp;? ocfs2_inode_lock_full_nested+0x30f/0xa50 [ocfs2]<br class="">
&nbsp;ocfs2_inode_lock_full_nested+0x30f/0xa50 [ocfs2]<br class="">
&nbsp;ocfs2_inode_lock_tracker+0xf2/0x2b0 [ocfs2]<br class="">
&nbsp;? dput+0x32/0x2f0<br class="">
&nbsp;ocfs2_permission+0x45/0xe0 [ocfs2]<br class="">
&nbsp;inode_permission+0xcc/0x170<br class="">
&nbsp;link_path_walk.part.0.constprop.0+0x2a2/0x380<br class="">
&nbsp;? path_init+0x2c1/0x3f0<br class="">
&nbsp;path_parentat+0x3c/0x90<br class="">
&nbsp;filename_parentat+0xc1/0x1d0<br class="">
&nbsp;? filename_lookup+0x138/0x1c0<br class="">
&nbsp;filename_create+0x43/0x160<br class="">
&nbsp;ocfs2_reflink_ioctl+0xe6/0x380 [ocfs2]<br class="">
&nbsp;ocfs2_ioctl+0x1ea/0x2c0 [ocfs2]<br class="">
&nbsp;? do_sys_openat2+0x81/0x150<br class="">
&nbsp;__x64_sys_ioctl+0x82/0xb0<br class="">
&nbsp;do_syscall_64+0x61/0xb0<br class="">
<br class="">
The deadlock is caused by multiple acquiring the destination directory<br class="">
inode dlm lock in ocfs2_reflink function, we should acquire this<br class="">
directory inode dlm lock at the beginning, and hold this dlm lock until<br class="">
end of the function.<br class="">
<br class="">
Signed-off-by: Gang He &lt;<a href="mailto:ghe@suse.com" class="">ghe@suse.com</a>&gt;<br class="">
---<br class="">
fs/ocfs2/namei.c &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| 32 +++++++++++++-------------------<br class="">
fs/ocfs2/namei.h &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| &nbsp;2 ++<br class="">
fs/ocfs2/refcounttree.c | 15 +++++++++++----<br class="">
fs/ocfs2/xattr.c &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| 12 +-----------<br class="">
fs/ocfs2/xattr.h &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| &nbsp;1 +<br class="">
5 files changed, 28 insertions(+), 34 deletions(-)<br class="">
<br class="">
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c<br class="">
index 2c46ff6ba4ea..f8bbb22cc60b 100644<br class="">
--- a/fs/ocfs2/namei.c<br class="">
+++ b/fs/ocfs2/namei.c<br class="">
@@ -2489,6 +2489,7 @@ static int ocfs2_prep_new_orphaned_file(struct inode *dir,<br class="">
}<br class="">
<br class="">
int ocfs2_create_inode_in_orphan(struct inode *dir,<br class="">
+<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-converted-space">&nbsp;</span>struct
 buffer_head **dir_bh,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-converted-space">&nbsp;</span>int
 mode,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-converted-space">&nbsp;</span>struct
 inode **new_inode)<br class="">
{<br class="">
@@ -2597,13 +2598,16 @@ int ocfs2_create_inode_in_orphan(struct inode *dir,<br class="">
<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>brelse(new_di_bh);<br class="">
<br class="">
-<span class="Apple-tab-span" style="white-space: pre;"> </span>if (!status)<br class="">
-<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"></span>*new_inode = inode;<br class="">
-<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>ocfs2_free_dir_lookup_result(&amp;orphan_insert);<br class="">
<br class="">
-<span class="Apple-tab-span" style="white-space: pre;"> </span>ocfs2_inode_unlock(dir, 1);<br class="">
-<span class="Apple-tab-span" style="white-space: pre;"> </span>brelse(parent_di_bh);<br class="">
+<span class="Apple-tab-span" style="white-space: pre;"> </span>if (!status) {<br class="">
+<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"></span>*new_inode = inode;<br class="">
+<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"></span>*dir_bh = parent_di_bh;<br class="">
+<span class="Apple-tab-span" style="white-space: pre;"> </span>} else {<br class="">
+<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"></span>ocfs2_inode_unlock(dir, 1);<br class="">
+<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"></span>brelse(parent_di_bh);<br class="">
+<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br class="">
+<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>return status;<br class="">
}<br class="">
<br class="">
@@ -2760,11 +2764,11 @@ int ocfs2_del_inode_from_orphan(struct ocfs2_super *osb,<br class="">
}<br class="">
<br class="">
int ocfs2_mv_orphaned_inode_to_new(struct inode *dir,<br class="">
+<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-converted-space">&nbsp;</span>&nbsp;&nbsp;struct
 buffer_head *dir_bh,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-converted-space">&nbsp;</span>&nbsp;&nbsp;struct
 inode *inode,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-converted-space">&nbsp;</span>&nbsp;&nbsp;struct
 dentry *dentry)<br class="">
{<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>int status = 0;<br class="">
-<span class="Apple-tab-span" style="white-space: pre;"> </span>struct buffer_head *parent_di_bh = NULL;<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>handle_t *handle = NULL;<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>struct ocfs2_super *osb = OCFS2_SB(dir-&gt;i_sb);<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>struct ocfs2_dinode *dir_di, *di;<br class="">
@@ -2778,14 +2782,7 @@ int ocfs2_mv_orphaned_inode_to_new(struct inode *dir,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span>(unsigned
 long long)OCFS2_I(dir)-&gt;ip_blkno,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span>(unsigned
 long long)OCFS2_I(inode)-&gt;ip_blkno);<br class="">
<br class="">
-<span class="Apple-tab-span" style="white-space: pre;"> </span>status = ocfs2_inode_lock(dir, &amp;parent_di_bh, 1);<br class="">
-<span class="Apple-tab-span" style="white-space: pre;"> </span>if (status &lt; 0) {<br class="">
-<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"></span>if (status != -ENOENT)<br class="">
-<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span>mlog_errno(status);<br class="">
-<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"></span>return status;<br class="">
-<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br class="">
-<br class="">
-<span class="Apple-tab-span" style="white-space: pre;"> </span>dir_di = (struct ocfs2_dinode *) parent_di_bh-&gt;b_data;<br class="">
+<span class="Apple-tab-span" style="white-space: pre;"> </span>dir_di = (struct ocfs2_dinode *) dir_bh-&gt;b_data;<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>if (!dir_di-&gt;i_links_count) {<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span>/* can't make a file in a deleted directory. */<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span>status = -ENOENT;<br class="">
@@ -2798,7 +2795,7 @@ int ocfs2_mv_orphaned_inode_to_new(struct inode *dir,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span>goto leave;<br class="">
<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>/* get a spot inside the dir. */<br class="">
-<span class="Apple-tab-span" style="white-space: pre;"> </span>status = ocfs2_prepare_dir_for_insert(osb, dir, parent_di_bh,<br class="">
+<span class="Apple-tab-span" style="white-space: pre;"> </span>status = ocfs2_prepare_dir_for_insert(osb, dir, dir_bh,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-converted-space">&nbsp;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dentry-&gt;d_name.name,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-converted-space">&nbsp;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dentry-&gt;d_name.len,
 &amp;lookup);<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>if (status &lt; 0) {<br class="">
@@ -2862,7 +2859,7 @@ int ocfs2_mv_orphaned_inode_to_new(struct inode *dir,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>ocfs2_journal_dirty(handle, di_bh);<br class="">
<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>status = ocfs2_add_entry(handle, dentry, inode,<br class="">
-<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-converted-space">&nbsp;</span>OCFS2_I(inode)-&gt;ip_blkno,
 parent_di_bh,<br class="">
+<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-converted-space">&nbsp;</span>OCFS2_I(inode)-&gt;ip_blkno,
 dir_bh,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-converted-space">&nbsp;</span>&amp;lookup);<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>if (status &lt; 0) {<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span>mlog_errno(status);<br class="">
@@ -2886,10 +2883,7 @@ int ocfs2_mv_orphaned_inode_to_new(struct inode *dir,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>iput(orphan_dir_inode);<br class="">
leave:<br class="">
<br class="">
-<span class="Apple-tab-span" style="white-space: pre;"> </span>ocfs2_inode_unlock(dir, 1);<br class="">
-<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>brelse(di_bh);<br class="">
-<span class="Apple-tab-span" style="white-space: pre;"> </span>brelse(parent_di_bh);<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>brelse(orphan_dir_bh);<br class="">
<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>ocfs2_free_dir_lookup_result(&amp;lookup);<br class="">
diff --git a/fs/ocfs2/namei.h b/fs/ocfs2/namei.h<br class="">
index 9cc891eb874e..03a2c526e2c1 100644<br class="">
--- a/fs/ocfs2/namei.h<br class="">
+++ b/fs/ocfs2/namei.h<br class="">
@@ -24,6 +24,7 @@ int ocfs2_orphan_del(struct ocfs2_super *osb,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-converted-space">&nbsp;</span>&nbsp;&nbsp;&nbsp;&nbsp;struct buffer_head *orphan_dir_bh,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-converted-space">&nbsp;</span>&nbsp;&nbsp;&nbsp;&nbsp;bool dio);<br class="">
int ocfs2_create_inode_in_orphan(struct inode *dir,<br class="">
+<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-converted-space">&nbsp;</span>struct
 buffer_head **dir_bh,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-converted-space">&nbsp;</span>int
 mode,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-converted-space">&nbsp;</span>struct
 inode **new_inode);<br class="">
int ocfs2_add_inode_to_orphan(struct ocfs2_super *osb,<br class="">
@@ -32,6 +33,7 @@ int ocfs2_del_inode_from_orphan(struct ocfs2_super *osb,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span>struct inode *inode, struct buffer_head *di_bh,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span>int update_isize, loff_t end);<br class="">
int ocfs2_mv_orphaned_inode_to_new(struct inode *dir,<br class="">
+<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-converted-space">&nbsp;</span>&nbsp;&nbsp;struct
 buffer_head *dir_bh,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-converted-space">&nbsp;</span>&nbsp;&nbsp;struct
 inode *new_inode,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-converted-space">&nbsp;</span>&nbsp;&nbsp;struct
 dentry *new_dentry);<br class="">
<br class="">
diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c<br class="">
index 7f6355cbb587..a9a0c7c37e8e 100644<br class="">
--- a/fs/ocfs2/refcounttree.c<br class="">
+++ b/fs/ocfs2/refcounttree.c<br class="">
@@ -4250,7 +4250,7 @@ static int ocfs2_reflink(struct dentry *old_dentry, struct inode *dir,<br class="">
{<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>int error, had_lock;<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>struct inode *inode = d_inode(old_dentry);<br class="">
-<span class="Apple-tab-span" style="white-space: pre;"> </span>struct buffer_head *old_bh = NULL;<br class="">
+<span class="Apple-tab-span" style="white-space: pre;"> </span>struct buffer_head *old_bh = NULL, *dir_bh = NULL;<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>struct inode *new_orphan_inode = NULL;<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>struct ocfs2_lock_holder oh;<br class="">
<br class="">
@@ -4258,7 +4258,7 @@ static int ocfs2_reflink(struct dentry *old_dentry, struct inode *dir,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span>return -EOPNOTSUPP;<br class="">
<br class="">
<br class="">
-<span class="Apple-tab-span" style="white-space: pre;"> </span>error = ocfs2_create_inode_in_orphan(dir, inode-&gt;i_mode,<br class="">
+<span class="Apple-tab-span" style="white-space: pre;"> </span>error = ocfs2_create_inode_in_orphan(dir, &amp;dir_bh, inode-&gt;i_mode,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-converted-space">&nbsp;</span>&nbsp;&nbsp;&nbsp;&nbsp;&amp;new_orphan_inode);<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>if (error) {<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span>mlog_errno(error);<br class="">
@@ -4304,13 +4304,15 @@ static int ocfs2_reflink(struct dentry *old_dentry, struct inode *dir,<br class="">
<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>/* If the security isn't preserved, we need to re-initialize them. */<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>if (!preserve) {<br class="">
-<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"></span>error = ocfs2_init_security_and_acl(dir, new_orphan_inode,<br class="">
+<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"></span>error = ocfs2_init_security_and_acl(dir, dir_bh,<br class="">
+<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-converted-space">&nbsp;</span>&nbsp;&nbsp;&nbsp;new_orphan_inode,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-converted-space">&nbsp;</span>&nbsp;&nbsp;&nbsp;&amp;new_dentry-&gt;d_name);<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span>if (error)<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span>mlog_errno(error);<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>}<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>if (!error) {<br class="">
-<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"></span>error = ocfs2_mv_orphaned_inode_to_new(dir, new_orphan_inode,<br class="">
+<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"></span>error = ocfs2_mv_orphaned_inode_to_new(dir, dir_bh,<br class="">
+<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-converted-space">&nbsp;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new_orphan_inode,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-converted-space">&nbsp;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new_dentry);<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span>if (error)<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span>mlog_errno(error);<br class="">
@@ -4328,6 +4330,11 @@ static int ocfs2_reflink(struct dentry *old_dentry, struct inode *dir,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span>iput(new_orphan_inode);<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>}<br class="">
<br class="">
+<span class="Apple-tab-span" style="white-space: pre;"> </span>if (dir_bh) {<br class="">
+<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"></span>ocfs2_inode_unlock(dir, 1);<br class="">
+<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"></span>brelse(dir_bh);<br class="">
+<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br class="">
+<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>return error;<br class="">
}<br class="">
<br class="">
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c<br class="">
index dd784eb0cd7c..3f23e3a5018c 100644<br class="">
--- a/fs/ocfs2/xattr.c<br class="">
+++ b/fs/ocfs2/xattr.c<br class="">
@@ -7203,16 +7203,13 @@ int ocfs2_reflink_xattrs(struct inode *old_inode,<br class="">
/*<br class="">
&nbsp;* Initialize security and acl for a already created inode.<br class="">
&nbsp;* Used for reflink a non-preserve-security file.<br class="">
- *<br class="">
- * It uses common api like ocfs2_xattr_set, so the caller<br class="">
- * must not hold any lock expect i_mutex.<br class="">
&nbsp;*/<br class="">
int ocfs2_init_security_and_acl(struct inode *dir,<br class="">
+<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span>struct
 buffer_head *dir_bh,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span>struct inode
 *inode,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span>const struct
 qstr *qstr)<br class="">
{<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>int ret = 0;<br class="">
-<span class="Apple-tab-span" style="white-space: pre;"> </span>struct buffer_head *dir_bh = NULL;<br class="">
<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>ret = ocfs2_init_security_get(inode, dir, qstr, NULL);<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>if (ret) {<br class="">
@@ -7220,17 +7217,10 @@ int ocfs2_init_security_and_acl(struct inode *dir,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span>goto leave;<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>}<br class="">
<br class="">
-<span class="Apple-tab-span" style="white-space: pre;"> </span>ret = ocfs2_inode_lock(dir, &amp;dir_bh, 0);<br class="">
-<span class="Apple-tab-span" style="white-space: pre;"> </span>if (ret) {<br class="">
-<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"></span>mlog_errno(ret);<br class="">
-<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"></span>goto leave;<br class="">
-<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>ret = ocfs2_init_acl(NULL, inode, dir, NULL, dir_bh, NULL, NULL);<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>if (ret)<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span>mlog_errno(ret);<br class="">
<br class="">
-<span class="Apple-tab-span" style="white-space: pre;"> </span>ocfs2_inode_unlock(dir, 0);<br class="">
-<span class="Apple-tab-span" style="white-space: pre;"> </span>brelse(dir_bh);<br class="">
leave:<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span>return ret;<br class="">
}<br class="">
diff --git a/fs/ocfs2/xattr.h b/fs/ocfs2/xattr.h<br class="">
index 00308b57f64f..b27fd8ba0019 100644<br class="">
--- a/fs/ocfs2/xattr.h<br class="">
+++ b/fs/ocfs2/xattr.h<br class="">
@@ -83,6 +83,7 @@ int ocfs2_reflink_xattrs(struct inode *old_inode,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-converted-space">&nbsp;</span>struct buffer_head *new_bh,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-converted-space">&nbsp;</span>bool preserve_security);<br class="">
int ocfs2_init_security_and_acl(struct inode *dir,<br class="">
+<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span>struct
 buffer_head *dir_bh,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span>struct inode
 *inode,<br class="">
<span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span><span class="Apple-tab-span" style="white-space: pre;"></span>const struct
 qstr *qstr);<br class="">
#endif /* OCFS2_XATTR_H */<br class="">
--<span class="Apple-converted-space">&nbsp;</span><br class="">
2.21.0<br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
Ocfs2-devel mailing list<br class="">
<a href="mailto:Ocfs2-devel@oss.oracle.com" class="">Ocfs2-devel@oss.oracle.com</a><br class="">
https://oss.oracle.com/mailman/listinfo/ocfs2-devel</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</div>
</blockquote>
</div>
<br class="">
</body>
</html>