On Thu, May 21, 2015 at 09:05:36PM +0200, gianpietro.sella@xxxxxxxx wrote: > > On Wed, May 13, 2015 at 07:38:03PM +0000, gianpietro sella wrote: > >> J. Bruce Fields <bfields <at> fieldses.org> writes: > >> > >> > > >> > On Wed, May 13, 2015 at 01:06:17PM +0200, sella gianpietro wrote: > >> > > this is the inodes number in the exported folder of the volume > >> > > in the server before write file in the client: > >> > > > >> > > [root <at> cld-blu-13 nova]# du --inodes > >> > > 2 . > >> > > > >> > > this is the used block: > >> > > > >> > > [root <at> cld-blu-13 nova]# df -T > >> > > Filesystem Type 1K-blocks Used > >> Available > >> > > Use% Mounted on > >> > > /dev/mapper/nfsclustervg-nfsclusterlv xfs 1152878588 33000 > >> 1152845588 > >> > > 1% /nfscluster > >> > > > >> > > after write file in the client with umount/mount during writing: > >> > > > >> > > [root <at> cld-blu-13 nova]# du --inodes > >> > > 3 . > >> > > > >> > > [root <at> cld-blu-13 nova]# df -T > >> > > Filesystem Type 1K-blocks Used > >> > > Available Use% Mounted on > >> > > /dev/mapper/nfsclustervg-nfsclusterlv xfs 1152878588 21004520 > >> > > 1131874068 2% /nfscluster > >> > > > >> > > thi is correct. > >> > > now delete file: > >> > > > >> > > [root <at> cld-blu-13 nova]# du --inodes > >> > > 2 . > >> > > > >> > > the number of the inodes is correct (from 3 to 2). > >> > > > >> > > [root <at> cld-blu-13 nova]# df -T > >> > > Filesystem Type 1K-blocks Used > >> > > Available Use% Mounted on > >> > > /dev/mapper/nfsclustervg-nfsclusterlv xfs 1152878588 21004520 > >> > > 1131874068 2% /nfscluster > >> > > > >> > > the number of used block is not correct. > >> > > Do not return to initial value 33000 > >> > > >> > If you try "df -i", you'll probably also find that it gives the > >> "wrong" > >> > result. (So, probably 3 inodes, though "du --inodes" is still only > >> > finding 2). > >> > > >> > --b. > >> > > >> > >> > >> the problem is that after delete file the inode go in the orphaned > >> state: > > > > Yeah, that's consistent with everything else--we're not removing a > > dentry when we should for some reason, so the inode's staying > > referenced. > > > > --b. > > > > tanks Bruce. > yes this is true. > I use nfs cluster on 2 node for nova instances in openstack (the instamces > are stored on nfs folder). > the probability that I create an file before an failover and then I delete > the file file after failover is very little. > In this case I can execute an "mount -o remount" after the failover and > delete command and the orpahned inode is deleted and the free disk space > is ok. > I do not understand who use the file after failover and delete command. > After I delete the file I do not see process that use the deleted file. > this is very strange. > But my is just an curiosity. > I think that the cause is the unmount operation on the failover node. Apologies for the delayed response. In the process of debugging something else we ran into a problem that looks like yours. Is it possible for you to test a kernel patch? If so, it would be interesting to know if your problem is still reproduceable after this patch: http://marc.info/?l=linux-fsdevel&m=143631977822355&w=2 also appended. --b. diff --git a/fs/dcache.c b/fs/dcache.c index 7a3f3e5..5c8ea15 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -642,7 +642,7 @@ static inline bool fast_dput(struct dentry *dentry) /* * If we have a d_op->d_delete() operation, we sould not - * let the dentry count go to zero, so use "put__or_lock". + * let the dentry count go to zero, so use "put_or_lock". */ if (unlikely(dentry->d_flags & DCACHE_OP_DELETE)) return lockref_put_or_lock(&dentry->d_lockref); @@ -697,7 +697,7 @@ static inline bool fast_dput(struct dentry *dentry) */ smp_rmb(); d_flags = ACCESS_ONCE(dentry->d_flags); - d_flags &= DCACHE_REFERENCED | DCACHE_LRU_LIST; + d_flags &= DCACHE_REFERENCED | DCACHE_LRU_LIST | DCACHE_DISCONNECTED; /* Nothing to do? Dropping the reference was all we needed? */ if (d_flags == (DCACHE_REFERENCED | DCACHE_LRU_LIST) && !d_unhashed(dentry)) @@ -776,6 +776,9 @@ repeat: if (unlikely(d_unhashed(dentry))) goto kill_it; + if (unlikely(dentry->d_flags & DCACHE_DISCONNECTED)) + goto kill_it; + if (unlikely(dentry->d_flags & DCACHE_OP_DELETE)) { if (dentry->d_op->d_delete(dentry)) goto kill_it; -- Linux-cluster mailing list Linux-cluster@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/linux-cluster